next up previous
Next: util.misc Up: CHNOSZ examples Previous: util.formula

util.matrix

## Don't show: data(thermo)
thermo$obigt: 1809 aqueous, 3368 total species
## End(Don't show) ## what combinations of the 20 common amino acids have ## a linearly independent stoichiometry with five elements? # the names of the amino acids aanames <- aminoacids("") # their species indices iaa <- suppressMessages(info(aanames)) # the full stoichiometric matrix A <- i2A(iaa) # the invertible combinations icA <- invertible.combs(A) stopifnot(nrow(icA)==6067) # that's a bit less than 40% of all possible combinations nrow(icA) / ncol(combn(20, 5))
[1] 0.3913184
# count the occurrences of each amino acid counts <- table(icA) names(counts) <- aminoacids(1) (sc <- sort(counts))
I L A G V K S T E N Q D P F Y R H W C M 1062 1062 1176 1206 1210 1331 1331 1351 1375 1377 1377 1385 1388 1396 1399 1401 1409 1423 3338 3338
# the two sulfur-containing ones show up most frequently stopifnot(tail(names(sc), 2)==c("C", "M"))


next up previous
Next: util.misc Up: CHNOSZ examples Previous: util.formula