manhattan {ramwas} | R Documentation

## Fast Manhattan plot for Large Number of P-values

### Description

The function `manPlotFast` creates a Manhattan plot.
The function `manPlotPrepare` extracts necessary information from a vector of p-values sufficient for creating a Manhattan plot.
It optimized to work quickly even for tens of millions of p-values.

### Usage

    manPlotPrepare(
            pvalues,
            chr,
            pos,
            ismlog10 = FALSE,
            chrmargins = 5e6)

    manPlotFast(
            man,
            ylim = NULL,
            colorSet = c('steelblue4',"#2C82D1","#4CB2D1"),
            yaxmax = NULL,
            lwd = 3,
            axistep = 2,
            cex = 1)

### Arguments

`pvalues` | Vector of p-values. As is (if `ismlog10 = FALSE`) or minus log10 transformed (if `ismlog10 = TRUE`).
`chr, pos` | Vectors indicating the chromosomes and genomic positions (in basepairs) for each p-value in `pvalues`.
`ismlog10` | Specifies whether the provides p-values (`pvalues` parameter) are minus log10 transformed (`- log10(pv)`)
`chrmargins` | The plot margins at the ends of chromosomes (in basepairs).
`man` | Object returned by `manPlotPrepare`.
`ylim` | Numeric vectors of length 2, giving the y coordinate range. Exactly as in Plotting Parameters.
`colorSet` | Colors of points, rotating over chromosomes. Points for first chromosome have color `colorSet[1]`, next `colorSet[2]`, etc. Once the colors are exhausted, the colors are reused from the beginning.
`yaxmax` | Maximum reach of the y axis.
`lwd` | The line width. As in Graphics Parameters.
`axistep` | Distance between axis label ticks for y axis.
`cex` | The size of Manhattan plot points. As in Graphics Parameters.

### Details

The function `manPlotFast` creates Manhattan plot.
It requires the use of the function `manPlotPrepare` which extracts the necessary information from a vector of p-values sufficient for creating Manhattan plot.
The resulting object is many times smaller than the vector of p-values.

### Value

This function `manPlotPrepare` returns an object with information for creating Manhattan plot.

### Note

The plot has no title. To add a title use `title`.

### Author(s)

Andrey A Shabalin andrey.shabalin@gmail.com

### See Also

See vignettes: `browseVignettes("ramwas")`.

### Examples

    # Simulate data (9 chromosomes, million tests each)
    chr = rep(paste0('chr',1:9), each = 1e6)
    pos = rep(1:1e6, 9)
    pv = runif(9e6)^1.1

    # Extract the Manhattan plot info
    man = manPlotPrepare(pv, chr, pos, chrmargins = 1000)

    # Create Manhattan plot
    manPlotFast(man)
    title("Manhattan plot")

    # Size of p-values before extraction of Manhattan plot info
    object.size(list(pv, chr, pos))

    # Size of the Manhattan plot info object
    object.size(man)

[Package ramwas version 1.4.0 Index]