View source: R/filter_features.r
filter.features | R Documentation |
This function performs unsupervised feature filtering.
filter.features(siamcat, filter.method = "abundance",
cutoff = 0.001, rm.unmapped = TRUE, feature.type='original', verbose = 1)
siamcat |
an object of class siamcat-class |
filter.method |
string, method used for filtering the features, can be
one of these: |
cutoff |
float, abundace, prevalence, or variance cutoff, defaults
to |
rm.unmapped |
boolean, should unmapped reads be discarded?, defaults to
|
feature.type |
string, on which type of features should the function
work? Can be either |
verbose |
integer, control output: |
This function filters the features in a siamcat-class object in a unsupervised manner.
The different filter methods work in the following way:
'abundace'
- remove features whose maximum abundance is
never above the threshold value in any of the samples
'cum.abundance'
- remove features with very low abundance
in all samples, i.e. those that are never among the most abundant
entities that collectively make up (1-cutoff) of the reads in
any sample
'prevalence'
- remove features with low prevalence across
samples, i.e. those that are undetected (relative abundance of 0)
in more than 1 - cutoff
percent of samples.
'variance'
- remove features with low variance across
samples, i.e. those that have a variance lower than cutoff
'pass'
- pass-through filtering will not change the
features
Features can also be filtered repeatedly with different methods, e.g. first using the maximum abundance filtering and then using prevalence filtering. However, if a filtering method has already been applied to the dataset, SIAMCAT will default back on the original features for filtering.
siamcat an object of class siamcat-class
# Example dataset
data(siamcat_example)
# Simple examples
siamcat_filtered <- filter.features(siamcat_example,
filter.method='abundance',
cutoff=1e-03)
# 5% prevalence filtering
siamcat_filtered <- filter.features(siamcat_example,
filter.method='prevalence',
cutoff=0.05)
# filter first for abundance and then for prevalence
siamcat_filt <- filter.features(siamcat_example,
filter.method='abundance', cutoff=1e-03)
siamcat_filt <- filter.features(siamcat_filt, filter.method='prevalence',
cutoff=0.05, feature.type='filtered')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.