xGRtrack | R Documentation

## Function to visualise genes within a genomic region using track plot

### Description

`xGRtrack` is supposed to visualise genes within a genomic region using track plot. Genes in query within a genomic region are displayed on the gene model track along with nearby genes of desired window or number. If scores for genomic region are also provided, the genomic score track will be also displayed at the top.

### Usage

    xGRtrack(cse.query = NULL, gene.query = NULL, window = 1e+05,
    nearby = NULL, name.scoretrack = "Genomic scores",
    gene.model = c("UCSC_knownGene_model", "UCSC_knownCanonical_model"),
    GR.score = c(NA, "RecombinationRate", "phastCons100way",
    "phyloP100way"),
    GR.score.customised = NULL, name.customised = "Customised",
    verbose = TRUE, RData.location =
    "http://galahad.well.ox.ac.uk/bigdata")

### Arguments

`cse.query` | a genomic region in query. By default it is NULL; otherwise provided as 'chrN:start-end', where N is either 1-22 or X, start (or end) is genomic positional number; for example, 'chr1:13-20'. If provided, it will overwrite the parameter 'gene.query' below
`gene.query` | which gene in query will be visualised. By default it is NULL
`window` | the maximum distance defining nearby genes around the gene in query. By default it is 1e5
`nearby` | the maximum number defining nearby genes around the gene in query. By default it is NULL. If not NULL, it will overwrite the parameter 'window' above
`name.scoretrack` | the name for the score track. By default, it is "Genomic scores"
`gene.model` | the genomic regions of the gene model. By default, it is 'UCSC_knownGene_model', that is, UCSC known genes (together with genomic locations) based on human genome assembly hg19. It can be 'UCSC_knownCanonical_model', that is, UCSC known canonical genes (together with genomic locations) based on human genome assembly hg19. Alternatively, the user can specify the customised input. To do so, first save your RData file (containing an GR object) into your local computer, and make sure the GR object content names refer to Gene Symbols. Then, tell "GR.Gene" with your RData file name (with or without extension), plus specify your file RData path in "RData.location"
`GR.score` | the genomic regions together with score data. By default, it is 'NA' to disable this option. Pre-built genomic score data: 'RecombinationRate' (recombintion rate, http://www.ncbi.nlm.nih.gov/pubmed/17943122)), 'phastCons100way', 'phyloP100way'.
`GR.score.customised` | the customised genomic score data. By default, it is NA to disable this option; otherwise load your customised GR object directly (with the first meta column for scores; if not provided, it will be valued at 1). If provided, it will be appended to 'GR.score' above
`name.customised` | the name for customised genomic score data. By default, it is "Customised"
`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

### Value

a Tracks object.

### Note

none

### See Also

`xGRoverlap`

### Examples

    ## Not run:
    # Load the library
    library(XGR)

    ## End(Not run)

    RData.location <- "http://galahad.well.ox.ac.uk/bigdata_dev"
    ## Not run:
    ## given a query gene
    tks <- xGRtrack(gene.query='TNF', nearby=10,
    gene.model="UCSC_knownGene_model",
    GR.score=c("RecombinationRate","phastCons100way"),
    RData.location=RData.location)
    tks
    ## given a query genomic region
    tks <- xGRtrack(cse.query='chr6:31497996-31584798',
    gene.model="UCSC_knownGene_model",
    GR.score=c("RecombinationRate","phastCons100way"),
    RData.location=RData.location)

    ## also use customised GR.score
    ### RecombinationRate
    GR.score.customised <- xRDataLoader("RecombinationRate",
    RData.location=RData.location)
    tks <- xGRtrack(gene.query='TNF', nearby=10,
    gene.model="UCSC_knownGene_model", GR.score="RecombinationRate",
    GR.score.customised=GR.score.customised, RData.location=RData.location)
    tks

    ### GWAS catalog
    GWAScatalog <- xRDataLoader('GWAScatalog',
    RData.location=RData.location)
    gwas <- xGR(GWAScatalog$cse_hg19, format="chr:start-end")
    ind <- match(names(gwas), GWAScatalog$cse_hg19)
    gwas$pvalue <- -log10(GWAScatalog$pvalue[ind])
    tks <- xGRtrack(gene.query='TNF', nearby=10,
    gene.model="UCSC_knownGene_model", GR.score="RecombinationRate",
    GR.score.customised=gwas, RData.location=RData.location)
    tks

    ## End(Not run)