Next: util.formula
Up: CHNOSZ examples
Previous: util.character
utl.dt> ## Don't show:
utl.dt> data(thermo)
thermo$obigt has 1800 aqueous, 2925 total species
utl.dt> ## End Don't show
utl.dt> ## modify/add species
utl.dt> info(ia <- info("alanine","cr"))
info: 2118 refers to alanine, C3H7NO2 cr (HOK+98, 30.Aug.06)
name abbrv formula state ref1 ref2 date G H S Cp V a b c d
2118 alanine <NA> C3H7NO2 cr HOK+98 <NA> 30.Aug.06 -88440 -134500 30.88 29.21 107.556 5.772 0.07862 0 0
e f lambda T
2118 0 0 0 587
utl.dt> mod.obigt("alanine",state="cr",G=0,H=0,S=0)
mod.obigt: updating alanine cr (2118).
utl.dt> # now the values of G, H, and S are inconsistent
utl.dt> # with the elemental composition of alanine
utl.dt> info(ia)
checkGHS: G of alanine cr differs by 55266 from tabulated value
name abbrv formula state ref1 ref2 date G H S Cp V a b c d e f lambda T
2118 alanine <NA> C3H7NO2 cr USER <NA> 18.Aug.11 0 0 0 29.21 107.556 5.772 0.07862 0 0 0 0 0 587
utl.dt> # add a species
utl.dt> mod.obigt("myspecies",formula="CHNOSZ",G=0,H=0)
mod.obigt: adding myspecies aq (2926).
utl.dt> info(im <- info("myspecies"))
info: 2926 refers to myspecies, CHNOSZ aq (USER, 18.Aug.11)
info: S of myspecies aq is NA; set to 56.45.
name abbrv formula state ref1 ref2 date G H S Cp V a1 a2 a3 a4 c1 c2 omega Z
2926 myspecies <NA> CHNOSZ aq USER <NA> 18.Aug.11 0 0 56.44706 NA NA NA NA NA NA NA NA NA NA
utl.dt> ## Not run:
utl.dt> ##D ## marked dontrun because they open pages in a browser
utl.dt> ##D # show the contents of thermo$refs
utl.dt> ##D browse.refs()
utl.dt> ##D # Internet needed for the following examples:
utl.dt> ##D # open URL for Helgeson et al., 1998
utl.dt> ##D browse.refs("HOK+98")
utl.dt> ##D # open two URLs for alanine
utl.dt> ##D browse.refs(info("alanine"))
utl.dt> ##D # open three URLs for species in the reaction
utl.dt> ##D s <- subcrt(c("O2","O2"),c("gas","aq"),c(-1,1))
utl.dt> ##D browse.refs(s)
utl.dt> ##D
utl.dt> ## End(Not run)
utl.dt>
utl.dt>
utl.dt>
utl.fs> # basic use of splitline
utl.fs> splitline("abcdefghijklmnopqrstuvwxyz",10)
[1] "abcdefghij" "klmnopqrst" "uvwxyz"
utl.fs> # get the first ten positions of each of the sequences
utl.fs> # in a FASTA file
utl.fs> f <- system.file("extdata/fasta/HTCC1062.faa.xz",package="CHNOSZ")
utl.fs> fnew <- trimfas(f,1,10)
Next: util.formula
Up: CHNOSZ examples
Previous: util.character