taxa_prevalence_filter: Taxonomic Prevalence Filter (Metacoder)

Description Usage Arguments Details Value See Also Examples

Description

This function filters observations at a specific rank by their prevalence across samples.

Usage

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

Arguments

obj

A Taxmap object.

rank

The rank being analyzed for prevalence across samples.

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 taxa_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) at the specified agglomerated rank (rank). The phyloseq workflow calls for a minimum abundance of 5 across This method is considered supervised, because the filtering is done based on taxonomic annotation (taxon_ids), which is assigned based on a reference database (SILVA or GreenGenes).

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_prevalence_filter, otu_proportion_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
36
37
38
39
40
41
42
43
44
45
## 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
    )
# Taxa Prevalence Filter
# The default minimum abundance is 5 and the sample percentage is 0.5 (5%).
# Phylum
metacoder_obj <- taxa_prevalence_filter(
    obj = metacoder_obj,
    rank = "Phylum"
    )
# Class
metacoder_obj <- taxa_prevalence_filter(
    obj = metacoder_obj,
    rank = "Class",
    validated = TRUE
    )
 }

## End(Not run)

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