data(thermo)
## converting among Gibbs, enthalpy, entropy
GHS("H") # entropy of H (element)
# calculate enthalpy of formation of arsenopyrite
GHS("FeAsS",DG=-33843,S=68.5)
# return the value of DG calculated from DH and S
# cf. -56687.71 from subcrt("water")
GHS("H2O",DH=-68316.76,S=16.7123)
## mass and entropy of compounds of elements
element("CH4")
element(c("CH4","H2O"),"mass")
element("Z") # charge
# same mass, opposite entropy as charge
element("Z-1") # i.e., electron
## count selected elements in a formula
m <- makeup("H2O")
expand.formula(c("H","O"),m)
expand.formula(c("C","H","S"),m)
## calculate the average chemical formula of all of
## the proteins in CHNOSZ' database
## this is much faster than a for-loop
pf <- protein.formula(thermo$protein)
colSums(pf)/nrow(pf)
## nominal carbon oxidation states
ZC("CO2") # 4
ZC("CH4") # -4
ZC("CHNOSZ") # 7
si <- info(info("LYSC_CHICK"))
ZC(si$formula) # 0.01631
## plot ZC of reference protein sequence
## for different organisms
file <- system.file("extdata/refseq/protein_refseq.csv.xz",package="CHNOSZ")
ip <- add.protein(file)
# only use those organisms with a certain
# number of sequenced bases
ip <- ip[as.numeric(thermo$protein$abbrv[ip])>100000]
pf <- protein.formula(thermo$protein[ip,])
zc <- ZC(pf)
# the organism names we search for
# "" matches all organisms
terms <- c("Streptomyces","Pseudomonas","Salmonella",
"Escherichia","Vibrio","Bacteroides","Lactobacillus",
"Staphylococcus","Streptococcus","Methano","Bacillus","Thermo","")
tps <- thermo$protein$ref[ip]
plot(0,0,xlim=c(1,13),ylim=c(-0.3,-0.05),pch="",
ylab="average oxidation state of carbon in proteins",
xlab="",xaxt="n",mar=c(6,3,1,1))
for(i in 1:length(terms)) {
it <- grep(terms[i],tps)
zct <- zc[it]
points(jitter(rep(i,length(zct))),zct,pch=20)
}
terms[13] <- paste("all organisms")
axis(1,1:13,terms,las=2)
title(main=paste("Average Oxidation State of Carbon:",
"Total Protein per taxID in NCBI RefSeq",sep=""))
Run the code above in your browser using DataLab