otu_proportion_filter: OTU Proportion Filter

Description Usage Arguments Details Value See Also Examples

View source: R/metacoder.R

Description

This function filters OTU values from the observation data and the taxmap object based on a minimum proportional mean across samples per OTU.

Usage

1
otu_proportion_filter(obj, otu_percentage = 5e-05, validated = FALSE)

Arguments

obj

A Taxmap object.

otu_percentage

The minimum percentage used to compare against the proportional OTU mean. Default: 5e-05

validated

This parameter provides a way to override validation steps. Use carefully. Default: FALSE

Details

This type of filtering is used to remove OTUs that do not have a specified mean proportion. This function must be used conservatively, hence why the default otu_percentage is so low.

Value

Returns a taxmap object that contains otu_ids that have passed the above filter.

See Also

validate_MicrobiomeR_format,otu_id_filter

Other Advanced Metacoder Filters: agglomerate_taxmap, cov_filter, otu_prevalence_filter, taxa_prevalence_filter

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
## Not run: 
if(interactive()){
# Use the otu_proportions filter early on in your analysis
library(MicrobiomeR)
library(metacoder)
library(taxa)

# Convert Phyloseq object to taxmap object
metacoder_obj <- as_MicrobiomeR_format(obj = phyloseq_obj, format = "raw_format")

# Remove Archaea from the Taxmap object
metacoder_obj <- filter_taxa(
  obj = metacoder_obj,
  taxon_names == "Archaea",
  subtaxa = TRUE,
  invert = TRUE)

# Ambiguous Annotation Filter - Remove taxonomies with ambiguous names
metacoder_obj <- filter_ambiguous_taxa(metacoder_obj, subtaxa = TRUE)

# Low Sample Filter - Remove the low samples
metacoder_obj <- sample_id_filter(obj          = metacoder_obj,
                               .f_filter    = ~sum(.),
                               .f_condition = ~.>= 20, validated = TRUE)

# Master Threshold Filter - Add the otu_proportions table and then filter OTUs based on min %
metacoder_obj <- otu_proportion_filter(
    obj = metacoder_obj,
    otu_percentage = 0.00001
    )
 }

## End(Not run)

vallenderlab/MicrobiomeR documentation built on Aug. 30, 2019, 11:24 p.m.