Learn R Programming

genoset (version 1.28.2)

toGenomeOrder: Set a GRanges or GenoSet to genome order

Description

Returns a re-ordered object sorted by chromosome and start position. If strict=TRUE, then chromosomes must be in order specified by chrOrder. If ds is already ordered, no re-ordering is done. Therefore, checking order with isGenomeOrder, is unnecessary if order will be corrected if isGenomeOrder is FALSE.

Usage

toGenomeOrder(ds, strict = TRUE)

Arguments

ds
GenoSet or GRanges
strict
logical, should chromosomes be in order specified by chrOrder?

Value

  • re-ordered ds

Details

toGenomeOrder for GRanges differs from sort in that it orders by chromsome and start position only, rather than chromsome, strand, start, and width.

See Also

Other "genome ordering": chrOrder, isGenomeOrder

Examples

Run this code
data(genoset,package="genoset")
  toGenomeOrder( genoset.ds, strict=TRUE )
  toGenomeOrder( genoset.ds, strict=FALSE )
  toGenomeOrder( rowRanges(genoset.ds) )

Run the code above in your browser using DataLab