next up previous
Next: affinity Up: CHNOSZ examples Previous: basis

species

specis>   ## Don't show:
specis> 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

specis> ## End Don't show
specis>   ## add, modify, delete species
specis>   basis("CHNOS")
    C H N O S ispecies logact state
CO2 1 0 0 2 0       69     -3    aq
H2O 0 2 0 1 0        1      0   liq
NH3 0 3 1 0 0       68     -4    aq
H2S 0 2 0 0 1       70     -7    aq
O2  0 0 0 2 0     2852    -80   gas

specis>   species(c("CO2","NH3"))  # aqueous species

specis>   species(c("CO2","NH3"),"gas")  # gases

specis>   # delete the first couple of species
specis>   species(1:2,delete=TRUE)

specis>   # modify the logarithms of activities (actually
specis>   # fugacities) of the remaining species
specis>   species(1:2,c(-2,-5))

specis>   # set the species to aqueous
specis>   species(1:2,"aq")

specis>   # delete all the species
specis>   species(delete=TRUE)

specis>   ## add and delete species
specis>   basis(c("CaO","CO2","H2O","SiO2","MgO","O2"))
basis: changed basis to CaO CO2 H2O SiO2 MgO O2.
     C Ca H Mg O Si ispecies logact state
CaO  0  1 0  0 1  0     2155      0    cr
CO2  1  0 0  0 2  0       69      0    aq
H2O  0  0 2  0 1  0        1      0   liq
SiO2 0  0 0  0 2  1       72      0    aq
MgO  0  0 0  1 1  0     2190      0    cr
O2   0  0 0  0 2  0     2852      0   gas

specis>   # a species with Fe (faylite) can be loaded,
specis>   # but its initial logarithm of activity is NA to
specis>   # indicate that it falls outside the basis definition
specis>   species(c("dolomite","quartz","calcite","forsterite","fayalite"))
basis.comp: missing element Fe from species 2101.

specis>   # changing the elements in the basis definition
specis>   # causes species to be deleted
specis>   basis(c("CO2","H2O","O2"))
basis: changed basis to CO2 H2O O2.
    C H O ispecies logact state
CO2 1 0 2       69      0    aq
H2O 0 2 1        1      0   liq
O2  0 0 2     2852      0   gas

specis>   species()  # NULL
NULL


next up previous
Next: affinity Up: CHNOSZ examples Previous: basis