cov_filter: Coefficient of Variation Filter

Description Usage Arguments Details Value See Also Examples

Description

This function filters OTUs that have a variance higher than the specified CoV.

Usage

1
cov_filter(obj, coefficient_of_variation, validated = FALSE)

Arguments

obj

A Taxmap object.

coefficient_of_variation

The maximum CoV that an OTU can have.

validated

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

Details

This function helps remove OTUs that have an unusually high variance using the coefficient of variation.

Value

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

See Also

validate_MicrobiomeR_format, otu_id_filter

summarise_if

Other Advanced Metacoder Filters: agglomerate_taxmap, otu_prevalence_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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
## Not run: 
if(interactive()){
# Use the cov_filter towards the end of 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
    )
# 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
    )

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

# Coefficient of Variation Filter - Filter OTUs based on the coefficient of variation
metacoder_obj <- cov_filter(obj = metacoder_obj,
                            coefficient_of_variation = 3,
                            validated = TRUE)
 }

## End(Not run)

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