AnyHermesData
on Subset Passing Default QC FlagsR/HermesData-methods.R
, R/dplyr_compatibility.R
filter.Rd
This filters a AnyHermesData
object using the default QC flags and required annotations.
filter(object, ...)
# S4 method for AnyHermesData
filter(object, what = c("genes", "samples"), annotation_required = "size")
# S4 method for data.frame
filter(object, ...)
# S4 method for ts
filter(object, ...)
(AnyHermesData
)
object to filter.
additional arguments.
(character
)
specify whether to apply the filter on genes
and / or samples
.
(character
)
names of required annotation
columns for genes. Only
used when genes
are filtered.
The filtered AnyHermesData
object.
Only genes without low expression (low_expression_flag
) and samples
without low depth (low_depth_flag
) or technical failure (tech_failure_flag
)
remain in the returned filtered object.
Also required gene annotation columns can be specified, so that genes which are not complete
for these columns are filtered out. By default this is the size
column, which is needed
for default normalization of the object.
The internal implementation cannot use the subset()
method since that
requires non-standard evaluation of arguments.
a <- hermes_data
dim(a)
#> [1] 5085 20
# Filter genes and samples on default QC flags.
result <- filter(a)
dim(result)
#> [1] 2064 18
# Filter only genes without low expression.
result <- filter(a, what = "genes")
# Filter only samples with low depth and technical failure.
result <- filter(a, what = "samples")
# Filter only genes, and require certain annotations to be present.
result <- filter(a, what = "genes", annotation_required = c("size"))