xPierManhattan | R Documentation

## Function to visualise prioritised genes using manhattan plot

### Description

`xPierManhattan` is supposed to visualise prioritised genes using manhattan plot. Genes with the top priority are highlighed. It returns an object of class "ggplot".

### Usage

    xPierManhattan(pNode, color = c("darkred", "darkgreen"), top = 50,
    top.label.type = c("box", "text"), top.label.size = 2,
    top.label.col = "darkblue", top.label.query = NULL,
    label.query.only = FALSE, chromosome.only = TRUE, y.scale = c("normal",
    "sqrt", "log"), y.lab = NULL, GR.Gene = c("UCSC_knownGene",
    "UCSC_knownCanonical"), font.family = "sans", signature = TRUE,
    verbose = TRUE, RData.location =
    "http://galahad.well.ox.ac.uk/bigdata",
    ...)

### Arguments

`pNode` | an object of class "pNode" (or "sTarget" or "dTarget")
`color` | a character vector for colors to alternate chromosome colorings. If NULL, ggplot2 default colors will be used. If a single character is provided, it can be "jet" (jet colormap) or "rainbow" (rainbow colormap, that is, red-yellow-green-cyan-blue-magenta)
`top` | the number of the top targets to be labelled/highlighted
`top.label.type` | how to label the top targets. It can be "box" drawing a box around the labels , and "text" for the text only
`top.label.size` | the highlight label size
`top.label.col` | the highlight label color
`top.label.query` | which top genes in query will be labelled. By default, it sets to NULL meaning all top genes will be displayed. If labels in query can not be found, then all will be displayed
`label.query.only` | logical to indicate whether only genes in query will be displayed. By default, it sets to FALSE. It only works when labels in query are enabled/found
`chromosome.only` | logical to indicate whether only genes from input data will be displayed. By default, it sets to TRUE
`y.scale` | how to transform the y scale. It can be "normal" for no transformation, "sqrt" for square root transformation, and "log" for log-based transformation
`y.lab` | the y labelling. If NULL (by default), it shows the column of input data
`GR.Gene` | the genomic regions of genes. By default, it is 'UCSC_knownGene', that is, UCSC known genes (together with genomic locations) based on human genome assembly hg19. It can be 'UCSC_knownCanonical', 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"
`font.family` | the font family for texts
`signature` | logical to indicate whether the signature is assigned to the plot caption. By default, it sets TRUE
`verbose` | logical to indicate whether the messages will be displayed in the screen. By default, it sets to false for no display
`RData.location` | the characters to tell the location of built-in RData files. See `xRDataLoader` for details
`...` | additional paramters associated with ggrepel::geom_text_repel

### Value

an object of class "ggplot", appended by an GR object called 'gr'

### Note

none

### See Also

`xRDataLoader`, `xPier`, `xPierSNPs`, `xPierGenes`, `xPierPathways`

### Examples

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

    ## End(Not run)

    RData.location <- "http://galahad.well.ox.ac.uk/bigdata_dev"
    ## Not run:
    # a) provide the SNPs with the significance info
    ## get lead SNPs reported in AS GWAS and their significance info (p-values)
    #data.file <- "http://galahad.well.ox.ac.uk/bigdata/AS.txt"
    #AS <- read.delim(data.file, header=TRUE, stringsAsFactors=FALSE)
    ImmunoBase <- xRDataLoader(RData.customised='ImmunoBase',
    RData.location=RData.location)
    gr <- ImmunoBase$AS$variants
    AS <- as.data.frame(GenomicRanges::mcols(gr)[, c('Variant','Pvalue')])

    # b) perform priority analysis
    pNode <- xPierSNPs(data=AS, include.eQTL="JKng_mono",
    include.HiC='Monocytes', network="PCommonsUN_medium", restart=0.7,
    RData.location=RData.location)

    # c) manhattan plot
    ## default plot
    mp <- xPierManhattan(pNode, RData.location=RData.location)
    #pdf(file="Gene_manhattan.pdf", height=6, width=12, compress=TRUE)
    print(mp)
    #dev.off()
    mp$gr
    ## control visuals
    mp <- xPierManhattan(pNode, color='ggplot2', top=50,
    top.label.col="black", y.scale="sqrt", RData.location=RData.location)
    mp
    ## control labels
    # only IL genes will be labelled
    ind <- grep('^IL', rownames(pNode$priority))
    top.label.query <- rownames(pNode$priority)[ind]
    mp <- xPierManhattan(pNode, top.label.query=top.label.query,
    RData.location=RData.location)
    mp
    # only IL genes will be displayed
    mp <- xPierManhattan(pNode, top.label.query=top.label.query,
    label.query.only=TRUE, RData.location=RData.location)
    mp

    ## End(Not run)