[CHNOSZ-commits] r757 - in pkg/CHNOSZ: . R demo inst inst/tinytest man vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Dec 1 06:43:37 CET 2022


Author: jedick
Date: 2022-12-01 06:43:36 +0100 (Thu, 01 Dec 2022)
New Revision: 757

Removed:
   pkg/CHNOSZ/R/findit.R
   pkg/CHNOSZ/demo/findit.R
   pkg/CHNOSZ/inst/tinytest/test-findit.R
   pkg/CHNOSZ/man/findit.Rd
Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/NAMESPACE
   pkg/CHNOSZ/R/examples.R
   pkg/CHNOSZ/demo/00Index
   pkg/CHNOSZ/inst/NEWS.Rd
   pkg/CHNOSZ/man/CHNOSZ-package.Rd
   pkg/CHNOSZ/man/examples.Rd
   pkg/CHNOSZ/man/objective.Rd
   pkg/CHNOSZ/man/revisit.Rd
   pkg/CHNOSZ/vignettes/mklinks.sh
Log:
Remove findit()


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2022-11-27 11:43:35 UTC (rev 756)
+++ pkg/CHNOSZ/DESCRIPTION	2022-12-01 05:43:36 UTC (rev 757)
@@ -1,6 +1,6 @@
-Date: 2022-11-27
+Date: 2022-12-01
 Package: CHNOSZ
-Version: 1.9.9-48
+Version: 1.9.9-49
 Title: Thermodynamic Calculations and Diagrams for Geochemistry
 Authors at R: c(
     person("Jeffrey", "Dick", , "j3ffdick at gmail.com", role = c("aut", "cre"),

Modified: pkg/CHNOSZ/NAMESPACE
===================================================================
--- pkg/CHNOSZ/NAMESPACE	2022-11-27 11:43:35 UTC (rev 756)
+++ pkg/CHNOSZ/NAMESPACE	2022-12-01 05:43:36 UTC (rev 757)
@@ -10,7 +10,7 @@
   "aminoacids", "ZC.col",
   "pinfo", "protein.length", "protein.formula",
   "read.fasta", "protein.basis", "add.protein",
-  "unitize", "revisit", "seq2aa", "findit",
+  "unitize", "revisit", "seq2aa",
   "thermo.refs", "mod.OBIGT",
 # examples
   "examples", "demos", "mtitle",
@@ -42,7 +42,7 @@
   "checkEOS", "checkGHS", "check.OBIGT",
   "DGinf", "SD", "pearson", "shannon", "CV", "logact",
   "basis.elements", "element.mu", "ibasis",
-  "water.SUPCRT92", "plot_findit",
+  "water.SUPCRT92",
   "nonideal", "uniprot.aa",
 # added 20170301 or later
   "GHS_Tr", "calculateDensity", "calculateGibbsOfWater",

Modified: pkg/CHNOSZ/R/examples.R
===================================================================
--- pkg/CHNOSZ/R/examples.R	2022-11-27 11:43:35 UTC (rev 756)
+++ pkg/CHNOSZ/R/examples.R	2022-12-01 05:43:36 UTC (rev 757)
@@ -31,7 +31,7 @@
 }
 
 demos <- function(which=c("sources", "protein.equil", "affinity", "NaCl", "density", 
-  "ORP", "findit", "ionize", "buffer", "protbuff", "glycinate",
+  "ORP", "ionize", "buffer", "protbuff", "glycinate",
   "mosaic", "copper", "arsenic", "solubility", "gold", "contour", "sphalerite", "minsol",
   "Shh", "saturation", "DEW", "lambda", "potassium", "TCA", "aluminum",
   "AD", "comproportionation", "Pourbaix", "E_coli"), save.png=FALSE) {

Deleted: pkg/CHNOSZ/R/findit.R
===================================================================
--- pkg/CHNOSZ/R/findit.R	2022-11-27 11:43:35 UTC (rev 756)
+++ pkg/CHNOSZ/R/findit.R	2022-12-01 05:43:36 UTC (rev 757)
@@ -1,240 +0,0 @@
-# CHNOSZ/findit.R
-# find the minimum or maximum of a objective 
-# (eg cv, richness, shannon)
-# as a function the specified chemical potentials
-# 20100831 jmd
-
-findit <- function(lims=list(), objective="CV", niter=NULL, iprotein=NULL, plot.it=TRUE,
-  T=25, P="Psat", res=NULL, labcex=0.6, loga2=NULL,
-  loga.balance=0, rat=NULL, balance=NULL, normalize=FALSE) {
-  # the lims list has the limits of the arguments to affinity()
-  # we iteratively move toward a higher/lower value of the objective
-  # within these limits
-  
-  # fun stuff: when running on either side of 100 degC,
-  # set P=1 to force an extreme of some functions near that temperature
-  
-  # the number of dimensions
-  nd <- length(lims)
-
-  # get protein lengths if iprotein is given
-  if(!is.null(iprotein)) pl <- protein.length(iprotein)
-
-  # how many gradations in each dimension we can timely 
-  # consider goes down with the number of dimensions
-  if(is.null(res)) res <- c(128,64,16,8,6,4,4)[nd]
-  if(is.null(niter)) niter <- c(4,6,6,8,12,12,12)[nd]
-  # the size fraction of the new intervals after each iteration
-  # we can zoom in more quickly if the gradations are smaller
-  if(is.null(rat)) {
-    rat <- 0.95
-    if(res > 4) rat <- 0.9
-    if(res > 8) rat <- 0.8
-    if(res > 16) rat <- 0.7
-  }
-
-  # the initial values of the guesses (if midpoint==FALSE)
-  basis <- get("thermo", CHNOSZ)$basis
-
-  # a hack so that we can use pH as a variable
-  if("pH" %in% names(lims)) {
-    iH <- match("H+",rownames(basis))
-    if(length(iH) > 0) {
-      rownames(basis)[iH] <- "pH"
-      basis$logact[iH] <- -basis$logact[iH]
-    } else(stop("pH is a requested variable but H+ is not in the basis"))
-  }
-
-  # function to get the current limits of a variable
-  limfun <- function(lim,curr,i) {
-    if(i==1) mylims <- lim
-    else {
-      # in the ith loop we consider intervals
-      # of rat^(i-1) of the ranges specified at start
-      message(paste("optimal:",round(curr,4),"",""), appendLF=FALSE)
-      range <- range(lim)
-      int <- abs(diff(range)) * rat^(i-1)
-      mylims <- c(curr-int/2, curr+int/2)
-      # don't go beyond the starting limits
-      if(any(mylims < min(range))) mylims <- mylims + (min(range) - min(mylims))
-      if(any(mylims > max(range))) mylims <- mylims - (max(mylims) - max(range))
-      # reverse the order if the axis is reversed
-      if(diff(lim) < 0) mylims <- rev(mylims)
-    }
-    message(paste("new limits:",round(mylims[1],4),round(mylims[2],4)))
-    return(mylims)
-  }
-
-  # place to put the output values
-  teststat <- numeric()
-  out <- vector("list",length(lims))
-  names(out) <- names(lims)
-  lolim <- out
-  hilim <- out
-  outlims <- lims
-
-  # loop for the specified number of iterations
-  # (todo: loop until an error threshhold is reached)
-  for(i in 1:niter) {
-    message(paste("\n###### findit: iteration",i,"of",niter))
-    # to generate the argument list for affinity
-    # with the variables specified in lims
-    aargs <- list()
-    for(j in 1:length(lims)) {
-      if(names(lims)[j] %in% rownames(basis)) {
-        ibasis <- match(names(lims)[j],rownames(basis))
-        message(paste("###",rownames(basis)[ibasis],""), appendLF=FALSE)
-        # the starting search limits for this species
-        lim <- lims[[j]]
-        # center the search interval on the current values
-        curr <- basis$logact[ibasis]
-        # update the argument list with the intervals
-        myarg <- list(c(limfun(lim,curr,i),res))
-        names(myarg) <- rownames(basis)[ibasis]
-        aargs <- c(aargs,myarg)
-      } else if(names(lims[j]) %in% c("T","P")) {
-        message(paste("###",names(lims[j]),""), appendLF=FALSE)
-        if(names(lims[j])=="T") {
-          lim <- lims$T
-          curr <- T
-        } else {
-          lim <- lims$P
-          curr <- P
-        }
-        myarg <- list(c(limfun(lim,curr,i),res))
-        names(myarg) <- names(lims[j])
-        aargs <- c(aargs,myarg)
-      } else warning(paste("findit: ignoring",names(lims[j]),"which is not a basis species, T or P"))
-    }
-    # we include single values of T and P in the arguments
-    # if their limits weren't given
-    if(!"T" %in% names(lims)) aargs <- c(aargs,list(T=T))
-    if(!"P" %in% names(lims)) aargs <- c(aargs,list(P=P))
-    # include iprotein if given
-    if(!is.null(iprotein)) {
-      aargs <- c(aargs,list(iprotein=iprotein))
-    }
-
-    # now calculate the affinities
-    a <- do.call(affinity,aargs)
-    # then calculate the values of the objective function
-    e <- equilibrate(a, balance=balance, loga.balance=loga.balance, normalize=normalize)
-    dd <- revisit(e, objective, loga2=loga2, plot.it=FALSE)$H
-    # coordinates of the extreme value (take only the first set of coords)
-    iopt <- optimal.index(dd, objective)[1,, drop=FALSE]
-    # the extreme value
-    teststat <- c(teststat,dd[iopt])
-
-    # loop to update the current parameters
-    for(j in 1:length(lims)) {
-      # the current limits for this variable
-      # we ignore T and P if they are not variable:
-      mylims <- aargs[[j]]
-      # the increments used
-      myinc <- seq(mylims[1],mylims[2],length.out=mylims[3])
-      # the value of the variable at the extreme of the function
-      myval <- myinc[iopt[j]]
-      # update the basis table, T or P
-      if(names(lims)[j] %in% rownames(basis)) {
-        ibasis <- match(names(lims)[j],rownames(basis))
-        basis$logact[ibasis] <- myval
-        basis(rownames(basis)[ibasis],myval)
-      } else if(names(lims)[j]=="T") {
-        T <- myval
-      } else if(names(lims)[j]=="P") {
-        P <- myval
-      }
-      # update the output list
-      out[[j]] <- c(out[[j]],myval)
-      lolim[[j]] <- c(lolim[[j]],mylims[1])
-      hilim[[j]] <- c(hilim[[j]],mylims[2])
-      outlims[[j]] <- mylims
-    }
-
-    # are we making a plot?
-    if(plot.it) {
-      # add our search lines and extreme points
-      # to the plot
-      if(nd==1) {
-        if(i==1) revisit(e,objective,loga2,xlim=lims[[1]])
-        # on a 1-D diagram we add vertical lines to show our search limits
-        abline(v=outlims[[1]][1:2])
-        lines(myinc,dd)
-        points(myval,dd[iopt])
-      } else if(nd==2) {
-        if(i==1) revisit(e,objective,loga2,xlim=lims[[1]],ylim=lims[[2]],labcex=labcex)
-        else {
-          # on a 2-D diagram we add a box around our search limits
-          # and an updated map for this region
-          ol1 <- outlims[[1]]
-          ol2 <- outlims[[2]]
-          rect(ol1[1],ol2[1],ol1[2],ol2[2],border=par("fg"),col="white")
-          revisit(e,objective,loga2,xlim=lims[[1]],ylim=lims[[2]],add=TRUE,labcex=labcex)
-        }
-        text(out[[1]],out[[2]])
-        points(out[[1]],out[[2]],cex=2)
-      } else {
-        if(i==1) add <- FALSE else add <- TRUE
-        # we only draw a 2-D diagram even if we're optimizing
-        # for more than two variables
-        # paint an empty box over the search area
-        if(i > 1) {
-          ol1 <- outlims[[1]]
-          ol2 <- outlims[[2]]
-          rect(ol1[1],ol2[1],ol1[2],ol2[2],border=par("fg"),col="white")
-        }
-        # we have to extract slices for dimensions greater than two
-        # we extract the third dimension until only two remain
-        for(j in 3:nd) {
-          # ai[j] - which slice in this dimension has the extremum
-          for(k in 1:length(e$loga.equil)) e$loga.equil[[k]] <- slice(e$loga.equil[[k]],3,iopt[j])
-        }
-        # now make the plot
-        revisit(e,objective,loga2,xlim=lims[[1]],ylim=lims[[2]],add=add,labcex=labcex)
-        # indicate the location of the extremum
-        text(out[[1]],out[[2]])
-        points(out[[1]],out[[2]],cex=2)
-      }
-      # are we making a legend?
-      # it looks something like
-      #  n     qqr     O2     H2O   CO2   NH3
-      #  1   0.993 -85.21  -6.378 2.032 -6.93
-      # ...
-      # 12   0.997 -85.26  -6.488 3.111 -6.50
-    }
-  }  # end main loop
-  # build return list: values of chemical variables and test statistic
-  teststat <- list(teststat)
-  names(teststat) <- objective
-  value <- c(out,teststat)
-  # build return list: limits at each step
-  out <- list(value=value,lolim=lolim,hilim=hilim)
-  class(out) <- "findit"
-  return(out)
-}
-
-# to plot results from findit()
-plot_findit <- function(x,which=NULL,mar=c(3.5,5,2,2),xlab="iteration",...) {
-  # show the values of the test statistic and of the
-  # chemical variables at each iteration
-  l <- length(x$value)
-  if(is.null(which)) which <- 1:l
-  l <- length(which)
-  opar <- par(mfrow=c(l,1),mar=mar) 
-  for(i in which) {
-    niter <- length(x$value[[i]])
-    ylab <- names(x$value)[i]
-    if(ylab %in% c(rownames(get("thermo", CHNOSZ)$basis),"T","P","pH","Eh")) ylab <- axis.label(ylab)
-    # the values
-    plot(1:niter,x$value[[i]],xlab=xlab,ylab=ylab,...)
-    lines(1:niter,x$value[[i]])
-    # the search intervals
-    # (not available for the test statistic)
-    if(i!=length(x$value)) {
-      lines(1:niter,x$lolim[[i]],lty=2)
-      lines(1:niter,x$hilim[[i]],lty=2)
-    }
-  }
-  par(opar)
-}
-

Modified: pkg/CHNOSZ/demo/00Index
===================================================================
--- pkg/CHNOSZ/demo/00Index	2022-11-27 11:43:35 UTC (rev 756)
+++ pkg/CHNOSZ/demo/00Index	2022-12-01 05:43:36 UTC (rev 757)
@@ -4,7 +4,6 @@
 NaCl            Equilibrium constant for aqueous NaCl dissociation
 density         Density of H2O, inverted from IAPWS-95 equations
 ORP             Temperature dependence of oxidation-reduction potential for redox standards
-findit          Minimize the standard deviation of logarithms of activities of sulfur species
 ionize          ionize.aa(): contour plots of net charge and ionization properties of LYSC_CHICK
 buffer          Minerals and aqueous species as buffers of hydrogen fugacity
 protbuff        Chemical activities buffered by thiol peroxidases or sigma factors

Deleted: pkg/CHNOSZ/demo/findit.R
===================================================================
--- pkg/CHNOSZ/demo/findit.R	2022-11-27 11:43:35 UTC (rev 756)
+++ pkg/CHNOSZ/demo/findit.R	2022-12-01 05:43:36 UTC (rev 757)
@@ -1,28 +0,0 @@
-## findit() calculations for sulfur species
-library(CHNOSZ)
-
-basis("CHNOS+")
-basis("pH", 5)
-species(c("H2S", "S2-2", "S3-2", "S2O3-2", "S2O4-2", "S3O6-2",
-  "S5O6-2", "S2O6-2", "HSO3-", "SO2", "HSO4-"))
-# to minimize the standard deviations of the 
-# logarithms of activity the species
-objective <- "SD"
-# the variables we are interested in
-vars <- list(O2=c(-50, -15), pH=c(0, 14), T=c(275, 375))
-# optimize logfO2 at constant T and pH
-f1 <- findit(vars[1], objective, T=325, P=350, niter=3)
-title("S.D. of equilibrium log activities of sulfur species")
-# optimize logfO2 and pH at constant T
-f2 <- findit(vars[1:2], objective, T=325, P=350, res=16, niter=5)
-title("S.D. of equilibrium log activities of sulfur species")
-# optimize logfO2, pH and T (at constant P ...)
-f3 <- findit(vars, objective, P=350, res=10, niter=5, rat=0.5)
-title("S.D. of equilibrium log activities of sulfur species")
-# the results
-print(f1.out <- sapply(f1$value, tail, 1))
-print(f2.out <- sapply(f2$value, tail, 1))
-print(f3.out <- sapply(f3$value, tail, 1))
-# with more variables, we should find a greater degree of optimization
-stopifnot(f2.out["SD"] < f1.out["SD"])
-stopifnot(f3.out["SD"] < f2.out["SD"])

Modified: pkg/CHNOSZ/inst/NEWS.Rd
===================================================================
--- pkg/CHNOSZ/inst/NEWS.Rd	2022-11-27 11:43:35 UTC (rev 756)
+++ pkg/CHNOSZ/inst/NEWS.Rd	2022-12-01 05:43:36 UTC (rev 757)
@@ -12,7 +12,7 @@
 % links to vignettes 20220723
 \newcommand{\viglink}{\ifelse{html}{\out{<a href="../CHNOSZ/doc/#1.html"><strong>#1.Rmd</strong></a>}}{\bold{#1.Rmd}}}
 
-\section{Changes in CHNOSZ version 1.9.9-48 (2022-11-27)}{
+\section{Changes in CHNOSZ version 1.9.9-49 (2022-12-01)}{
 
   \subsection{MAJOR USER-VISIBLE CHANGES}{
     \itemize{
@@ -141,6 +141,9 @@
       \item Remove parallel calculations in \code{read.fasta()} and
       \code{count.aa()} (they just made things slower in my tests).
 
+      \item Remove \code{findit()} (functions for \dQuote{computations on
+        chemical activities} in the extended workflow).
+
     }
   }
 

Deleted: pkg/CHNOSZ/inst/tinytest/test-findit.R
===================================================================
--- pkg/CHNOSZ/inst/tinytest/test-findit.R	2022-11-27 11:43:35 UTC (rev 756)
+++ pkg/CHNOSZ/inst/tinytest/test-findit.R	2022-12-01 05:43:36 UTC (rev 757)
@@ -1,40 +0,0 @@
-# This is a long test ... only run it "at home" 20220130
-if(!at_home()) exit_file("Skipping long test")
-
-# Load default settings for CHNOSZ
-reset()
-
-info <- "findit() returns known values encoded in a species distribution"
-# test the findit function in three dimensions
-# first calculate equilibrium activities of some proteins
-# using known activities of basis species
-ip <- 1:20
-basis("CHNOS")
-basis("CO2", -pi)        # -3.141593
-basis("H2O", -exp(1))    # -2.718282
-basis("NH3", -sqrt(2))   # -1.414214
-a <- affinity(iprotein = ip)
-# scale relative abundances such that total activity of residues 
-# is unity (since loga.balance = 0 is default for findit)
-e <- equilibrate(a, loga.balance = 0)
-# loga2 are the equilibrium logarithms of activities of the proteins
-loga2 <- as.numeric(e$loga.equil)
-# return to default values for activities of basis species
-basis("CHNOS")
-## we have diverged from the reference activities of proteins
-#a <- affinity(iprotein = ip)
-#d <- diagram(a, plot.it = FALSE, loga.balance = 0)
-#r0 <- revisit(d, "rmsd", loga.ref, main = "")
-#title(main = paste("log activities of 20 proteins for basis activities",
-#  "from numerical constants (ref) and CHNOSZ default (calc)",sep = "\n"))
-# now find the activities of the basis species
-# that get us close to reference activities of proteins
-f <- findit(lims = list(CO2 = c(-5,0), H2O = c(-5,0), NH3 = c(-5,0)),
-  objective = "RMSD", niter = 2, iprotein = ip, loga2 = loga2, res = 24, rat = 0.2, plot.it = FALSE)
-# sanity check: the output values are all the same length
-expect_equal(length(unique(sapply(f$value, length))), 1, info = info)
-# -pi, -e and -sqrt(2) were approximately retrieved!
-expect_equal(tail(f$value[[1]],1), -pi, tolerance = 1e-2, info = info)
-expect_equal(tail(f$value[[2]],1), -exp(1), tolerance = 1e-2, info = info)
-expect_equal(tail(f$value[[3]],1), -sqrt(2), tolerance = 1e-1, info = info)
-# we could decrease the tolerance by increasing the resolution and/or iterations in findit()

Modified: pkg/CHNOSZ/man/CHNOSZ-package.Rd
===================================================================
--- pkg/CHNOSZ/man/CHNOSZ-package.Rd	2022-11-27 11:43:35 UTC (rev 756)
+++ pkg/CHNOSZ/man/CHNOSZ-package.Rd	2022-12-01 05:43:36 UTC (rev 757)
@@ -20,7 +20,7 @@
 Each help page (other than this one) has been given one of the following \dQuote{concept index entries}:
 \itemize{
   \item Main workflow: \code{\link{info}}, \code{\link{subcrt}}, \code{\link{basis}}, \code{\link{species}}, \code{\link{affinity}}, \code{\link{equilibrate}}, \code{\link{diagram}}
-  \item Extended workflow: \code{\link{swap.basis}}, \code{\link{buffer}}, \code{\link{mosaic}}, \code{\link{objective}}, \code{\link{revisit}}, \code{\link{findit}}
+  \item Extended workflow: \code{\link{swap.basis}}, \code{\link{buffer}}, \code{\link{mosaic}}, \code{\link{objective}}, \code{\link{revisit}}
   \item Thermodynamic data: \code{\link{data}}, \code{\link{extdata}}, \code{\link{add.OBIGT}}, \code{\link{util.data}}
   \item Thermodynamic calculations: \code{\link{util.formula}}, \code{\link{makeup}}, \code{\link{util.units}}, \code{\link{Berman}}, \code{\link{nonideal}}, \code{\link{util.misc}}
   \item Water properties: \code{\link{water}}, \code{\link{util.water}}, \code{\link{DEW}}, \code{\link{IAPWS95}}

Modified: pkg/CHNOSZ/man/examples.Rd
===================================================================
--- pkg/CHNOSZ/man/examples.Rd	2022-11-27 11:43:35 UTC (rev 756)
+++ pkg/CHNOSZ/man/examples.Rd	2022-12-01 05:43:36 UTC (rev 757)
@@ -14,7 +14,7 @@
 \usage{
   examples(save.png = FALSE)
   demos(which = c("sources", "protein.equil", "affinity", "NaCl",
-    "density", "ORP", "findit", "ionize", "buffer", "protbuff",
+    "density", "ORP", "ionize", "buffer", "protbuff",
     "glycinate", "mosaic", "copper", "arsenic", "solubility", "gold",
     "contour", "sphalerite", "minsol", "Shh", "saturation",
     "DEW", "lambda", "potassium", "TCA", "aluminum", "AD",
@@ -37,7 +37,6 @@
     \item{NaCl}{Equilibrium constant for aqueous NaCl dissociation (Shock et al., 1992)}
     \item{density}{Density of \H2O, inverted from IAPWS-95 equations (\code{\link{rho.IAPWS95}})}
     \item{ORP}{Temperature dependence of oxidation-reduction potential for redox standards}
-    \item{findit}{Minimize the standard deviation of logarithms of activities of sulfur species}
     \item{ionize}{ionize.aa(): contour plots of net charge and ionization properties of LYSC_CHICK}
     \item{buffer}{Minerals and aqueous species as buffers of hydrogen fugacity (Schulte and Shock, 1995)}
     \item{protbuff}{Chemical activities buffered by thiol peroxidases or sigma factors}

Deleted: pkg/CHNOSZ/man/findit.Rd
===================================================================
--- pkg/CHNOSZ/man/findit.Rd	2022-11-27 11:43:35 UTC (rev 756)
+++ pkg/CHNOSZ/man/findit.Rd	2022-12-01 05:43:36 UTC (rev 757)
@@ -1,79 +0,0 @@
-\encoding{UTF-8}
-\name{findit}
-\alias{findit}
-\alias{plot_findit}
-\title{Gridded Search to Optimize Objective Functions}
-\description{
-  Use a gridded search to find a combination of one or more of chemical activities of basis species, temperature and/or pressure that maximize or minimize a objective function of the metastable equilibrium chemical activities of the species of interest.
-}
-
-\usage{
-  findit (lims = list(), objective = "CV", niter = NULL, iprotein = NULL, 
-    plot.it = TRUE, T = 25, P = "Psat", res = NULL, labcex = 0.6, 
-    loga2 = NULL, loga.balance = 0, rat = NULL,
-    balance = NULL, normalize = FALSE)
-  plot_findit(x, which=NULL, mar=c(3.5,5,2,2), xlab="iteration", \dots)
-}
-
-\arguments{
-  \item{lims}{list, specification of search limits}
-  \item{objective}{character, name of objective function to optimize}
-  \item{niter}{numeric, number of iterations}
-  \item{res}{numeric, grid resolution (number of points on one edge)}
-  \item{iprotein}{numeric, indices of proteins}
-  \item{plot.it}{logical, make a plot?}
-  \item{T}{numeric, temperature}
-  \item{P}{numeric, pressure; or character, "Psat"}
-  \item{labcex}{numeric, character expansion for plot labels}
-  \item{loga2}{numeric, reference logarithms of activity of species}
-  \item{loga.balance}{numeric, logarithm of total activity of balanced quantity (passed to \code{\link{diagram}})}
-  \item{rat}{numeric, ratio of edge length in successive iterations}
-  \item{balance}{character or numeric, balanced quantity (passed to \code{\link{diagram}})}
-  \item{normalize}{logical, normalize chemical formulas by the balance vector? (passed to \code{\link{diagram}})}
-  \item{x}{list, object of class \code{findit}}
-  \item{which}{numeric, which of the parameters to plot}
-  \item{mar}{numeric, plot margin specification}
-  \item{xlab}{character, x-axis label}
-  \item{\dots}{additional arguments passed to \code{plot}}
-}
-
-\details{
-\code{findit} implements a gridded optimization to find the minimum or maximum value of an \code{\link{objective}} function.
-The variables are one or more of the chemical activities, temperature and/or pressure whose ranges are listed in \code{lims}.
-Generally, the system (\code{\link{basis}} species and \code{\link{species}} of interest) must be set up before calling this function.
-If \code{iprotein} is supplied, indicating a set of proteins to use in the calculation, the definition of the \code{species} is not required. 
-\code{lims} is a list, each element of which is vector having a name that is the formula of one of the basis species, \samp{T} or \samp{P} and a pair of values indicating the range of the named parameter.
-The values are the logarithms of activities of the basis species, or temperature or pressure (in the user's units; see \code{\link{util.units}}).
-If either \samp{T} or \samp{P} is missing from the list in \code{lims}, the calculations are performed at isothermal and/or isobaric conditions indicated by \code{T} and \code{P} arguments.
-
-Taking \eqn{nd} as the number of dimensions (number of variables in \code{lims}), default values of \code{niter} and \code{res} come from the following table.
-These settings have been selected to be able to run the function quickly in the higher dimensions.
-Detailed studies of a system might have to use more iterations and/or higher resolutions.
-
-\tabular{rrrrr}{
-  \code{nd} \tab \code{niter} \tab \code{res} \tab grid points (\code{res^nd}) \tab \code{rat} \cr
-  1 \tab 4 \tab 128 \tab 128 \tab 0.7 \cr
-  2 \tab 6 \tab 64 \tab 4096 \tab 0.7 \cr
-  3 \tab 6 \tab 16 \tab 4096 \tab 0.8 \cr
-  4 \tab 8 \tab 8 \tab  4096 \tab 0.9 \cr
-  5 \tab 12 \tab 6 \tab 7776 \tab 0.9 \cr
-  6 \tab 12 \tab 4 \tab 4096 \tab 0.95 \cr
-  7 \tab 12 \tab 4 \tab 16384 \tab 0.95 \cr
-}
-
-The function performs \code{niter} iterations.
-At first, the limits of the parameters given in \code{lims} define the extent of a \eqn{nd}-dimensional box around the space of interest.
-The value of \code{objective} is calculated at each of the \eqn{res^{nd}}{res^nd} grid points and and optimum value located (see \code{\link{revisit}}).
-In the next iteration the new search box is centered on the location of the optimum value, and the edges are shrunk so their length is \code{rat} * the length in the previous step.
-If the limits of any of the parameters extend beyond those in \code{lims}, they are pushed in to fit (preserving the difference between them).
-
-\code{plot_findit} plots the values of the parameters and the objective function as a function of the number of iterations.
-}
-
-\value{
-\code{findit} returns a list having class \code{findit} with elements \code{value} (values of the parameters, and value of the objective function, at each iteration), \code{lolim} (lower limits of the parameters) and \code{hilim} (upper limits of the parameters).
-}
-
-\seealso{ \code{demo("findit")} and \code{test-findit.R} for examples. }
-
-\concept{Extended workflow}

Modified: pkg/CHNOSZ/man/objective.Rd
===================================================================
--- pkg/CHNOSZ/man/objective.Rd	2022-11-27 11:43:35 UTC (rev 756)
+++ pkg/CHNOSZ/man/objective.Rd	2022-12-01 05:43:36 UTC (rev 757)
@@ -17,7 +17,7 @@
 \title{Objective Functions}
 \description{
 Calculate statistical and thermodynamic quantities for activities of species.
-These functions can be specified as objectives in \code{\link{revisit}} and \code{\link{findit}} in order to identify optimal chemical conditions.
+These functions can be specified as objectives in \code{\link{revisit}} in order to identify optimal chemical conditions.
 }
 
 \usage{
@@ -74,7 +74,7 @@
 Each objective function has an attribute (see \code{\link{attributes}} and \code{\link{structure}}) named \samp{optimum} that takes the value of \samp{minimal} (\code{SD}, \code{CV}, \code{RMSD}, \code{CVRMSD}, \code{DGmix}, \code{DDGmix}, \code{DGtr}) or \samp{maximal} (\code{logact}, \code{shannon}, \code{qqr}, \code{spearman}, \code{pearson}).
 }
 
-\seealso{ \code{\link{revisit}}, \code{\link{findit}} }
+\seealso{ \code{\link{revisit}}}
 
 \examples{
 \dontshow{reset()}

Modified: pkg/CHNOSZ/man/revisit.Rd
===================================================================
--- pkg/CHNOSZ/man/revisit.Rd	2022-11-27 11:43:35 UTC (rev 756)
+++ pkg/CHNOSZ/man/revisit.Rd	2022-12-01 05:43:36 UTC (rev 757)
@@ -83,7 +83,6 @@
 
 \seealso{
 \code{demo("revisit")} shows calculations for a system of proteins.
-\code{\link{findit}} is a related function implementing a gridded search of chemical activities, temperature and/or pressure that optimize the objective function.
 }
 
 \examples{\dontshow{reset()}

Modified: pkg/CHNOSZ/vignettes/mklinks.sh
===================================================================
--- pkg/CHNOSZ/vignettes/mklinks.sh	2022-11-27 11:43:35 UTC (rev 756)
+++ pkg/CHNOSZ/vignettes/mklinks.sh	2022-12-01 05:43:36 UTC (rev 757)
@@ -62,7 +62,6 @@
 sed -i '120,$s/<code>uniprot.aa()<\/code>/<code><a href="..\/html\/util.fasta.html" style="background-image:none;">uniprot.aa()<\/a><\/code>/g' anintro.html
 sed -i '120,$s/<code>add.protein()<\/code>/<code><a href="..\/html\/add.protein.html" style="background-image:none;">add.protein()<\/a><\/code>/g' anintro.html
 sed -i '120,$s/<code>aminoacids()<\/code>/<code><a href="..\/html\/util.seq.html" style="background-image:none;">aminoacids()<\/a><\/code>/g' anintro.html
-sed -i '120,$s/<code>findit()<\/code>/<code><a href="..\/html\/findit.html" style="background-image:none;">findit()<\/a><\/code>/g' anintro.html
 sed -i '120,$s/<code>add.OBIGT()<\/code>/<code><a href="..\/html\/add.OBIGT.html" style="background-image:none;">add.OBIGT()<\/a><\/code>/g' anintro.html
 sed -i '120,$s/<code>mod.OBIGT()<\/code>/<code><a href="..\/html\/add.OBIGT.html" style="background-image:none;">mod.OBIGT()<\/a><\/code>/g' anintro.html
 sed -i '120,$s/<code>checkGHS()<\/code>/<code><a href="..\/html\/util.data.html" style="background-image:none;">checkGHS()<\/a><\/code>/g' anintro.html



More information about the CHNOSZ-commits mailing list