Next: basis
Up: CHNOSZ examples
Previous: nuts
makeup> ## Don't show:
makeup> data(thermo)
thermo: loaded 1997 aqueous, 3089 total species to thermo$obigt
thermo: loaded 5264 proteins to thermo$ECO
thermo: loaded 6717 proteins to thermo$SGD
thermo: loaded 4155 localizations and 3570 abundances to thermo$yeastgfp
makeup> ## End Don't show
makeup> ## makeups (nrow = number of elements)
makeup> # the composition of a single compound (ncol=1)
makeup> makeup("CO2")
count
C 1
O 2
makeup> # negative coefficients
makeup> makeup("C-4O2") # minus four C's
count
C -4
O 2
makeup> makeup("C-4O-2") # interpreted as having charge -2
count
C -4
O 1
Z -2
makeup> makeup("C-4O-2+0") # no charge
count
C -4
O -2
makeup> # sum the compositions
makeup> makeup(c("CO2","CH4"))
count
C 2
O 2
H 4
makeup> # sum with coefficients
makeup> makeup(info(c("CO2","CH4")),c(-1,1))
info: CO2 matches these species:
name abbrv formula state source1
69 CO2 carbon dioxide CO2 aq SSW01
81 CO2 CO2 CO2 aq SHS89
2844 carbon dioxide CO2 CO2 gas WEP+82
info: CH4 (methane) available in aq, liq, gas, gas.
info: 69 refers to CO2 aq (SSW01, SHS89, 11.Oct.07).
info: 1291 refers to methane aq (AH97b, SSW01, 1.Sep.06).
count
C 0
O -2
H 4
makeup> # this one adds up to zero
makeup> makeup(c("C6H12O6","C2H5OH","CO2"),c(-1,2,2))
count
C 0
H 0
O 0
makeup> ## formulas (ncol = number of elements)
makeup> # as a dataframe
makeup> makeup("Zn(CH3CH2CH2CH2CO2)2","")
Zn C H O
1 10 18 4
makeup> print( t <- makeup(c("HCl","H2O"),"") )
H Cl O
3 1 1
makeup> # as a character formula
makeup> makeup(makeup(info("glycinium"),""),"")
info: 1631 refers to glycinium, C2H6NO2+ aq (AH97b, DLH06, 25.Aug.06).
[1] "C2H6NO2+1"
makeup> makeup(t,"")
[1] "H3ClO"
makeup> # C6H12O6
makeup> makeup(makeup(makeup("CHO6H11C5"),""),"")
[1] "C6H12O6"
makeup> ## charged species, electron
makeup> # these return the same:
makeup> makeup("NH4+")
count
N 1
H 4
Z 1
makeup> makeup("NH4Z")
count
N 1
H 4
Z 1
makeup> # constitution of the electron
makeup> makeup(info("e-"))
info: 2 refers to e-, Z-1 aq (CHNOSZ, 28.Oct.06).
count
Z -1
makeup> # this produce an INcorrect makeup for the electron,
makeup> # and gives a warning because "e" is not in the
makeup> # table of elements.
makeup> makeup("e-")
count
e 1
Z -1
makeup> # compositions of made-up compounds
makeup> makeup("CHNOS")
count
C 1
H 1
N 1
O 1
S 1
makeup> makeup("CHNOSZ")
count
C 1
H 1
N 1
O 1
S 1
Z 1
makeup> makeup("CHNOSe") # Se is an element
count
C 1
H 1
N 1
O 1
Se 1
Next: basis
Up: CHNOSZ examples
Previous: nuts