plotGW: Plot genome-wide data along the genome

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/linFit.R

Description

Plot different measurements across the genome such as copy number amplifications and deletions.

Usage

1
plotGW(data, pos, marks=NULL, fileType='png', file='plotGW', width=1000, height=500,  autoscale=FALSE, col=c('lightblue', 'lightgreen', 'darkblue', 'darkgreen'), legend=1:10, ylab='', pch=19, cex.axis=1.2 ,cex.lab=1.2, cex=.5, legend.pos='bottomright', mtext=NULL, mtext.side=2, mtext.at=NULL, mtext.line=3, ...)

Arguments

data

data matrix to plot, each column is plotted individually across the genome

pos

the chromosome locations for the data, can be a matrix or data frame with a column named chromosome_name, or a numeric vector

marks

if there is specific marks to plot on the baselne, eg. to indicate where are the SNPs, should be a vector of numbers indicating where the marks is relative to the input data matrix

fileType

either png or pdf file type

file

file name

width

width of the plot

height

height of the plot

autoscale

should the columns of data be scaled?

col

colors for each of the data columns to be plotted, should be no shorter than the number of columns in 'data'

legend

legend text in the legend box

ylab

parameter for par, default to ”

pch

parameter for par, default to 19

cex.axis

parameter for par, default to 1.2

cex.lab

parameter for par, default to 1.2

cex

parameter for par, default to 0.5

legend.pos

parameter for legend, default to 'bottomright'

mtext

parameter for mtext, default to NULL

mtext.side

parameter for mtext, default to 2

mtext.at

parameter for mtext, default to 2

mtext.line

parameter for mtext, default to 3

...

Other parameters to pass to plot() or legend()

Details

This function requires as input data a vector or a matrix with different variables in columns, and a position matrix of chromosome name and start position. The number of rows in the position matrix should be the same as the length of the data vector or the number of rows of the data matrix. The function plots the data according to the position across the genome, providing a genome-wide description.

Value

Write an image file to disk, either in png or pdf format.

Author(s)

Yinyin Yuan

See Also

lasso.cv

Examples

1
2
3
4
data(chin07)
gain <- rowSums(chin07$cn >= .2)
loss <- -rowSums(chin07$cn <= -.2)
plotGW(data=cbind(gain, loss), pos=attr(chin07$cn, 'chrome'), legend=c('gain', 'loss'))

lol documentation built on Oct. 31, 2019, 2:21 a.m.