Description Usage Arguments Details Value See Also Examples
This function filters OTUs that have a variance higher than the specified CoV.
1 | cov_filter(obj, coefficient_of_variation, validated = FALSE)
|
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 |
This function helps remove OTUs that have an unusually high variance using the coefficient of variation.
Returns a taxmap object that contains otu_ids that have passed the above filter.
validate_MicrobiomeR_format
, otu_id_filter
Other Advanced Metacoder Filters: agglomerate_taxmap
,
otu_prevalence_filter
,
otu_proportion_filter
,
taxa_prevalence_filter
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.