manhattanr {manhattanly} | R Documentation |
Creates a manhattanr object
Description
An object of class manhattanr includes all the needed information for
producing a manhattan plot. The goal is to seperate the pre-processing of the
manhattan plot elements from the graphical rendaring of the object, which
could be done using any graphical device including
plot_ly
and plot
in base
R
.
Usage
manhattanr(
x,
chr = "CHR",
bp = "BP",
p = "P",
snp,
gene,
annotation1,
annotation2,
logp = TRUE
)
Arguments
x |
A
|
chr |
A string denoting the column name for the chromosome. Default is
|
bp |
A string denoting the column name for the chromosomal position.
Default is |
p |
A string denoting the column name for the numeric quantity to be
plotted on the y-axis. Default is |
snp |
A string denoting the column name for the SNP names (e.g. rs
number). More generally, this column could be anything that identifies each
point being plotted. For example, in an Epigenomewide association study
(EWAS) this could be the probe name or cg number. This column should be a
|
gene |
A string denoting the column name for the GENE names. This column
could be a |
annotation1 |
A string denoting the column name for an annotation. This
column could be a |
annotation2 |
A string denoting the column name for an annotation. This
column could be a |
logp |
If TRUE, the -log10 of the p-value is plotted. It isn't very useful to plot raw p-values, but plotting the raw value could be useful for other genome-wide plots, for example, peak heights, bayes factors, test statistics, other "scores" etc. |
Value
A list
object of class manhattanr
with the following
elements
- data
processed data to be used for plotting
- xlabel
The label of the x-axis which is determined by the number of chromosomes present in the data
- ticks
the coordinates on the x-axis of where the tick marks should be placed
- labs
the labels for each tick. This defaults to the chromosome number but can be changed in the
manhattanly
function- nchr
the number of unique chromosomes present in the data
- pName, snpName, geneName, annotation1Name, annotation2Name
The names of the columns corresponding to the data provided. This information is used for annotating the plot in the
manhattanly
function
Source
The pre-processing is mostly the same as the
manhattan function from the
qqman
package
See Also
Examples
# HapMap dataset included in this package already has columns named P, CHR and BP
library(manhattanly)
DT <- manhattanr(HapMap)
class(DT)
head(DT[["data"]])
# include snp and gene information
DT2 <- manhattanr(HapMap, snp = "SNP", gene = "GENE")
head(DT2[["data"]])