applyFilt: Apply a filter to an omicsData object

Description Usage Arguments Value Author(s) See Also Examples

Description

This function takes a filter object of class "countFilter" or "sampleFilter", and applies the filter to a dataset of class 'seqData'.

function for countFilter

function for countFilter

function for metaFilter

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
applyFilt(filter_object, omicsData, ...)

## S3 method for class 'countFilter'
applyFilt(filter_object, omicsData, upper_lim = 2,
  num_samps = NULL)

## S3 method for class 'sampleFilter'
applyFilt(filter_object, omicsData, upper_lim = 2,
  samps_to_remove = NULL)

## S3 method for class 'metaFilter'
applyFilt(filter_object, omicsData, keep_taxa)

Arguments

filter_object

an object of the class "countFilter" or "sampleFilter", created by count_based_filter sample_based_filter.

omicsData

an object of the class seqData created by as.seqData.

upper_lim

OTUs must have a max/mean/percent/nonmiss/sum number of counts above this threshold. OTUs with a count less than or equal to this number will be removed. If percent, give the decimal number, not the percentage.

num_samps

for k over a filtering, the minimum number of samples that need to have at least upper_lim features

samps_to_remove

Sample names selected to remove based on sample metadata criteria

keep_taxa

Character vector specifying which values to keep

upper_lim

Samples must have a sum number of OTU reads above this threshold. Samples with a sum less than or equal to this number will be removed.

Value

An object of the class seqData, with specified cname_ids, edata_cnames, taxa_cnames, ec_cnames, and gene_cnames filtered out of the appropriate datasets.

Author(s)

Allison Thompson

See Also

count_based_filter sample_based_filter

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
library(mintJansson)
data(rRNA_data)

to_filter <- count_based_filter(omicsData = rRNA_data, fn="mean")
rRNAdata2 <- applyFilt(filter_object = to_filter, omicsData = rRNA_data, upper_lim = 2)
print(str(attributes(rRNAdata2)$filters))

to_filter2 <- count_based_filter(omicsData = rRNAdata, fn="max")
rRNAdata3 <- applyFilt(filter_object = to_filter2, omicsData = rRNAdata, upper_lim = 2)
print(str(attributes(rRNAdata3)$filters))

## End(Not run)

pmartR/pmartRseq documentation built on May 25, 2019, 9:20 a.m.