[BioC] cghArray analysis plotting :need help please
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:
R version 2.11.1 (2010-05-31)
 LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C
 LC_TIME=en_GB.UTF-8 LC_COLLATE=en_GB.UTF-8
 LC_MONETARY=C LC_MESSAGES=C
 LC_PAPER=en_GB.UTF-8 LC_NAME=C
 LC_ADDRESS=C LC_TELEPHONE=C
 LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
attached base packages:
 stats graphics grDevices utils datasets methods base
other attached packages:
loaded via a namespace (and not attached):
I am trying to plot some cgharray data (mouse agilent 244) and I need to
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[,
>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"]),
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
CNA(genomdat, chrom, maploc, data.type=c("logratio","binary"),
## S3 method for class 'CNA':
a vector or matrix of data from array-CGH, ROMA, or
other copy number ex-
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-
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
the locations of marker on the genome. Vector of length
same as the number of
rows of genomdat. This has to be numeric.
logratio (aCGH, ROMA, etc.) or binary (LOH).
sample identifier. If missing the samples are named by
prefixing "Sample" to
object returned by CNA
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
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