otu_prevalence_filter: OTU Prevalence Filter

Description Usage Arguments Details Value See Also Examples

Description

This function filters observations by their prevalence across samples.

Usage

1
2
otu_prevalence_filter(obj, minimum_abundance = 5,
  rel_sample_percentage = 0.5, validated = FALSE)

Arguments

obj

A Taxmap object.

minimum_abundance

The minimum abundance needed per observation per sample. Default: 5

rel_sample_percentage

The percentage of samples per observation that meet the minimum abundance. Default: 0.5

validated

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

Details

The otu_prevalence_filter filters taxon_ids that do not appear more than a certain amount of times (minimum abundance) in a certain percentage of samples (rel_sample_percentage). The phyloseq workflow calls for a minimum abundance of 5 across This filtering method is considered unsupervised, because it solely relies on the data in this experiment (OTU ids).

Value

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

See Also

validate_MicrobiomeR_format

calc_prop_samples

filter

filter_taxa

Other Advanced Metacoder Filters: agglomerate_taxmap, cov_filter, otu_proportion_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
34
35
## Not run: 
if(interactive()){
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
    )

# OTU prevalence filter
metacoder_obj <- otu_prevalence_filter(obj = metacoder_obj, validated = TRUE)
 }

## End(Not run)

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