Description Usage Arguments Details Value Author(s) See Also Examples
Functions for transforming raw read counts into rescaled reads (z
) and theoretical
cumulative distribution function values (f
).
1 2 3 4 | z.transform.sample(n)
z.transform.table(otu)
f.transform.sample(n)
f.transform.table(otu)
|
n |
vector of observed counts |
otu |
data frame OTU table |
z.transform.sample
fits the Poisson lognormal distribution to the count data and uses
that fit to transform those raw read counts into rescaled reads. z.transform.table
performs the same function on an OTU table (which should have one sample per column and
should have the OTU IDs as rownames). This second function is just for convenience: it applies
z.transform.sample
to each column, packages the result into a data frame, and keeps
the old rownames.
f.transform.sample
and f.transform.table
are analogous to the z
functions,
only they return theoretical cumulative distribution function values.
The resulting tables could be used on their own for analysis, but texmexseq
is
designed to slice that data into smaller “quads” (using quad.table
).
z.transform.sample |
returns a vector of transformed values |
z.transform.table |
returns a data frame of transformed values |
Scott Olesen swo@mit.edu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # make up a table of data
sim.data <- function() rpoilog(100, 1.0, 1.0, condS=TRUE)
sample1 <- sim.data()
# transform it
hist(f.transform.sample(sample1))
# make up a table of data
sample2 <- sim.data()
otu.table <- data.frame(sample1=sample1, sample2=sample2)
otu.ids <- paste('otu', seq(1, 100), sep='')
rownames(otu.table) <- otu.ids
# make a new table from those fitted values
f.table <- f.transform.table(otu.table)
hist(f.table$sample1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.