drop_taxa: Dropping Species with Few abundance and Few Occurrences

Description Usage Arguments Value Author(s) Examples

Description

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.

Usage

1
2
3
4
5
6
7
drop_taxa(obj, ...)

## S4 method for signature 'data.frame'
drop_taxa(obj, minocc = 0, minabu = 0, ...)

## S4 method for signature 'phyloseq'
drop_taxa(obj, ...)

Arguments

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.

Value

dataframe of new features.

Author(s)

Shuangbin Xu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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)]
otuda <- data.frame(t(otuda), check.names=FALSE)
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)

MicrobiotaProcess documentation built on April 18, 2021, 6 p.m.