importQIIME2 | R Documentation |
TreeSummarizedExperiment
Results exported from QIMME2 can be imported as a
TreeSummarizedExperiment
using importQIIME2
. Except for the
featureTableFile
, the other data types, taxonomyTableFile
,
refSeqFile
and phyTreeFile
, are optional, but are highly
encouraged to be provided.
Import the QIIME2 artifacts to R.
importQIIME2(
featureTableFile,
taxonomyTableFile = NULL,
sampleMetaFile = NULL,
featureNamesAsRefSeq = TRUE,
refSeqFile = NULL,
phyTreeFile = NULL,
...
)
importQZA(file, temp = tempdir(), ...)
featureTableFile |
a single |
taxonomyTableFile |
a single |
sampleMetaFile |
a single |
featureNamesAsRefSeq |
|
refSeqFile |
a single |
phyTreeFile |
a single |
... |
additional arguments:
|
file |
character, path of the input qza file. Only files in format of
|
temp |
character, a temporary directory in which the qza file will be
decompressed to, default |
Both arguments featureNamesAsRefSeq
and refSeqFile
can be used
to define reference sequences of features. featureNamesAsRefSeq
is
only taken into account, if refSeqFile
is NULL
. No reference
sequences are tried to be created, if featureNameAsRefSeq
is
FALSE
and refSeqFile
is NULL
.
A
TreeSummarizedExperiment
object
matrix
object for feature table, DataFrame
for taxonomic table,
ape::phylo
object for phylogenetic tree,
Biostrings::DNAStringSet
for representative sequences of taxa.
Yang Cao
Bolyen E et al. 2019: Reproducible, interactive, scalable and extensible microbiome data science using QIIME 2. Nature Biotechnology 37: 852–857. https://doi.org/10.1038/s41587-019-0209-9
makeTreeSEFromPhyloseq
makeTreeSEFromBiom
makeTreeSEFromDADA2
importMothur
featureTableFile <- system.file("extdata", "table.qza", package = "mia")
taxonomyTableFile <- system.file("extdata", "taxonomy.qza", package = "mia")
sampleMetaFile <- system.file("extdata", "sample-metadata.tsv", package = "mia")
phyTreeFile <- system.file("extdata", "tree.qza", package = "mia")
refSeqFile <- system.file("extdata", "refseq.qza", package = "mia")
tse <- importQIIME2(
featureTableFile = featureTableFile,
taxonomyTableFile = taxonomyTableFile,
sampleMetaFile = sampleMetaFile,
refSeqFile = refSeqFile,
phyTreeFile = phyTreeFile
)
tse
# Read individual files
featureTableFile <- system.file("extdata", "table.qza", package = "mia")
taxonomyTableFile <- system.file("extdata", "taxonomy.qza", package = "mia")
sampleMetaFile <- system.file("extdata", "sample-metadata.tsv", package = "mia")
assay <- importQZA(featureTableFile)
rowdata <- importQZA(taxonomyTableFile, removeTaxaPrefixes = TRUE)
coldata <- read.table(sampleMetaFile, header = TRUE, sep = "\t", comment.char = "")
# Assign rownames
rownames(coldata) <- coldata[, 1]
coldata[, 1] <- NULL
# Order coldata based on assay
coldata <- coldata[match(colnames(assay), rownames(coldata)), ]
# Create SE from individual files
se <- SummarizedExperiment(assays = list(assay), rowData = rowdata, colData = coldata)
se
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.