Description Usage Arguments Value Source See Also Examples
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
.
1 2 3 4 5 6 7 8 9 10 11 | manhattanr(
x,
chr = "CHR",
bp = "BP",
p = "P",
snp,
gene,
annotation1,
annotation2,
logp = TRUE
)
|
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. |
A list
object of class manhattanr
with the following
elements
processed data to be used for plotting
The label of the x-axis which is determined by the number of chromosomes present in the data
the coordinates on the x-axis of where the tick marks should be placed
the labels for each
tick. This defaults to the chromosome number but can be changed in the
manhattanly
function
the number of unique chromosomes present in the data
The names of the columns corresponding to
the data provided. This information is used for annotating the plot in the
manhattanly
function
The pre-processing is mostly the same as the
manhattan function from the
qqman
package
1 2 3 4 5 6 7 8 9 | # 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"]])
|
See example usage at http://sahirbhatnagar.com/manhattanly/
[1] "manhattanr"
CHR BP P logp pos index
1 1 937641 0.3353438 0.47450973 937641 1
2 1 1136887 0.2458571 0.60931719 1136887 1
3 1 2116240 0.8232859 0.08444933 2116240 1
4 1 2310562 0.4932038 0.30697357 2310562 1
5 1 2681715 0.6053916 0.21796358 2681715 1
6 1 2917484 0.1944431 0.71120743 2917484 1
CHR BP P SNP GENE logp pos index
1 1 937641 0.3353438 rs9697358 ISG15 0.47450973 937641 1
2 1 1136887 0.2458571 rs34945898 TNFRSF4 0.60931719 1136887 1
3 1 2116240 0.8232859 rs12034613 FP7162 0.08444933 2116240 1
4 1 2310562 0.4932038 rs4648633 MORN1 0.30697357 2310562 1
5 1 2681715 0.6053916 rs4430271 MMEL1 0.21796358 2681715 1
6 1 2917484 0.1944431 rs6685625 ACTRT2 0.71120743 2917484 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.