Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

envHash2otu_table

Convert a sequence-sample hash (like ENV file) into an OTU table.


Description

Parses an ENV-file into a sparse matrix of species-by-sample, where each species-row has only one non-zero value. We call this sparse abundance table the trivial OTU table, where every sequence is treated as a separate species. If a phylogenetic tree is available, it can be submitted with this table as arguments to tip_glom to create an object with a non-trivial otu_table.

Usage

envHash2otu_table(tipSampleTable)

Arguments

tipSampleTable

(Required). A two-column character table (matrix or data.frame), where each row specifies the sequence name and source sample, consistent with the env-file for the UniFrac server (http://bmf2.colorado.edu/unifrac/).

Value

otu_table. A trivial OTU table where each sequence is treated as a separate OTU.

References

See Also

Examples

#
## fakeSeqNameVec <- paste("seq_", 1:8, sep="")
## fakeSamNameVec <- c(rep("A", 4), rep("B", 4))
## fakeSeqAbunVec <- sample(1:50, 8, TRUE)
## test    <- cbind(fakeSeqNameVec, fakeSamNameVec, fakeSeqAbunVec)
## testotu <- envHash2otu_table( test )
## test    <- cbind(fakeSeqNameVec, fakeSamNameVec)
## testotu <- envHash2otu_table( test )

phyloseq

Handling and analysis of high-throughput microbiome census data

v1.34.0
AGPL-3
Authors
Paul J. McMurdie <joey711@gmail.com>, Susan Holmes <susan@stat.stanford.edu>, with contributions from Gregory Jordan and Scott Chamberlain
Initial release
2019-04-23

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.