[CHNOSZ-commits] r908 - in pkg/CHNOSZ: . R demo inst/extdata/misc inst/extdata/protein inst/extdata/protein/Cas man vignettes
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue May 27 03:45:53 CEST 2025
Author: jedick
Date: 2025-05-27 03:45:53 +0200 (Tue, 27 May 2025)
New Revision: 908
Added:
pkg/CHNOSZ/inst/extdata/protein/rubisco.csv
pkg/CHNOSZ/inst/extdata/protein/rubisco_aa.csv
Removed:
pkg/CHNOSZ/inst/extdata/misc/rubisco.csv
Modified:
pkg/CHNOSZ/DESCRIPTION
pkg/CHNOSZ/R/diagram.R
pkg/CHNOSZ/R/examples.R
pkg/CHNOSZ/demo/AD.R
pkg/CHNOSZ/demo/DEW.R
pkg/CHNOSZ/demo/MgATP.R
pkg/CHNOSZ/demo/NaCl.R
pkg/CHNOSZ/demo/ORP.R
pkg/CHNOSZ/demo/Pourbaix.R
pkg/CHNOSZ/demo/Shh.R
pkg/CHNOSZ/demo/TCA.R
pkg/CHNOSZ/demo/adenine.R
pkg/CHNOSZ/demo/affinity.R
pkg/CHNOSZ/demo/aluminum.R
pkg/CHNOSZ/demo/arsenic.R
pkg/CHNOSZ/demo/buffer.R
pkg/CHNOSZ/demo/comproportionation.R
pkg/CHNOSZ/demo/copper.R
pkg/CHNOSZ/demo/dehydration.R
pkg/CHNOSZ/demo/density.R
pkg/CHNOSZ/demo/glycinate.R
pkg/CHNOSZ/demo/gold.R
pkg/CHNOSZ/demo/ionize.R
pkg/CHNOSZ/demo/lambda.R
pkg/CHNOSZ/demo/minsol.R
pkg/CHNOSZ/demo/potassium.R
pkg/CHNOSZ/demo/protbuff.R
pkg/CHNOSZ/demo/rank.affinity.R
pkg/CHNOSZ/demo/references.R
pkg/CHNOSZ/demo/rubisco_Zc.R
pkg/CHNOSZ/demo/saturation.R
pkg/CHNOSZ/demo/solubility.R
pkg/CHNOSZ/demo/sphalerite.R
pkg/CHNOSZ/demo/uranyl.R
pkg/CHNOSZ/inst/extdata/protein/Cas/mkaa.R
pkg/CHNOSZ/man/examples.Rd
pkg/CHNOSZ/man/extdata.Rd
pkg/CHNOSZ/man/rank.affinity.Rd
pkg/CHNOSZ/vignettes/OBIGT.bib
pkg/CHNOSZ/vignettes/anintro.Rmd
pkg/CHNOSZ/vignettes/vig.bib
Log:
Cleanups for demos
Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/DESCRIPTION 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,6 +1,6 @@
Date: 2025-05-27
Package: CHNOSZ
-Version: 2.1.0-79
+Version: 2.1.0-80
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/R/diagram.R
===================================================================
--- pkg/CHNOSZ/R/diagram.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/R/diagram.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -127,7 +127,7 @@
plotvar <- eout$property
if(efun == "rank.affinity") {
plotvar <- "rank.affinity"
- message(paste("diagram: plotting average affinity ranking for", length(plotvals), "groups"))
+ message(paste("diagram: plotting average rank of affinity for", length(plotvals), "groups"))
} else if(plotvar == "A") {
# We change 'A' to 'A/(2.303RT)' so the axis label is made correctly
# 20171027 use parentheses to avoid ambiguity about order of operations
@@ -367,7 +367,7 @@
if(missing(xlab)) xlab <- axis.label(getlabel(1), basis = eout$basis, molality = molality)
if(missing(ylab)) {
ylab <- axis.label(plotvar, units = "", molality = molality)
- if(plotvar == "rank.affinity") ylab <- "Average affinity ranking"
+ if(plotvar == "rank.affinity") ylab <- "Average rank of affinity"
# Use ppb, ppm, ppt (or log ppb etc.) for converted values of solubility 20190526
if(grepl("solubility.", eout$fun, fixed = TRUE)) {
ylab <- strsplit(eout$fun, ".", fixed = TRUE)[[1]][2]
Modified: pkg/CHNOSZ/R/examples.R
===================================================================
--- pkg/CHNOSZ/R/examples.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/R/examples.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -30,7 +30,7 @@
cat("Time elapsed: ", proc.time() - .ptime, "\n")
}
-demos <- function(which = c("references", "affinity", "NaCl", "density",
+demos <- function(which = c("references", "dehydration", "affinity", "NaCl", "density",
"ORP", "ionize", "buffer", "protbuff", "glycinate",
"mosaic", "copper", "arsenic", "solubility", "gold", "contour", "sphalerite", "minsol",
"Shh", "saturation", "adenine", "DEW", "lambda", "potassium", "TCA", "aluminum",
@@ -42,18 +42,13 @@
for(i in 1:length(which)) {
# A message so the user knows where we are
message("------------")
- if(which[i] == "dehydration" & !save.png) {
- message("demos: skipping dehydration demo as save.png is FALSE")
- next
- } else message(paste("demos: running '", which[i], "'", sep = ""))
- if(save.png & !which[i] == "dehydration") {
- width <- 500
- height <- 500
- if(which[i] == "comproportionation") width <- 600
- png(paste(which[i], "%d.png", sep = ""), width = width, height = height, pointsize = 12)
- }
+ message(paste("demos: running '", which[i], "'", sep = ""))
+ width <- 500
+ height <- 500
+ if(which[i] == "comproportionation") width <- 600
+ if(save.png) png(paste(which[i], "%d.png", sep = ""), width = width, height = height, pointsize = 12)
out <- demo(which[i], package = "CHNOSZ", character.only = TRUE, echo = FALSE, ask = FALSE)
- if(save.png & !which[i] == "dehydration") dev.off()
+ if(save.png) dev.off()
}
return(invisible(out))
}
Modified: pkg/CHNOSZ/demo/AD.R
===================================================================
--- pkg/CHNOSZ/demo/AD.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/AD.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,6 +1,7 @@
# CHNOSZ/demo/AD.R
# Calculate Henry's constant using the Akinfiev-Diamond model 20190220
# Add volume and heat capacity 20220207
+
library(CHNOSZ)
# Start with default settings
Modified: pkg/CHNOSZ/demo/DEW.R
===================================================================
--- pkg/CHNOSZ/demo/DEW.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/DEW.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,5 +1,6 @@
# CHNOSZ/demo/DEW.R
# Demo for the Deep Earth Water (DEW) model in CHNOSZ 20170927
+
library(CHNOSZ)
# Set up subplots
Modified: pkg/CHNOSZ/demo/MgATP.R
===================================================================
--- pkg/CHNOSZ/demo/MgATP.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/MgATP.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -2,6 +2,8 @@
# Speciation of ATP with H+ and Mg+2
# 20250423 Moved from anintro.Rmd
+library(CHNOSZ)
+
# Speciation plots, similar to Figures 1.2-1.5 in Alberty (2003).
# These figures show the distribution of differently charged species of
# adenosine triphosphate (ATP) as a function of pH,
Modified: pkg/CHNOSZ/demo/NaCl.R
===================================================================
--- pkg/CHNOSZ/demo/NaCl.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/NaCl.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,10 +1,12 @@
# CHNOSZ/demo/NaCl.R
-## NaCl dissocation logK f(T,P)
-## after Shock et al., 1992, Fig. 1
-## (Shock, E. L., Oelkers, E. H., Johnson, J. W., Sverjensky, D. A. and Helgeson, H. C. (1992)
-## Calculation of the thermodynamic properties of aqueous species at high pressures and temperatures:
-## Effective electrostatic radii, dissociation constants and standard partial molal properties to 1000 degrees C and 5 kbar.
-## J. Chem. Soc. Faraday Trans. 88, 803-826. https://doi.org/10.1039/FT9928800803 )
+# NaCl dissocation logK f(T,P)
+# after Shock et al., 1992, Fig. 1
+# Shock, E. L., Oelkers, E. H., Johnson, J. W., Sverjensky, D. A. and Helgeson, H. C. (1992)
+# Calculation of the thermodynamic properties of aqueous species at high pressures and temperatures:
+# Effective electrostatic radii, dissociation constants and standard partial molal properties to 1000 degrees C and 5 kbar.
+# J. Chem. Soc. Faraday Trans. 88, 803-826. https://doi.org/10.1039/FT9928800803
+# 20121111 first version
+
library(CHNOSZ)
## Uncomment these lines to make the plot with the g-function disabled
Modified: pkg/CHNOSZ/demo/ORP.R
===================================================================
--- pkg/CHNOSZ/demo/ORP.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/ORP.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,5 +1,6 @@
# CHNOSZ/demo/ORP.R
# First version 20100715 jmd
+
library(CHNOSZ)
# Calculate the temperature dependence of
Modified: pkg/CHNOSZ/demo/Pourbaix.R
===================================================================
--- pkg/CHNOSZ/demo/Pourbaix.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/Pourbaix.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -4,6 +4,7 @@
# 20210301 jmd first version
library(CHNOSZ)
+
# Load OBIGT database without organic species
# (speeds up and reduces memory needed for C diagram)
OBIGT(no.organics = TRUE)
Modified: pkg/CHNOSZ/demo/Shh.R
===================================================================
--- pkg/CHNOSZ/demo/Shh.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/Shh.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,6 +1,7 @@
# CHNOSZ/demo/Shh.R
# Compare affinities of Sonic hedgehog and transcription factors involved in dorsal-ventral patterning
# (Dick, 2015. Chemical integration of proteins in signaling and development. https://doi.org/10.1101/015826)
+
library(CHNOSZ)
# To reproduce the calculations in the paper, use superseded data for [Gly] and [UPBB] 20190206
Modified: pkg/CHNOSZ/demo/TCA.R
===================================================================
--- pkg/CHNOSZ/demo/TCA.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/TCA.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -2,6 +2,7 @@
# Reproduce Fig. 6 in Canovas and Shock, 2016:
# Plots of the standard partial molal Gibbs energy of reaction for each step in
# the citric acid cycle for temperatures to 500 degrees C and pressures to 5 kbar.
+
library(CHNOSZ)
# These plots use calories 20220325
Modified: pkg/CHNOSZ/demo/adenine.R
===================================================================
--- pkg/CHNOSZ/demo/adenine.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/adenine.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,5 +1,6 @@
# CHNOSZ/demo/adenine.R
# Plot thermodynamic data and model fits for aqueous adenine 20170725
+
library(CHNOSZ)
# Notable functions in this demo:
Modified: pkg/CHNOSZ/demo/affinity.R
===================================================================
--- pkg/CHNOSZ/demo/affinity.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/affinity.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,8 +1,10 @@
# CHNOSZ/demo/affinity.R
-## Affinities of metabolic reactions
-## After Amend and Shock, 2001, Fig. 7
-## Amend, J. P. and Shock, E. L. (2001) Energetics of overall metabolic reactions of thermophilic and hyperthermophilic Archaea and Bacteria.
-## FEMS Microbiol. Rev. 25, 175--243. https://doi.org/10.1016/S0168-6445(00)00062-0
+# Affinities of metabolic reactions
+# After Amend and Shock, 2001, Fig. 7
+# Amend, J. P. and Shock, E. L. (2001) Energetics of overall metabolic reactions of thermophilic and hyperthermophilic Archaea and Bacteria.
+# FEMS Microbiol. Rev. 25, 175--243. https://doi.org/10.1016/S0168-6445(00)00062-0
+# 20170504 first version
+
library(CHNOSZ)
# Use aq state for all basis species (including O2)
Modified: pkg/CHNOSZ/demo/aluminum.R
===================================================================
--- pkg/CHNOSZ/demo/aluminum.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/aluminum.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,6 +1,7 @@
# CHNOSZ/demo/aluminum.R
# 20171018 comparisons with calculations of SUPCRTBL
# 20190415 add diagrams from Tutolo et al., 2014
+
library(CHNOSZ)
## Set up plotting area
Modified: pkg/CHNOSZ/demo/arsenic.R
===================================================================
--- pkg/CHNOSZ/demo/arsenic.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/arsenic.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -2,6 +2,7 @@
# Eh-pH diagram for the system As-O-H-S,
# After Lu and Zhu, 2011 (doi:10.1007/s12665-010-0652-x)
# 20190415 extracted from go-IU.R; use retrieve()
+
library(CHNOSZ)
# Define temperature (degrees C), pressure (bar), grid resolution
Modified: pkg/CHNOSZ/demo/buffer.R
===================================================================
--- pkg/CHNOSZ/demo/buffer.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/buffer.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,6 +1,7 @@
# CHNOSZ/demo/buffer.R
# Calculate buffered activities of basis species using two methods
-# Ater Figure 6 of Schulte and Shock, 1995 (doi:10.1007/BF01581580)
+# After Figure 6 of Schulte and Shock, 1995 (doi:10.1007/BF01581580)
+
library(CHNOSZ)
# Use Helgeson et al. (1978) minerals for closer reproduction 20201110
Modified: pkg/CHNOSZ/demo/comproportionation.R
===================================================================
--- pkg/CHNOSZ/demo/comproportionation.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/comproportionation.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -2,6 +2,7 @@
# Gibbs energy of sulfur comproportionation,
# after Fig. 1 of Amend et al., 2020 (doi:10.1111/1462-2920.14982)
# 20191112 jmd first version
+
library(CHNOSZ)
# Set basis species and activities
Modified: pkg/CHNOSZ/demo/copper.R
===================================================================
--- pkg/CHNOSZ/demo/copper.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/copper.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,8 +1,9 @@
# CHNOSZ/demo/copper.R
-## Eh-pH diagrams for copper-water-glycine
-## After Fig. 2 of Aksu and Doyle, 2001
-## (Aksu, S. and Doyle, F. M., 2001. Electrochemistry of copper in aqueous glycine
-## solutions. J. Electrochem. Soc., 148, B51-B57. doi:10.1149/1.1344532)
+# Eh-pH diagrams for copper-water-glycine
+# After Fig. 2 of Aksu and Doyle, 2001
+# (Aksu, S. and Doyle, F. M., 2001. Electrochemistry of copper in aqueous glycine
+# solutions. J. Electrochem. Soc., 148, B51-B57. doi:10.1149/1.1344532)
+
library(CHNOSZ)
# We need data for Cu-Gly complexes 20190206
Modified: pkg/CHNOSZ/demo/dehydration.R
===================================================================
--- pkg/CHNOSZ/demo/dehydration.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/dehydration.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,21 +1,14 @@
# CHNOSZ/demo/dehydration.R
-# Plot temperature dependence of log K for some dehydration reactions
+# Plot logK vs temperature for some dehydration reactions
+# 20151126 first version
+# 20250527 add state labels for amino acid and protein backbone
+
library(CHNOSZ)
-# The RSVGTipsDevice package allows us to create an SVG file with
-# tooltips and hyperlinks
-if(require("RSVGTipsDevice")) {
+# Define T values
+T <- seq(0, 175)
-# Because the tooltip titles in the SVG file are shown by recent browsers,
-# we do not need to draw the tooltips explicitly, so set toolTipMode = 0
-devSVGTips("dehydration.svg", toolTipMode = 0, title = "Dehydration reactions")
-
-# Unfortunately, plotmath can't be used with devSVGTips,
-# so axis labels here don't contain italics.
-T <- seq(1, 175)
-plot(range(T), c(-2, 1), type = "n", xlab = "T, °C", ylab = "log K")
-title(main = "Dehydration reactions")
-
+# Define reactions
reactants <- c("[AABB]", "[AABB]", "malate-2", "goethite", "gypsum", "epsomite", "ethanol")
products <- c("[UPBB]", "[PBB]", "fumarate-2", "hematite", "anhydrite", "hexahydrite", "ethylene")
rstate <- c("aq", "cr", "aq", "cr", "cr", "cr", "aq")
@@ -22,63 +15,38 @@
pstate <- c("aq", "cr", "aq", "cr", "cr", "cr", "gas")
rcoeff <- c(-1, -1, -1, -2, -0.5, -1, -1)
pcoeff <- c(1, 1, 1, 1, 0.5, 1, 1)
-# Position and rotation of the names
-ilab <- c(140, 120, 60, 60, 20, 120, 120)
-srt <- c(10, 29, 25, 12, 13, 20, 35)
-# Reference and temperature for examples of similar calculations
-ex.T <- c(NA, NA, NA, NA, 40, NA, 170)
-ex.txt <- c(NA, NA, NA, NA, "cf. Mercury et al., 2001", NA, "Shock, 1993")
-ex.doi <- c(NA, NA, NA, NA, "10.1016/S0883-2927(00)00025-1", NA, "10.1016/0016-7037(93)90542-5")
+# Assign position (index on x-axis) and rotation of the names
+ilab <- c(140, 120, 60, 60, 20, 130, 120)
+srt <- c(15, 25, 20, 12, 8, 15, 30)
+# Setup plot
+plot(range(T), c(-3, 1), type = "n", xlab = axis.label("T"), ylab = axis.label("logK"))
+title(main = "Dehydration reactions")
+
for(i in 1:length(reactants)) {
- # Lines
- s <- subcrt(c(reactants[i], products[i], "H2O"),
- c(rstate[i], pstate[i], "liq"),
- c(rcoeff[i], pcoeff[i], 1), T = T)
+ # Calculate standard thermodynamic properties of reaction
+ # Suppress warnings about T limits of Cp equations for
+ # goethite, gypsum, epsomite, and hexahydrite 20250527
+ s <- suppressWarnings(subcrt(c(reactants[i], products[i], "H2O"),
+ c(rstate[i], pstate[i], "liq"), c(rcoeff[i], pcoeff[i], 1), T = T))
+
+ # Plot line for logK
lines(T, s$out$logK)
- # Points
- if(!is.na(ex.T[i])) {
- URL <- paste0("https://doi.org/", ex.doi[i])
- setSVGShapeURL(URL, target = "_blank")
- setSVGShapeContents(paste0("<title>", ex.txt[i], "</title>"))
- # We would use this instead with toolTipMode = 1 :
- #setSVGShapeToolTip(title = ex.txt[i])
- points(ex.T[i], s$out$logK[ex.T[i]])
- }
-
- # Names
+ # Add labels for reactant and product
for(j in 1:2) {
- formula <- thermo()$OBIGT$formula[s$reaction$ispecies[j]]
- key1 <- thermo()$OBIGT$ref1[s$reaction$ispecies[j]]
- # Remove suffix from the key (e.g. "DLH06 [S15]" --> "DLH06")
- key1 <- strsplit(key1, " ")[[1]][1]
- ikey1 <- which(thermo()$refs$key == key1)
- URL1 <- thermo()$refs$URL[ikey1]
- setSVGShapeURL(URL1, target = "_blank")
- setSVGShapeContents(paste0("<title>", paste(formula, s$reaction$state[j]), "</title>"))
+ # Remove charge from names
+ name <- gsub("-.*", "", s$reaction$name[j])
+ # Add state for amino acid and protein backbones
+ if(grepl("BB", name)) name <- paste(name, rstate[i])
+ # Put reactant and product labels on opposite sides of line
if(j == 1) dy <- 0.08 else dy <- -0.03
if(j == 1) dx <- 0 else dx <- 5
- # Strip charge from names
- name <- gsub("-.*", "", s$reaction$name[j])
text(T[ilab[i]] + dx, s$out$logK[ilab[i]] + dy, name, adj = 1, srt = srt[i])
- # Add a second reference link if needed
- key2 <- thermo()$OBIGT$ref2[s$reaction$ispecies[j]]
- if(!is.na(key2)) {
- ikey2 <- which(thermo()$refs$key == key2)
- URL2 <- thermo()$refs$URL[ikey2]
- setSVGShapeURL(URL2, target = "_blank")
- setSVGShapeContents("<title>2nd reference</title>")
- text(T[ilab[i]] + dx, s$out$logK[ilab[i]] + dy, "(*)", adj = 0)
- }
}
}
-# Dotted line for logaH2O = 0
+# Plot dotted line at logK = 0
abline(h = 0, lty = 3)
-# Done!
-dev.off()
-
-}
Modified: pkg/CHNOSZ/demo/density.R
===================================================================
--- pkg/CHNOSZ/demo/density.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/density.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,5 +1,6 @@
# CHNOSZ/demo/density.R
# Make T-P diagram for H2O, colored according to density
+
library(CHNOSZ)
# IAPWS95 or SUPCRT92
Modified: pkg/CHNOSZ/demo/glycinate.R
===================================================================
--- pkg/CHNOSZ/demo/glycinate.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/glycinate.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,6 +1,7 @@
# CHNOSZ/demo/glycinate.R
# Plot logK of metal-glycinate complexes
# 20190207
+
library(CHNOSZ)
# Divalent metals
Modified: pkg/CHNOSZ/demo/gold.R
===================================================================
--- pkg/CHNOSZ/demo/gold.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/gold.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -2,6 +2,7 @@
# 20181101 jmd first version
# 20181109 add calculation of K+ molality
# 20190127 update Au species in OBIGT, not here
+
library(CHNOSZ)
# Set up system
Modified: pkg/CHNOSZ/demo/ionize.R
===================================================================
--- pkg/CHNOSZ/demo/ionize.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/ionize.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,5 +1,6 @@
# CHNOSZ/demo/ionize.R
-## ionize.aa(): Contour plots of net charge and ionization properties of LYSC_CHICK
+# Contour plots of net charge and ionization properties of LYSC_CHICK
+
library(CHNOSZ)
aa <- pinfo(pinfo("LYSC_CHICK"))
Modified: pkg/CHNOSZ/demo/lambda.R
===================================================================
--- pkg/CHNOSZ/demo/lambda.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/lambda.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,6 +1,7 @@
# CHNOSZ/demo/lambda.R
# Plot effects of lambda transition in quartz
# After Berman 1988 Figs. 1 and 2
+
library(CHNOSZ)
opar <- par(no.readonly = TRUE)
Modified: pkg/CHNOSZ/demo/minsol.R
===================================================================
--- pkg/CHNOSZ/demo/minsol.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/minsol.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -6,6 +6,7 @@
# 20220715 Allow to change metals (renamed from zinc.R to minsol.R)
library(CHNOSZ)
+
opar <- par(no.readonly = TRUE)
par(mfrow = c(2, 2))
Modified: pkg/CHNOSZ/demo/potassium.R
===================================================================
--- pkg/CHNOSZ/demo/potassium.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/potassium.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,8 +1,9 @@
# CHNOSZ/demo/potassium.R
+# Compare mineral stabilities predicted with the Berman and Helgeson datasets
+# on a T - log(K+/H+) diagram, after Sverjensky et al., 1991
+# (doi:10.1016/0016-7037(91)90157-Z)
# Moved from berman.Rd 20200727
-### Compare mineral stabilities predicted with the Berman and Helgeson datasets
-### on a T - log(K+/H+) diagram, after Sverjensky et al., 1991
-### (doi:10.1016/0016-7037(91)90157-Z)
+
library(CHNOSZ)
## Set up the system: basis species
Modified: pkg/CHNOSZ/demo/protbuff.R
===================================================================
--- pkg/CHNOSZ/demo/protbuff.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/protbuff.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,8 +1,7 @@
# CHNOSZ/demo/protbuff.R
-## Buffer + ionization: Metastablilities of
-## thiol peroxidases from model bactera
-## (ECOLI, BACSU mesophile; AQUAE thermophile,
-## THIDA acidophile, BACHD alkaliphile)
+# Buffer + ionization: Metastablilities of thiol peroxidases from model bactera
+# (ECOLI, BACSU mesophile; AQUAE thermophile, THIDA acidophile, BACHD alkaliphile)
+
library(CHNOSZ)
basis("CHNOS+")
Modified: pkg/CHNOSZ/demo/rank.affinity.R
===================================================================
--- pkg/CHNOSZ/demo/rank.affinity.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/rank.affinity.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,8 +1,9 @@
# CHNOSZ/demo/rank.affinity.R
-## Affinity ranking for proteins coded by differentially expressed
-## genes in response to carbon limitation in yeast
+# Affinity ranking for proteins coded by differentially expressed
+# genes in response to carbon limitation in yeast
# Demo written on 20220620
# Adapted from an example previously in read.expr.Rd (CHNOSZ 1.1.0) and yeast.Rd (CHNOSZ 1.2.0-1.3.0)
+
library(CHNOSZ)
# Experimental data are from Tai et al. (2005)
Modified: pkg/CHNOSZ/demo/references.R
===================================================================
--- pkg/CHNOSZ/demo/references.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/references.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,5 +1,8 @@
# CHNOSZ/demo/reference.R
-## Cross-checking references
+# Cross-checking references
+# 20121231 first version (sources.R)
+# 20241225 renamed to references.R
+
library(CHNOSZ)
# The available reference keys
Modified: pkg/CHNOSZ/demo/rubisco_Zc.R
===================================================================
--- pkg/CHNOSZ/demo/rubisco_Zc.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/rubisco_Zc.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -4,10 +4,10 @@
library(CHNOSZ)
-datfile <- system.file("extdata/misc/rubisco.csv", package = "CHNOSZ")
-fastafile <- system.file("extdata/protein/rubisco.fasta", package = "CHNOSZ")
+datfile <- system.file("extdata/protein/rubisco.csv", package = "CHNOSZ")
+aafile <- system.file("extdata/protein/rubisco_aa.csv", package = "CHNOSZ")
dat <- read.csv(datfile)
-aa <- canprot::read_fasta(fastafile)
+aa <- read.csv(aafile)
Topt <- (dat$T1 + dat$T2) / 2
idat <- match(dat$ID, substr(aa$protein, 4, 9))
aa <- aa[idat, ]
@@ -25,13 +25,13 @@
# The old code for making the SVG image
# - RSVGTipsDevice is no longer on CRAN: https://cran.r-project.org/web/packages/RSVGTipsDevice/index.html
-# - I got a compilation error trying to install it with remotes::install_github("cran/RSVGTipsDevice")
+# - I got a compilation error trying to install it with remotes::install_github("cran/RSVGTipsDevice") 20250510
if(require(RSVGTipsDevice, quietly = TRUE)) {
- datfile <- system.file("extdata/misc/rubisco.csv", package = "CHNOSZ")
- fastafile <- system.file("extdata/protein/rubisco.fasta", package = "CHNOSZ")
+ datfile <- system.file("extdata/protein/rubisco.csv", package = "CHNOSZ")
+ aafile <- system.file("extdata/protein/rubisco_aa.csv", package = "CHNOSZ")
dat <- read.csv(datfile)
- aa <- canprot::read_fasta(fastafile)
+ aa <- read.csv(aafile)
Topt <- (dat$T1 + dat$T2) / 2
idat <- match(dat$ID, substr(aa$protein, 4, 9))
aa <- aa[idat, ]
Modified: pkg/CHNOSZ/demo/saturation.R
===================================================================
--- pkg/CHNOSZ/demo/saturation.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/saturation.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,8 +1,8 @@
# CHNOSZ/demo/saturation.R
-## Make equilibrium activity diagrams including saturation limits
-## and using activity ratios as variables
-# first version (activity_ratios.R) 20170217
-# keep one diagram and add saturation lines 20190127
+# Make equilibrium activity diagrams including saturation limits and using activity ratios as variables
+# 20170217 first version (activity_ratios.R)
+# 20190127 keep one diagram and add saturation lines
+
library(CHNOSZ)
# The ratios are calculated with pH = 0 (activity of H+ = 1), so (activity of the ion) is equal to
Modified: pkg/CHNOSZ/demo/solubility.R
===================================================================
--- pkg/CHNOSZ/demo/solubility.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/solubility.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,6 +1,8 @@
-# CHNOSZ/demo/solubility.R: solubility of CO2 and calcite
+# CHNOSZ/demo/solubility.R
+# Solubility of CO2 and calcite
# 20150306 jmd first version; used uniroot() to find zero affinity
# 20181031 use new vectorized, non-uniroot solubility(); add T-pH plots
+
library(CHNOSZ)
# For comparison with published CO2 solubility plot, see Fig. 4.5 in
Modified: pkg/CHNOSZ/demo/sphalerite.R
===================================================================
--- pkg/CHNOSZ/demo/sphalerite.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/sphalerite.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,6 +1,7 @@
# CHNOSZ/demo/sphalerite.R
# Sphalerite solubility after Akinfiev and Tagirov, 2014, Fig. 13
# 20190526 jmd initial version
+
library(CHNOSZ)
opar <- par(no.readonly = TRUE)
Modified: pkg/CHNOSZ/demo/uranyl.R
===================================================================
--- pkg/CHNOSZ/demo/uranyl.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/demo/uranyl.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,6 +1,7 @@
# CHNOSZ/demo/uranyl.R
# Total (carbonate|sulfate)-pH diagrams for uranyl species, after Migdisov et al., 2024
-# 20241116 jmd
+# 20241116 first version
+
library(CHNOSZ)
# Conditions
Deleted: pkg/CHNOSZ/inst/extdata/misc/rubisco.csv
===================================================================
--- pkg/CHNOSZ/inst/extdata/misc/rubisco.csv 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/inst/extdata/misc/rubisco.csv 2025-05-27 01:45:53 UTC (rev 908)
@@ -1,28 +0,0 @@
-ID,T1,T2,domain,species,URL
-G9FID8,0,6,E,"Phaeocystis antarctica",https://doi.org/10.3354/ab00256
-M9R7V1,4,10,B,"Octadecabacter antarcticus 307",https://doi.org/10.1016/S0723-2020(97)80003-3
-K4MAK9,18,18,A,"Methanolobus psychrophilus",https://doi.org/10.1128/AEM.01146-08
-Q12TQ0,23,23,A,"Methanococcoides burtonii",https://doi.org/10.1016/S0723-2020(11)80117-7
-Q9ZI34,25,30,B,"Bradyrhizobium japonicum",https://doi.org/10.1099/00207713-32-1-136
-P0C916,28,30,B,"Thiobacillus ferrooxidans",https://doi.org/10.1080/01490459209377920
-P00874,30,30,E,"Zea mays",https://doi.org/10.1016/S0065-2113(08)60322-3
-Q0EX22,30,30,B,"Mariprofundus ferrooxydans",https://doi.org/10.1371/journal.pone.0000667
-L0RHZ1,35,35,B,"Desulfovibrio hydrothermalis",https://doi.org/10.1099/ijs.0.02323-0
-Q8THG2,35,40,A,"Methanosarcina acetivorans",http://aem.asm.org/content/47/5/971
-F9ZLP0,45,45,B,"Acidithiobacillus caldus",https://doi.org/10.1099/13500872-140-12-3451
-P37393,45,45,E,"Cyanidium caldarium",http://link.springer.com/article/10.1007/BF00409031
-P72383,45,50,B,"Sulfobacillus acidophilus",https://doi.org/10.1099/00221287-142-4-775
-Q51856,52,52,B,"Pseudomonas hydrogenothermophila",https://doi.org/10.1271/bbb1961.41.685
-Q2JIP3,50,55,B,"Synechococcus sp. (strain JA-2-3B'a(2-13))",https://doi.org/10.1128/AEM.72.1.544-550.2006
-A0B9K9,55,60,A,"Methanosaeta thermophila",https://doi.org/10.1099/00207713-42-3-463
-Q8DIS5,57,57,B,"Thermosynechococcus elongatus",https://doi.org/10.1093/oxfordjournals.pcp.a075684
-G8LZL2,60,60,B,"Clostridium clariflavum",https://doi.org/10.1099/ijs.0.003483-0
-F8IID7,65,65,B,"Bacillus acidocaldarius",https://doi.org/10.1099/00221287-67-1-9
-A8F7V4,65,65,B,"Thermotoga lettingae",https://doi.org/10.1099/00207713-52-4-1361
-B9KXE5,70,70,B,"Thermomicrobium roseum",https://doi.org/10.1371/journal.pone.0004207
-O28635,76,76,A,"Archaeoglobus fulgidus",http://aem.asm.org/content/60/4/1227
-Q58632,85,85,A,"Methanocaldococcus jannaschii",https://doi.org/10.1007/BF00425213
-A1RZJ5,85,90,A,"Thermofilum pendens",https://doi.org/10.1016/S0723-2020(83)80035-6
-A3DND9,85,92,A,"Staphylothermus marinus",https://doi.org/10.1016/S0723-2020(86)80157-6
-O58677,98,98,A,"Pyrococcus horikoshii",https://doi.org/10.1007/s007920050051
-Q8U1P9,100,100,A,"Pyrococcus furiosus",https://doi.org/10.1007/BF00413027
Modified: pkg/CHNOSZ/inst/extdata/protein/Cas/mkaa.R
===================================================================
--- pkg/CHNOSZ/inst/extdata/protein/Cas/mkaa.R 2025-05-27 00:31:05 UTC (rev 907)
+++ pkg/CHNOSZ/inst/extdata/protein/Cas/mkaa.R 2025-05-27 01:45:53 UTC (rev 908)
@@ -15,7 +15,7 @@
# Get amino acid composition for each protein
aalist <- lapply(1:nrow(dat), function(iID) {
file <- file.path("fasta", paste0(dat$ID[iID], ".fasta"))
- aa <- read_fasta(file)
+ aa <- canprot::read_fasta(file)
# Store systematic name and ID
aa$protein <- dat$Systematic[iID]
aa$ref <- dat$ID[iID]
Copied: pkg/CHNOSZ/inst/extdata/protein/rubisco.csv (from rev 907, pkg/CHNOSZ/inst/extdata/misc/rubisco.csv)
===================================================================
--- pkg/CHNOSZ/inst/extdata/protein/rubisco.csv (rev 0)
+++ pkg/CHNOSZ/inst/extdata/protein/rubisco.csv 2025-05-27 01:45:53 UTC (rev 908)
@@ -0,0 +1,28 @@
+ID,T1,T2,domain,species,URL
+G9FID8,0,6,E,"Phaeocystis antarctica",https://doi.org/10.3354/ab00256
+M9R7V1,4,10,B,"Octadecabacter antarcticus 307",https://doi.org/10.1016/S0723-2020(97)80003-3
+K4MAK9,18,18,A,"Methanolobus psychrophilus",https://doi.org/10.1128/AEM.01146-08
+Q12TQ0,23,23,A,"Methanococcoides burtonii",https://doi.org/10.1016/S0723-2020(11)80117-7
+Q9ZI34,25,30,B,"Bradyrhizobium japonicum",https://doi.org/10.1099/00207713-32-1-136
+P0C916,28,30,B,"Thiobacillus ferrooxidans",https://doi.org/10.1080/01490459209377920
+P00874,30,30,E,"Zea mays",https://doi.org/10.1016/S0065-2113(08)60322-3
+Q0EX22,30,30,B,"Mariprofundus ferrooxydans",https://doi.org/10.1371/journal.pone.0000667
+L0RHZ1,35,35,B,"Desulfovibrio hydrothermalis",https://doi.org/10.1099/ijs.0.02323-0
+Q8THG2,35,40,A,"Methanosarcina acetivorans",http://aem.asm.org/content/47/5/971
+F9ZLP0,45,45,B,"Acidithiobacillus caldus",https://doi.org/10.1099/13500872-140-12-3451
+P37393,45,45,E,"Cyanidium caldarium",http://link.springer.com/article/10.1007/BF00409031
+P72383,45,50,B,"Sulfobacillus acidophilus",https://doi.org/10.1099/00221287-142-4-775
+Q51856,52,52,B,"Pseudomonas hydrogenothermophila",https://doi.org/10.1271/bbb1961.41.685
+Q2JIP3,50,55,B,"Synechococcus sp. (strain JA-2-3B'a(2-13))",https://doi.org/10.1128/AEM.72.1.544-550.2006
+A0B9K9,55,60,A,"Methanosaeta thermophila",https://doi.org/10.1099/00207713-42-3-463
+Q8DIS5,57,57,B,"Thermosynechococcus elongatus",https://doi.org/10.1093/oxfordjournals.pcp.a075684
+G8LZL2,60,60,B,"Clostridium clariflavum",https://doi.org/10.1099/ijs.0.003483-0
+F8IID7,65,65,B,"Bacillus acidocaldarius",https://doi.org/10.1099/00221287-67-1-9
+A8F7V4,65,65,B,"Thermotoga lettingae",https://doi.org/10.1099/00207713-52-4-1361
+B9KXE5,70,70,B,"Thermomicrobium roseum",https://doi.org/10.1371/journal.pone.0004207
+O28635,76,76,A,"Archaeoglobus fulgidus",http://aem.asm.org/content/60/4/1227
+Q58632,85,85,A,"Methanocaldococcus jannaschii",https://doi.org/10.1007/BF00425213
+A1RZJ5,85,90,A,"Thermofilum pendens",https://doi.org/10.1016/S0723-2020(83)80035-6
+A3DND9,85,92,A,"Staphylothermus marinus",https://doi.org/10.1016/S0723-2020(86)80157-6
+O58677,98,98,A,"Pyrococcus horikoshii",https://doi.org/10.1007/s007920050051
+Q8U1P9,100,100,A,"Pyrococcus furiosus",https://doi.org/10.1007/BF00413027
Added: pkg/CHNOSZ/inst/extdata/protein/rubisco_aa.csv
===================================================================
--- pkg/CHNOSZ/inst/extdata/protein/rubisco_aa.csv (rev 0)
+++ pkg/CHNOSZ/inst/extdata/protein/rubisco_aa.csv 2025-05-27 01:45:53 UTC (rev 908)
@@ -0,0 +1,28 @@
+protein,organism,ref,abbrv,chains,Ala,Cys,Asp,Glu,Phe,Gly,His,Ile,Lys,Leu,Met,Asn,Pro,Gln,Arg,Ser,Thr,Val,Trp,Tyr
+tr|A0B9K9,METTP,NA,A0B9K9,1,45,3,24,32,10,39,10,19,16,30,14,10,15,8,29,15,20,39,4,8
+tr|A1RZJ5,THEPD,NA,A1RZJ5,1,44,1,22,36,16,43,11,23,27,34,12,6,27,10,28,17,18,43,6,19
+tr|A3DND9,STAMF,NA,A3DND9,1,36,1,25,33,16,41,14,32,33,36,12,10,26,5,26,17,18,33,6,23
+tr|A8F7V4,THELT,NA,A8F7V4,1,25,4,15,26,25,30,9,35,24,31,8,21,18,13,15,25,18,23,0,11
+tr|B9KXE5,THERP,NA,B9KXE5,1,50,6,21,26,16,35,12,29,6,40,12,11,24,11,36,18,20,24,6,15
+tr|F8IID7,ALIAT,NA,F8IID7,1,51,2,24,28,12,44,10,17,12,42,8,6,23,9,33,12,14,37,3,13
+tr|F9ZLP0,ACICS,NA,F9ZLP0,1,47,6,32,32,23,45,17,21,22,38,12,17,20,7,32,17,23,35,10,16
+tr|G8LZL2,CLOCD,NA,G8LZL2,1,26,6,16,33,25,38,6,26,26,42,10,19,19,4,18,32,11,20,0,11
+tr|G9FID8,9EUKA,NA,G9FID8,1,48,11,33,25,19,44,10,26,24,43,18,16,19,13,27,22,29,33,7,21
+tr|K4MAK9,9EURY,NA,K4MAK9,1,41,6,31,26,22,42,13,22,34,39,19,20,22,17,17,22,22,39,7,18
+tr|L0RHZ1,9DELT,NA,L0RHZ1,1,52,5,31,27,28,47,12,21,25,30,19,17,20,19,20,20,23,23,5,19
+tr|M9R7V1,9RHOB,NA,M9R7V1,1,55,5,23,20,12,42,11,21,14,42,13,15,24,14,22,26,25,25,4,6
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/chnosz -r 908
More information about the CHNOSZ-commits
mailing list