dropUnusedFeatures: Drop unused features

Description Usage Arguments Details Value Author(s) Examples

Description

Drop unused features in an IndexedRelations object.

Usage

1

Arguments

x

An IndexedRelations object.

Details

dropUnusedFeatures will remove features in each element of featureSets(x) that are not referred to by any partner in any relationship. All partner indices are remapped to the appropriate locations in the subsetted feature sets. The only features that remain will have at least one index pointing to it in partners(x).

This function can reduce the size of an IndexedRelations object, e.g., during serialization to file. However, it is usually unnecessary to run these during the course of an analysis. R operates on a copy-on-modify principle, so the same feature set(s) across multiple IndexedRelations objects do not occupy additional memory. Dropping unused features requires construction of instance-specific feature sets that may increase memory usage.

Value

An IndexedRelations object where any unused features have been removed.

Author(s)

Aaron Lun

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(GenomicRanges)
promoters <- GRanges("chrA", IRanges(1:10*20, 1:10*20+10))
enhancers <- GRanges("chrA", IRanges(1:20*10, 1:20*10+10))

rel <- IndexedRelations(list(1:2, 1:2), list(promoters, enhancers))
lengths(featureSets(rel))

# Only the first two entries of each feature set are retained.
dropped <- dropUnusedFeatures(rel)
lengths(featureSets(dropped))

LTLA/IndexedRelations documentation built on June 2, 2019, 10:03 p.m.