sorteach: Internally sort each element of a GenomicRangesList

View source: R/eachfunctions.R

sorteachR Documentation

Internally sort each element of a GenomicRangesList

Description

Internally sort each element of a GenomicRangesList

Usage

sorteach(x, ...)

Arguments

x

GRangesList object

...

Comma separated list of unquoted variable names to sort by. Variables are names of metadata columns found in GRangesList object. Use desc() to sort a variable in descending order. Input can be 'exonorder' to sort each element in exon order

Value

Sorted GRangesList object

Author(s)

Fursham Hamid

Examples

# Load dataset
data(query_exons)

# sort elements in each GRangesList in descending coordinate order
query_exons_desc <- sorteach(query_exons, dplyr::desc(start))

# sort elements in each GRangesList in its order in transcript
query_exons_exonorder <- sorteach(query_exons_desc, exonorder)

# test similarity of query_exons and query_exons_exonorder
identical(query_exons, query_exons_exonorder)

fursham-h/factR documentation built on Aug. 20, 2023, 1:58 p.m.