DNAcopy (version 1.46.0)

plotSample: Plot the data and results from segmentation for a single sample

Description

Plots the data for a single sample from a copy number array experiment (aCGH, ROMA etc.) along with the results of segmenting it into regions of equal copy numbers.

Usage

plotSample(x, sampleid=NULL, chromlist=NULL, xmaploc=FALSE, col=c("black","green"), pch=".", cex=NULL, altcol=TRUE, segcol="red", lwd=3, zeroline=TRUE, zlcol="grey", xlab=NULL, ylab=NULL, main=NULL, ...)

Arguments

x
an object of class DNAcopy resulting from analyzing data from copy number array experiments.
sampleid
the sample for which the plot is requested. Should be a valid sample name or number. If missing the first sample is plotted.
chromlist
a vector of chromosome numers or names to be plotted. If missing the whole genome is plotted.
xmaploc
a logical indicating if data are plotted against genomic position or Index. Defaults to FALSE.
col
a vector of two colors that can be used for alternating colors for successive chromosomes.
pch
the plotting character. Defaults to ..
cex
the size of plotting character. If missing it is set to 3 if pch is `.' and 1 otherwise.
altcol
a logical indicating if colors of successive chromosomes should be alternated. Defaults to TRUE.
segcol
color for segment means.
zeroline
a logical indicating if the zeroline is drawn. Defaults to TRUE.
zlcol
color for zero line.
lwd
thickness of the lines.
xlab
the x-axis lavel. If missing Index or Genomic Position will be used depending on xmaploc.
ylab
the y-axis label. If missing log(CN) or LOH will be used depending on data type.
main
the main title. If missing sample name will be used.
...
other arguments to the plot function can be passed here.

Details

This function plots the whole genome and segmentation results for a single sample. This function overcomes the deficiency in the plot.DNAcopy function which cycles through all the samples. If sampleid is not specified the first sample is plotted.

Examples

Run this code

#Read in two examples from Snijders et al.

data(coriell)

#Combine into one CNA object to prepare for analysis on Chromosomes 1-23

CNA.object <- CNA(cbind(coriell$Coriell.05296,coriell$Coriell.13330),
                  coriell$Chromosome,coriell$Position,
                  data.type="logratio",sampleid=c("c05296","c13330"))

#We generally recommend smoothing single point outliers before analysis
#Make sure to check that the smoothing is proper

smoothed.CNA.object <- smooth.CNA(CNA.object)

#Segmentation at default parameters

segment.smoothed.CNA.object <- segment(smoothed.CNA.object, verbose=1)

# Plot whole sample c13330

plotSample(segment.smoothed.CNA.object, sampleid="c13330")

# Plot only chromosomes 1,3,5,7,9 from first sample
plotSample(segment.smoothed.CNA.object, sampleid=1, chromlist=c(1,3,5,7,9))

Run the code above in your browser using DataCamp Workspace