filter: Filter 'AnyHermesData' on Subset Passing Default QC Flags

filterR Documentation

Filter AnyHermesData on Subset Passing Default QC Flags

Description

[Stable]

This filters a AnyHermesData object using the default QC flags and required annotations.

Usage

filter(object, ...)

## S4 method for signature 'AnyHermesData'
filter(object, what = c("genes", "samples"), annotation_required = "size")

## S4 method for signature 'data.frame'
filter(object, ...)

## S4 method for signature 'ts'
filter(object, ...)

Arguments

object

(AnyHermesData)
object to filter.

...

additional arguments.

what

(character)
specify whether to apply the filter on genes and / or samples.

annotation_required

(character)
names of required annotation columns for genes. Only used when genes are filtered.

Details

  • 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.

Value

The filtered AnyHermesData object.

Note

The internal implementation cannot use the subset() method since that requires non-standard evaluation of arguments.

Examples

a <- hermes_data
dim(a)

# Filter genes and samples on default QC flags.
result <- filter(a)
dim(result)

# 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"))

insightsengineering/hermes documentation built on Sept. 19, 2024, 9:06 p.m.