sortGRL: Sort GRangesList elements by chromosome and position

sortGRLR Documentation

Sort GRangesList elements by chromosome and position

Description

Sort GRangesList elements by chromosome and position

Usage

sortGRL(
  GRL,
  splitColname = "splitColname",
  keep_order = TRUE,
  verbose = FALSE,
  ...
)

Arguments

GRL

GRangesList to be sorted.

splitColname

intermediate colname used to split values from GRanges to GRangesList. It only needs to be defined if for some reason the default "splitColname" is already in colnames(GenomicRanges::values(GRL)).

keep_order

logical indicating whether to maintain the input order of GRanges; FALSE will return GRangesList ordered by the first sorted GRanges occurrence.

...

additional arguments are ignored.

Details

This function sorts GRangesList elements by chromosome and position, using the default sort routine for GRanges objects. It accomplishes the task by sorting the GRanges elements, then splitting that GRanges into a GRangesList based upon the original names(GrangesList).

Value

GRangesList sorted by chromosome and position.

See Also

Other jam GRanges functions: addGRLgaps(), addGRgaps(), annotateGRLfromGRL(), annotateGRfromGR(), assignGRLexonNames(), closestExonToJunctions(), combineGRcoverage(), exoncov2polygon(), findOverlapsGRL(), flattenExonsBy(), getFirstStrandedFromGRL(), getGRLgaps(), getGRcoverageFromBw(), getGRgaps(), grl2df(), jam_isDisjoint(), make_ref2compressed(), spliceGR2junctionDF(), stackJunctions()

Examples

gr12 <- GenomicRanges::GRanges(
   seqnames=rep(c("chr1", "chr2", "chr1"), c(3,3,3)),
   ranges=IRanges::IRanges(
      start=c(100, 200, 400, 500, 300, 100, 200, 400, 600),
      width=c(50,50,50, 50,50,50, 50,50,50)
   ),
   strand=rep(c("+", "-", "+"), c(3,3,3)),
   gene_name=rep(c("GeneA", "GeneB", "GeneC"), each=3)
)
grl <- GenomicRanges::split(gr12, GenomicRanges::values(gr12)$gene_name);
grl;
GenomicRanges::sort(grl);
sortGRL(grl);
sortGRL(grl, keep_order=FALSE);


jmw86069/splicejam documentation built on Nov. 4, 2024, 10:53 a.m.