Learn R Programming

cancerTiming (version 3.1.8)

plotSegmentation: plot segmentation(s) against positions

Description

Plot the values of a segmentation against chromosome position.

Usage

plotSegmentation(segs, valId, col = palette(),lty=1, lwd = 2, xlim, ylim, xlab="Position", ylab = valId,...)

Arguments

segs
list of segmentation data.frames. Each data.frame must have `start' and `end' as the column names of the limits of the segmentations.
valId
name of the column with the segmentation value to be plotted (must be the same in all data.frames)

col
colors for the segmentation (1 per element of the list of segmentations)

lty
lty for the lines
lwd
lwd for the lines

xlim
x limits

ylim
y limits

xlab
The label for the x-axis
ylab
The label for the y-axis
...
passed to initial plotting command

Value

returns invisibly the col and lty after any processing done, useful for legends.

Examples

Run this code
data(mutData)
segData<-data.frame(chromosome="17",start=c(0,1.8e7+1),
	end=c(1.8e7,max(mutData$position)),val=c(2,3))
cp1<-data.frame(chromosome="17",start=c(0,1.8e7+1),
	end=c(1.8e7,max(mutData$position)),val=c(1,1))
cp2<-data.frame(chromosome="17",start=c(0,1.8e7+1),
	end=c(1.8e7,max(mutData$position)),val=c(.9,2))
out<-plotSegmentation(list(total=segData,cp1=cp1,cp2=cp2),
	valId="val",lwd=2,ylab="Segmentation Value")
legend("topright",names(out),fill=out)

Run the code above in your browser using DataLab