genome.plot: Genome-wide Plot of a Variable

View source: R/genome.plot.R

genome.plotR Documentation

Genome-wide Plot of a Variable

Description

genome.plot plots the value of a variable across the genome.

Usage

genome.plot(
  mydata,
  style = 1,
  type = "h",
  sig.line = c(4, -4),
  sig.color = c("red", "red"),
  ...
)

Arguments

mydata

a data frame containing three variables: y (numeric, the value of the variable to be plotted), chr (character, chromosome label), and pos (numeric, position, for instance, in base pair or centi-Morgan). Examples of y include -log10 of p-values and test statistic values.

style

either 1 (default) or 2.

type

a generic graphic parameter. Recommended values are "h" (default) and "b".

sig.line

vertical locations of significance lines.

sig.color

colors of significance lines.

...

other parameters to be passed to function xyplot in the lattice package.

Details

This function makes use of the function xyplot from package lattice.

Author(s)

Kai Wang <kai-wang@uiowa.edu>

Examples

  y = rnorm(100)
  chr = c(rep(1, 20), rep(3, 20), rep(10, 20), rep(19, 30), rep("X", 10))
  pos = c(1:20, 1:20, 1:20, 1:30, 1:10)
  mydata = data.frame(y=y, chr=chr, pos=pos)
  mydata2 = data.frame(y=y^2, chr=chr, pos=pos)
  
  genome.plot(mydata, sig.line=c(1, -1), ylab="T Statistic")
  genome.plot(mydata, sig.line=c(1, -1), ylab="T Statistic", type="b")
  genome.plot(mydata2, sig.line=c(2), ylab="y squared")
  genome.plot(mydata, style=2, sig.line=c(1, -1), ylab="T Statistic")
  genome.plot(mydata, style=2, sig.line=c(1, -1), ylab="T Statistic", type="b")


iGasso documentation built on Aug. 8, 2023, 5:11 p.m.