xGR {Pi} | R Documentation

## Function to create a GRanges object given a list of genomic regions

### Description

`xGR` is supposed to create a GRanges object given a list of genomic regions.

### Usage

    xGR(
    data,
    format = c("chr:start-end", "data.frame", "bed", "GRanges"),
    build.conversion = c(NA, "hg38.to.hg19", "hg18.to.hg19"),
    add.name = TRUE,
    remove.mcol = FALSE,
    include.strand = FALSE,
    verbose = TRUE,
    RData.location = "http://galahad.well.ox.ac.uk/bigdata",
    guid = NULL
    )

### Arguments

`data` | input genomic regions (GR). If formatted as "chr:start-end" (see the next parameter 'format' below), GR should be provided as a vector in the format of 'chrN:start-end', where N is either 1-22 or X, start (or end) is genomic positional number; for example, 'chr1:13-20'. If formatted as a 'data.frame', the first three columns correspond to the chromosome (1st column), the starting chromosome position (2nd column), and the ending chromosome position (3rd column). If the format is indicated as 'bed' (browser extensible data), the same as 'data.frame' format but the position is 0-based offset from chromomose position. If the genomic regions provided are not ranged but only the single position, the ending chromosome position (3rd column) is allowed not to be provided. The data could also be an object of 'GRanges' (in this case, formatted as 'GRanges')
`format` | the format of the input data. It can be one of "chr:start-end", "data.frame", "bed" or "GRanges"
`build.conversion` | the conversion from one genome build to another. The conversions supported are "hg38.to.hg19" and "hg18.to.hg19". By default it is NA (no need to do so)
`add.name` | logical to add names. By default, it sets to true
`remove.mcol` | logical to remove meta-columns. By default, it sets to false
`include.strand` | logical to include strand. By default, it sets to false. It only works when the format is "data.frame" or "bed" and the input data has 4 columns
`verbose` | logical to indicate whether the messages will be displayed in the screen. By default, it sets to true for display
`RData.location` | the characters to tell the location of built-in RData files. See `xRDataLoader` for details
`guid` | a valid (5-character) Global Unique IDentifier for an OSF project. See `xRDataLoader` for details

### Value

a GenomicRanges object

### See Also

`xLiftOver`

### Examples

    RData.location <- "http://galahad.well.ox.ac.uk/bigdata"
    ## Not run:
    # a) provide the genomic regions
    ## load ImmunoBase
    ImmunoBase <- xRDataLoader(RData.customised='ImmunoBase',
    RData.location=RData.location)
    ## get lead SNPs reported in AS GWAS and their significance info (p-values)
    gr <- ImmunoBase$AS$variant
    df <- as.data.frame(gr, row.names=NULL)
    chr <- df$seqnames
    start <- df$start
    end <- df$end
    data <- paste(chr,':',start,'-',end, sep='')

    # b) create a GRanges object
    GR <- xGR(data=data, format="chr:start-end",
    RData.location=RData.location)

    ## End(Not run)

[Package Pi version 2.2.1 Index]