Description Usage Arguments Value Examples
One of the main differences between RangedData and GRanges is the way of selecting the subset for a chromosome. RangedData just uses [n] where 'n' is the chromosome name or number. Whereas GRanges, does not have a method like this, so need to select using [chrm(X)==chr.num,] This wrapper allows selection of a chromosome or chromosomes regardless of whether the object is RangedData or GRanges type.
1 |
X |
A GRanges or RangedData object |
chr |
Vector, the chromosome(s) (number(s) or name(s)) to select |
index |
logical, if FALSE, will assume 'chr' is a string, indicating the chromosome name, if TRUE, if 'chr' is numeric, will assume it refers to the chromosome index, which if there are some chromosomes not represented, may be different to the name. E.g, an object with data for chromosomes 1,2,4,5 would select chromosome 5 with chr=4, if index=TRUE. |
returns an object of the same type as X, with only the chromosome subset specified.
1 2 3 4 5 | some.ranges <- rranges(100,chr.range=1:10)
chrSelect(some.ranges,6)
more.ranges <- rranges(10, chr.range=21:25)
chrSelect(more.ranges,1:22) # gives warning
select.autosomes(more.ranges)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.