[BioC] DNAcopy plot just one sample

Martin Morgan mtmorgan at fhcrc.org
Fri Aug 10 18:36:40 CEST 2007


Hi Daniel -- I'm not really familiar with DNAcopy, but

> library(help=DNAcopy)

		Information on package 'DNAcopy'

[...]
subset.CNA              Subset a 'Copy Number Array' data object
subset.DNAcopy          Subset a DNAcopy data object
[...]

seems to point in the right direction, and (from example(plot.DNAcopy))

>     #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 


gets me a 'DNAcopy' object.

> subset(segment.smoothed.CNA.object, 1)
       ID chrom loc.start loc.end num.mark seg.mean
1  c05296     1       468  240000      132   0.0212
32 c13330     1         0   40326       31   0.0834
33 c13330     1     46617  156276       51  -0.0217
34 c13330     1    156678  240000       47   0.5179

seems to get me chromosome 1, ready for plotting with

> plot(subset(segment.smoothed.CNA.object, 1, 1), type="c")

The 'DNAcopy' object is an 'S3' object whose struture can be
interogated with

> str(segment.smoothed.CNA.object)
List of 3
 $ data  :Classes 'CNA' and 'data.frame':	2271 obs. of  4 variables:
  ..$ chrom :Class 'AsIs'  int [1:2271] 1 1 1 1 1 1 1 1 1 1 ...
  ..$ maploc: int [1:2271] 0 468 2241 4504 5440 7000 9046 10000 12618 13000 ...
  ..$ c05296: num [1:2271]       NA  0.00882 -0.00089  0.07587  0.01730 ...
  ..$ c13330: num [1:2271]  0.2075  0.0631  0.1239  0.1543 -0.0439 ...
  ..- attr(*, "data.type")= chr "logratio"
 $ output:'data.frame':	77 obs. of  6 variables:
  ..$ ID       : chr [1:77] "c05296" "c05296" "c05296" "c05296" ...
  ..$ chrom    : int [1:77] 1 2 3 4 4 4 5 6 7 8 ...
  ..$ loc.start: int [1:77] 468 0 0 0 172856 179200 0 0 0 0 ...
  ..$ loc.end  : int [1:77] 240000 245000 218000 171809 179118 184000 198500 188000 161500 147000 ...
  ..$ num.mark : num [1:77] 132 64 86 143 9 13 108 85 172 151 ...
  ..$ seg.mean : num [1:77]  0.0212  0.0095  0.0025 -0.0085  0.1752 ...
 $ call  : language segment(x = smoothed.CNA.object, verbose = 1)
 - attr(*, "class")= chr "DNAcopy"

This is a simple list, and the 'data' and 'output' element looks like
readily understandable data frames containing information that we
might like to extract and use for our own, fancier, lattice plots.

Martin

Daniel Brewer <daniel.brewer at icr.ac.uk> writes:

> Hi,
>
> I have a DNAcopy object and I would like to plot just one of the
> samples, with one chromosome per page (so one plot per page).  There are
> two ways I can see of doing this:
> 1) Subset the DNAcopy object so it only contains one sample
> 2) Set the plot options correctly
>
> I can not find how to do either of these.  Has anyone got an idea how to
> overcome this.
>
> Thanks
> -- 
> **************************************************************
> Daniel Brewer, Ph.D.
> Institute of Cancer Research
> Email: daniel.brewer at icr.ac.uk
> **************************************************************
>
> The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company Limited by Guarantee, Registered in England under Company No. 534147 with its Registered Office at 123 Old Brompton Road, London SW7 3RP.
>
> This e-mail message is confidential and for use by the addre...{{dropped}}
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor

-- 
Martin Morgan
Bioconductor / Computational Biology
http://bioconductor.org



More information about the Bioconductor mailing list