| drop_taxa {MicrobiotaProcess} | R Documentation |
Drop species or features from the feature data frame or phyloseq that occur fewer than or equal to a threshold number of occurrences and fewer abundance than to a threshold abundance.
drop_taxa(obj, ...) ## S4 method for signature 'data.frame' drop_taxa(obj, minocc = 0, minabu = 0, ...) ## S4 method for signature 'phyloseq' drop_taxa(obj, ...)
obj |
object, phyloseq or a dataframe of species (n_sample, n_feature). |
..., |
additional parameters. |
minocc |
numeric, the threshold number of occurrences to be dropped, if < 1.0,it will be the threshold ratios of occurrences, default is 0. |
minabu |
numeric, the threshold abundance, if fewer than the threshold will be dropped, default is 0. |
dataframe of new features.
Shuangbin Xu
otudafile <- system.file("extdata", "otu_tax_table.txt",
package="MicrobiotaProcess")
otuda <- read.table(otudafile, sep="\t",
header=TRUE, row.names=1,
check.names=FALSE, skip=1,
comment.char="")
otuda <- otuda[sapply(otuda, is.numeric)]
dim(otuda)
otudat <- drop_taxa(otuda, minocc=0.1, minabu=1)
dim(otudat)
data(test_otu_data)
keepps <- drop_taxa(test_otu_data, minocc=0.1, minabu=0)