[BioC] cghArray analysis plotting :need help please

Nathalie Conte nac at sanger.ac.uk
Fri Jun 3 17:52:06 CEST 2011


HI, I a new in R and bioconductor and need somebody' s input on these 
issues ( see below, 2 questions), I am sorry about the rather long 
email, I am trying to put as much info as I can
first my system:
 > sessionInfo()
R version 2.11.1 (2010-05-31)
x86_64-unknown-linux-gnu

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8
 [5] LC_MONETARY=C              LC_MESSAGES=C
 [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] DNAcopy_1.24.0

loaded via a namespace (and not attached):
[1] tools_2.11.1


I am trying to plot some cgharray data (mouse agilent 244) and I need to 
make plots.
I went for  the dNAcopy package, following normalisation using limma, I 
am  first creating a copy number array using CNA function from DNAcopy, 
I have used this script (based on the cghMCR package pdf 
instructions).Ma_betAr is my normalised data.
 >chrom <- gsub("chr([0-9XY]+):.*", "\\1", Ma_BetAr$genes[, 
"SystematicName"])
 >dropMe <- c(which(!chrom %in% c(1:19, "X", "Y")), 
which(Ma_BetAr$genes[, "ControlType"] != 0))

 >cna <- CNA(Ma_BetAr$M[-dropMe, ],
gsub("chr([0-9XY]+):.*", "\\1", Ma_BetAr$genes[-dropMe, "SystematicName"]),
as.numeric(gsub(".*:([0-9]+)-.*", "\\1",
Ma_BetAr$genes[-dropMe, "SystematicName"])),
data.type = "logratio", sampleid = colnames(Ma_BetAr$M))

 >smooth.cna<-smooth.CNA(cna) smoothing the cna
then this smoothed CNA is segment using the segment function
 >segData <- segment(smooth.CNA(cna))

then this segData is plotted using plot(segData, plot.type = "w") .
At this point there is a plot(log2R in Yaxis and chromosome in X) which 
is created that will alternate  the chromosomes alternate in different 
colours and are sorted in this order: 1 then 10 then 11, 12, 13 ,14 ,15, 
16, 17 ,18 ,19 ,2 ,3 ,4,...
Question1:I would rather have them in the natural order: 1,2,3,4.....Is 
there an easy way to change the plot order? I saw at the CNA step on the 
manual(DNAcopy) there is a mention of natural order but I don't quite 
understand what  needs to be done:see below
Usage
      CNA(genomdat, chrom, maploc, data.type=c("logratio","binary"),
                        sampleid=NULL)
      ## S3 method for class 'CNA':
   print(x, ...)
Arguments
                 a vector or matrix of data from array-CGH, ROMA, or 
other copy number ex-
   genomdat
                 periments. If it is a matrix the rows correspond to the 
markers and the columns
                 to the samples.
                 the chromosomes (or other group identifier) from which 
the markers came. Vec-
   chrom
                 tor of length same as the number of rows of genomdat. 
If one wants the chro-
                 mosomes to be ordered in the natural order, this 
variable should be numeric or
                 ordered category.
                 the locations of marker on the genome. Vector of length 
same as the number of
   maploc
                 rows of genomdat. This has to be numeric.
                 logratio (aCGH, ROMA, etc.) or binary (LOH).
   data.type
                 sample identifier. If missing the samples are named by 
prefixing "Sample" to
   sampleid
                 consecutive integers.
                 object returned by CNA
   x
                 arguments to be passed onto print command called within.
   ...


Question2: Is it possible at this point to plot the probe using a colour 
that will correspond to their log2R, example if a probe log2R is more 
than 0.2 plot it in red using a script?

Many thanks in advance for any help
Nathalie






-- 
 The Wellcome Trust Sanger Institute is operated by Genome Research 
 Limited, a charity registered in England with number 1021457 and a 
 company registered in England with number 2742969, whose registered 
 office is 215 Euston Road, London, NW1 2BE.



More information about the Bioconductor mailing list