R: Plot the data and results from segmentation for a single...
plotSample
R Documentation
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.
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
#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))
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(DNAcopy)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/DNAcopy/plotSample.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plotSample
> ### Title: Plot the data and results from segmentation for a single sample
> ### Aliases: plotSample
> ### Keywords: nonparametric
>
> ### ** Examples
>
>
> #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"))
Warning message:
In CNA(cbind(coriell$Coriell.05296, coriell$Coriell.13330), coriell$Chromosome, :
array has repeated maploc positions
>
> #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)
Analyzing: c05296
Analyzing: c13330
>
> # 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))
>
>
>
>
>
>
> dev.off()
null device
1
>