makeGRanges: Wrapper to construct GRanges object from chr,pos or...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/humarray.R

Description

Slightly simplifies the creation of a GRanges object, allowing flexible input of chr, pos, or chr,start,end, and specification of rownames and the 'genome' parameter for specifying the build/coordinate type, e.g, hg18, build 37, etc. Designed for a simplified GRanges object without metadata, and where the 'strand' data is of no interest, so if strand/metadata is to be used, use the original GRanges() constructor.

Usage

1
2

Arguments

chr

character, an optional vector of chromosomes to combine with 'pos' or 'start'+'end' (enter in ...) to describe positions for the GRanges object

pos

integer/numeric, for SNPs, can enter positions just once in 'pos' instead of entering the same value for start and end

start

integer/numeric, specify the start position of ranges to encode in the new GRanges object, alongside 'end' (do not use 'pos' if using start+end)

end

integer/numeric, specify the end position of ranges to encode in the new GRanges object, alongside 'start' (do not use 'pos' if using start+end)

row.names

character, rownames for the output object, e.g, unique IDs describing the ranges

build

character, "hg18" or "hg19" (or 36/37) to show which reference to retrieve. The default when build is NULL is to use the build from the current ChipInfo annotation

...

further arguments to df.to.GRanges, such as 'fill.missing'

Value

Returns a GRanges object with the ranges, build and rownames specified. Rownames will be 1:nrow if the 'row.names' parameter is empty. The strand information will default to '+' for all entries, and the metadata will be empty (this function is only for creation of a very basic GRanges object).

Author(s)

Nicholas Cooper nick.cooper@cimr.cam.ac.uk

See Also

Chr, Pos, Pos.gene, Band, Band.gene, Band.pos, Gene.pos, zlink{df.to.GRanges}

Examples

1
2
3
4
g1 <- makeGRanges(chr=c(1,4,"X"),pos=c(132432,434342,232222))
g2 <- makeGRanges(chr=c(22,21,21),start=c(1,1,1),end=c(1000,10000,100000),
                                              row.names=c("1K","10K","100K"))
g1 ; g2

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