set.chr.to.char: Change the chromosome labels in a RangedData or GRanges...

Description Usage Arguments Value See Also Examples

View source: R/humarray.R

Description

Change the chromosome labels in a RangedData or GRanges object to string codes

Usage

1
set.chr.to.char(ranged, do.x.y = T, keep = T)

Arguments

ranged

A GRanges or RangedData object

do.x.y

logical, if TRUE then the usual numbers allocated to chromosomes, X,Y,XY, MT will be allocated as 23,24,25,26 respectively. If false, these will just have 'chr' appended as a prefix

keep

logical, whether to keep additional metadata columns in the new object

Value

returns the 'ranged' object, but wherever a chromosome number was previously, a character label, e.g, 'chr1', or 'X', will returned to replace the number, e.g, 1 or 23 respectively. If table.out is TRUE will return a list where the first element is the resulting object, and the second element is a table showing which numbers were converted to what label This table can then be used for future conversions via the parameter 'table.in' to ensure consistency of coding.

See Also

set.chr.to.numeric

Examples

1
2
3
4
5
6
7
x <- rranges()
x
x <- set.chr.to.numeric(x) # make entirely numeric
x <- rranges(chr.range=20:26)
# next two will give warning about X, Y, etc
set.chr.to.char(x) # 23 = chrX, etc
set.chr.to.char(x,do.x.y=FALSE) # 23=chr23, etc

humarray documentation built on Nov. 20, 2017, 1:05 a.m.