From noreply at r-forge.r-project.org Mon Jul 1 17:20:52 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 1 Jul 2013 17:20:52 +0200 (CEST) Subject: [CHNOSZ-commits] r54 - in pkg/CHNOSZ: . R inst man vignettes Message-ID: <20130701152052.710F818596D@r-forge.r-project.org> Author: jedick Date: 2013-07-01 17:20:52 +0200 (Mon, 01 Jul 2013) New Revision: 54 Modified: pkg/CHNOSZ/DESCRIPTION pkg/CHNOSZ/R/more.aa.R pkg/CHNOSZ/R/util.list.R pkg/CHNOSZ/inst/NEWS pkg/CHNOSZ/man/util.expression.Rd pkg/CHNOSZ/vignettes/wjd.Rnw pkg/CHNOSZ/vignettes/wjd.lyx Log: remove inconsolata.sty from wjd.Rnw Modified: pkg/CHNOSZ/DESCRIPTION =================================================================== --- pkg/CHNOSZ/DESCRIPTION 2013-06-02 05:15:42 UTC (rev 53) +++ pkg/CHNOSZ/DESCRIPTION 2013-07-01 15:20:52 UTC (rev 54) @@ -1,6 +1,6 @@ -Date: 2013-06-02 +Date: 2013-07-01 Package: CHNOSZ -Version: 1.0.0-2 +Version: 1.0.0-3 Title: Chemical Thermodynamics and Activity Diagrams Author: Jeffrey M. Dick Maintainer: Jeffrey M. Dick Modified: pkg/CHNOSZ/R/more.aa.R =================================================================== --- pkg/CHNOSZ/R/more.aa.R 2013-06-02 05:15:42 UTC (rev 53) +++ pkg/CHNOSZ/R/more.aa.R 2013-07-01 15:20:52 UTC (rev 54) @@ -1,6 +1,5 @@ # CHNOSZ/more.aa.R -# get amino acid compositions of proteins from -# model organisms really exciting! +# get amino acid compositions of proteins from model organisms # (Eco.csv or Sce.csv) more.aa <- function(protein=NULL, organism) { @@ -16,17 +15,13 @@ msgout("more.aa: ", datapath, " has data for ", nrow(mydata), " proteins\n") return(invisible()) } - if(organism=="Sce") { - # which columns to search for matches - searchcols <- c("OLN", "OLN") - # which columns have the amino acids in the order of thermo$protein - iaa <- c(1,5,4,7,14,8,9,10,12,11,13,3,15,6,2,16,17,20,18,19) + 2 - } else if(organism=="Eco") { - # which columns to search for matches - searchcols <- c("protein", "abbrv") - # which columns have the amino acids in the order of thermo$protein - iaa <- 1:20 + 5 - } + # which columns to search for matches + # include "OLN" (Sce.csv dated 2008-08-04) + # and "ORF" (Sce.csv dated 2013-06-04) + if(organism=="Sce") searchcols <- c("OLN", "ORF", "SGDID") + else if(organism=="Eco") searchcols <- c("protein", "abbrv") + # which columns have the amino acids, in the order of thermo$protein + iaa <- match(toupper(aminoacids(3)), toupper(colnames(mydata))) # iterate over a list waslist <- TRUE out <- list() @@ -36,11 +31,13 @@ } for(i in 1:length(protein)) { # find the matches - icols <- match(searchcols, colnames(mydata)) - imatch <- match(protein[[i]], mydata[, icols[1]]) - imatch2 <- match(protein[[i]], mydata[, icols[2]]) - # use not-NA matches for "abbrv" in Eco.csv - imatch[!is.na(imatch2)] <- imatch2[!is.na(imatch2)] + imatch <- rep(NA, length(protein[[i]])) + for(cname in searchcols) { + icol <- match(cname, colnames(mydata)) + if(is.na(icol)) next + iimatch <- match(protein[[i]], mydata[, icol]) + imatch[!is.na(iimatch)] <- iimatch[!is.na(iimatch)] + } # report and remember the unsuccessful matches if(all(is.na(imatch))) stop("no proteins found!") inotmatch <- which(is.na(imatch)) Modified: pkg/CHNOSZ/R/util.list.R =================================================================== --- pkg/CHNOSZ/R/util.list.R 2013-06-02 05:15:42 UTC (rev 53) +++ pkg/CHNOSZ/R/util.list.R 2013-07-01 15:20:52 UTC (rev 54) @@ -4,6 +4,7 @@ which.pmax <- function (elts, na.rm = FALSE, pmin=FALSE) { # adapted from R's pmax. elts is a list of numeric vectors if(!is.numeric(elts[[1]])[1]) { + if(is.data.frame(elts[[1]])) elts[[1]] <- as.matrix(elts[[1]]) if(is.list(elts[[1]])) elts[[1]] <- elts[[1]][[1]] else elts[[1]] <- as.numeric(elts[[1]]) } Modified: pkg/CHNOSZ/inst/NEWS =================================================================== --- pkg/CHNOSZ/inst/NEWS 2013-06-02 05:15:42 UTC (rev 53) +++ pkg/CHNOSZ/inst/NEWS 2013-07-01 15:20:52 UTC (rev 54) @@ -1,4 +1,4 @@ -CHANGES IN CHNOSZ 1.0.0-2 (2013-06-02) +CHANGES IN CHNOSZ 1.0.0-3 (2013-07-01) -------------------------------------- - Fix IAPWS-95 calculations for subcrt(): in water.IAPWS95(), rename Modified: pkg/CHNOSZ/man/util.expression.Rd =================================================================== --- pkg/CHNOSZ/man/util.expression.Rd 2013-06-02 05:15:42 UTC (rev 53) +++ pkg/CHNOSZ/man/util.expression.Rd 2013-07-01 15:20:52 UTC (rev 54) @@ -15,7 +15,8 @@ expr.property(property) expr.units(property, prefix = "", per = "mol") axis.label(label, units = NULL, basis = get("thermo")$basis, prefix = "") - describe.basis(basis = get("thermo")$basis, ibasis = 1:nrow(basis), digits = 1, oneline = FALSE) + describe.basis(basis = get("thermo")$basis, ibasis = 1:nrow(basis), digits = 1, + oneline = FALSE) describe.property(property, value, digits = 1, oneline = FALSE, ret.val = FALSE) describe.reaction(reaction, iname = numeric(), states = NULL) } Modified: pkg/CHNOSZ/vignettes/wjd.Rnw =================================================================== --- pkg/CHNOSZ/vignettes/wjd.Rnw 2013-06-02 05:15:42 UTC (rev 53) +++ pkg/CHNOSZ/vignettes/wjd.Rnw 2013-07-01 15:20:52 UTC (rev 54) @@ -1,12 +1,13 @@ -%% LyX 2.0.5 created this file. For more info, see http://www.lyx.org/. +%% LyX 2.0.6 created this file. For more info, see http://www.lyx.org/. %% Do not edit unless you really know what you are doing. -\documentclass[noae,round]{article} +\documentclass[english,noae,round]{article} \usepackage{mathpazo} \usepackage[T1]{fontenc} \usepackage[latin9]{inputenc} \usepackage[letterpaper]{geometry} \geometry{verbose,tmargin=2.5cm,bmargin=2.5cm,lmargin=2.5cm,rmargin=2.5cm} \usepackage{color} +\usepackage{babel} \usepackage[authoryear]{natbib} \usepackage[unicode=true, bookmarks=true,bookmarksnumbered=false,bookmarksopen=false, @@ -29,9 +30,6 @@ % so DOIs in bibliography show up as hyperlinks \newcommand*{\doi}[1]{\href{http://dx.doi.org/#1}{doi: #1}} -% for monospaced fonts -\usepackage{inconsolata} - \makeatother \begin{document} Modified: pkg/CHNOSZ/vignettes/wjd.lyx =================================================================== --- pkg/CHNOSZ/vignettes/wjd.lyx 2013-06-02 05:15:42 UTC (rev 53) +++ pkg/CHNOSZ/vignettes/wjd.lyx 2013-07-01 15:20:52 UTC (rev 54) @@ -8,9 +8,6 @@ % so DOIs in bibliography show up as hyperlinks \newcommand*{\doi}[1]{\href{http://dx.doi.org/#1}{doi: #1}} - -% for monospaced fonts -\usepackage{inconsolata} \end_preamble \options round \use_default_options true From noreply at r-forge.r-project.org Thu Jul 4 18:15:01 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 4 Jul 2013 18:15:01 +0200 (CEST) Subject: [CHNOSZ-commits] r55 - in pkg/CHNOSZ: . inst Message-ID: <20130704161501.B3185184644@r-forge.r-project.org> Author: jedick Date: 2013-07-04 18:15:01 +0200 (Thu, 04 Jul 2013) New Revision: 55 Modified: pkg/CHNOSZ/DESCRIPTION pkg/CHNOSZ/inst/NEWS Log: prepare version 1.0.1 for release on CRAN Modified: pkg/CHNOSZ/DESCRIPTION =================================================================== --- pkg/CHNOSZ/DESCRIPTION 2013-07-01 15:20:52 UTC (rev 54) +++ pkg/CHNOSZ/DESCRIPTION 2013-07-04 16:15:01 UTC (rev 55) @@ -1,6 +1,6 @@ -Date: 2013-07-01 +Date: 2013-07-04 Package: CHNOSZ -Version: 1.0.0-3 +Version: 1.0.1 Title: Chemical Thermodynamics and Activity Diagrams Author: Jeffrey M. Dick Maintainer: Jeffrey M. Dick Modified: pkg/CHNOSZ/inst/NEWS =================================================================== --- pkg/CHNOSZ/inst/NEWS 2013-07-01 15:20:52 UTC (rev 54) +++ pkg/CHNOSZ/inst/NEWS 2013-07-04 16:15:01 UTC (rev 55) @@ -1,9 +1,9 @@ -CHANGES IN CHNOSZ 1.0.0-3 (2013-07-01) --------------------------------------- +CHANGES IN CHNOSZ 1.0.1 (2013-07-04) +------------------------------------ -- Fix IAPWS-95 calculations for subcrt(): in water.IAPWS95(), rename - internal function from 'epsilon' to 'diel'; in water(), return - upper-case versions of names of properties. +- Allow IAPWS-95 calculations to be used in subcrt(): in + water.IAPWS95(), rename internal function from 'epsilon' to 'diel'; + in water(), return upper-case versions of names of properties. - rho.IAPWS95() has modified search interval to give results at T < 250 K and P < 300 bar. Thanks to Marc Neveu.