This function filters OTU values from the observation data and the taxmap object based on a minimum proportional mean across samples per OTU.
otu_proportion_filter(obj, otu_percentage = 5e-05, validated = FALSE)
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 |
Returns a taxmap object that contains otu_ids that have passed the above filter.
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.
validate_MicrobiomeR_format
,otu_id_filter
Other Advanced Metacoder Filters: agglomerate_taxmap
,
cov_filter
,
otu_prevalence_filter
,
taxa_prevalence_filter
# 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 ) } # }