View source: R/labelManhattan.R
labelManhattan | R Documentation |
Annotate Manhattan or Miami Plot
labelManhattan(
chr,
pos,
name,
gwas,
gwasChrLab = "chr",
gwasPosLab = "pos",
gwasPLab = "p",
gwasZLab = "NULL",
chrmaxpos,
textPos = 4,
angle = 0,
miamiBottom = FALSE
)
chr |
A vector of chromosomes for the markers to be labelled. |
pos |
A vector of positions on the chromosome for the markers to be labelled. These must correspond to markers in the GWAS dataset used to make the manhattan plot. |
name |
A vector of labels to be added next to the points specified by chr and pos. |
gwas |
The same GWAS dataset used to plot the existing Manhattan or Miami plot to be annotated. |
gwasChrLab |
The name of the column in gwas containing chromosome number. Defaults to ‘"chr"’. |
gwasPosLab |
The name of the column in gwas containing position. Defaults to ‘"pos"’. |
gwasPLab |
The name of the column in gwas containing p-values. Defaults to ‘"p"’. |
gwasZLab |
The name of the column in gwas containing z-values. Defaults to ‘"NULL"’. |
chrmaxpos |
Data frame containing x coordinates for chromosome start positions, generated by |
textPos |
An integer or vector dictating where the label should be plotted relative to each point. Good for avoiding overlapping labels. Provide an integer to plot all points in the same relative position or use a vector to specify position for each label. Passed to the pos option of |
angle |
An integer or vector dictating the plot angle of the label for each point. rovide an integer to plot all points in the same relative position or use a vector to specify position for each label.Passed to the srt option of |
miamiBottom |
If ‘TRUE’, labels will be plotted on the lower region of a Miami plot. If ‘FALSE’, labels will be plotted on the upper region. Defaults to ‘FALSE’. |
Add labels beside specified points on a Manhattan or Miami plot. Ideal for adding locus names to peaks. Currently only designed to work with miamiplot2
.
Adds annotation to existing Manhattan or Miami plot
Extended to handle extreme P values.
Jonathan Marten
## Not run:
labelManhattan(c(4,5,11,19),c(9994215,16717922,45538760,51699256),
c("GENE1","GENE2","GENE3","GENE4"),
gwas1,chrmaxpos=chrmaxpos)
labelManhattan(geneLabels$chr,geneLabel$pos,geneLabel$geneName,gwas1,chrmaxpos=chrmaxpos)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.