[BioC] chromosome ordering in cPlot()/cColor()
Axel.Klenk at Actelion.Com
Axel.Klenk at Actelion.Com
Wed Aug 26 16:30:12 CEST 2009
Hi Martin,
thanks a lot for your help. I have tested your workaround on my data set
and it produces the desired result -- thanks for pointing me to
initialize()...
I have not (yet :-)) observed any unwanted consequences of this change
but unfortunately have stumbled over two more issues for which I have to
ask for your assistance:
> library("geneplotter")
> example(cPlot)
cPlot> ## A bit of a hack to not have a package dependency on hgu95av2
cPlot> ## but need to fiddle w/ the warn level to not fail the example
anyways.
cPlot>
cPlot> curWarn <- options(warn=0)
cPlot> on.exit(options(warn=curWarn), add=TRUE)
Error in options(warn = curWarn) : invalid value for 'warn'
>
Clearly, the example code should read
on.exit(options(curWarn), add=TRUE)
or am I mistaken? I admit I am two minor R releases behind (see
sessionInfo()
below) but for me example(cPlot) does work neither on WinXP nor on RHEL4
64bit.
But to get object 'z' I can run:
> example(cColor)
[...]
> objects()
[1] "curWarn" "probes" "probes2" "z"
> p <- probes2[2:4]
> mget(p, probesToChrom(z))
$`41807_at`
[1] "9"
$`931_at`
[1] "13"
$`39032_at`
[1] "13"
> cPlot(z, glen = 0.3)
> cColor(p, c("red", "black", "black"), z, glen = 0.6)
>
Given that p contains probe names that are mapped to chr 9, 13, and 13 I
had
expected a red bar on chr 9 and two black bars on chr 13 -- however, I see
a
red bar on chr 9 and a black and a red bar on chr 13... maybe my
expectation
is just wrong?
(This is of course a hopefully reproducible toy example -- I first observed
this
behaviour when mapping fold changes to chromosomes and a region known
to be all down came out pretty multicoloured.)
This is obviously without applying any workaround on chromosome order etc.
and the results is the same when chromosomes are reordered.
Can you reproduce/confirm this?
library("geneplotter")
example(cPlot)
example(cColor)
objects()
p <- probes2[2:4]
mget(p, probesToChrom(z))
cPlot(z, glen = 0.3)
cColor(p, c("red", "black", "black"), z, glen = 0.6)
Could you please let me know if this is the expected result or not ?
Thanks in advance,
- axel
> sessionInfo()
R version 2.9.0 (2009-04-17)
i386-pc-mingw32
locale:
LC_COLLATE=German_Switzerland.1252;LC_CTYPE=German_Switzerland.1252;LC_MONETARY=German_Switzerland.1252;LC_NUMERIC=C;LC_TIME=German_Switzerland.1252
attached base packages:
[1] datasets stats graphics grDevices utils methods base
other attached packages:
[1] hgu95av2.db_2.2.12 RSQLite_0.7-1 DBI_0.2-4
fortunes_1.3-6
[5] limma_2.18.0 sfsmisc_1.0-7 geneplotter_1.22.0
lattice_0.17-25
[9] annotate_1.22.0 AnnotationDbi_1.6.0 Biobase_2.4.1
MASS_7.2-47
[13] RODBC_1.2-5 gmodels_2.15.0
loaded via a namespace (and not attached):
[1] gdata_2.4.2 grid_2.9.0 gtools_2.6.1
RColorBrewer_1.0-2
[5] xtable_1.5-5
Axel Klenk
Research Informatician
Actelion Pharmaceuticals Ltd / Gewerbestrasse 16 / CH-4123 Allschwil /
Switzerland
Martin Morgan
<mtmorgan at fhcrc.o
rg> To
Sent by: Axel.Klenk at actelion.com
bioconductor-boun cc
ces at stat.math.eth bioconductor at stat.math.ethz.ch
z.ch Subject
Re: [BioC] chromosome ordering in
cPlot()/cColor()
25.08.2009 18:44
Martin Morgan <mtmorgan at fhcrc.org> writes:
> Hi Axel --
>
> Axel.Klenk at Actelion.Com writes:
>
>> Dear Biocore Team,
>>
>> I'm using cPlot()/cColor() from package annotate to produce chromosome
>> plots and
>> am very impressed how easily this can be achieved. However,
unfortunately,
>> the
>> chromosomes are plotted in reverse alphabetical order, i.e. 1, 10, 11,
etc.
>> from bottom
>> to top and I would like to reorder them to 1, 2, 3, ... from top to
bottom
>> but cannot find an
>> easy way to do so... am I missing something here?
>>
>> I managed to get what I want by hacking buildChromLocation() but that's
>> ugly and I don't
>> want to maintain a modified function if not necessary.
>>
>> Would it be possible to add a replace method for the chromInfo slot to
>> allow e.g.
>>
>> z <- buildChromLocation("hgug41112a")
>> library("gtools") # for mixedsort()
>> info <- chromInfo(z)
>> chromInfo(z) <- info[rev(mixedsort(names(info)))]
>>
>> or maybe you can think of a better solution?
>
> As a work-around, you might try
>
> example(cPlot) # get object z
> idx <- c("1", "5", "10", "X")
> zz <- initialize(z, chromLocs=chromLocs(z)[idx], chromInfo(z)[idx])
oops, that should be
zz <- initialize(z, chromLocs=chromLocs(z)[idx],
chromInfo=chromInfo(z)[idx])
> cPlot(zz)
>
> I'm not sure whether there are other consequences of this sort of
> change, and if there are it would be good if you would let me know
> before a more permanent solution is implemented.
>
> Martin
>
>> Thanks in advance,
>>
>> - axel
>>
>>
>> Axel Klenk
>> Research Informatician
>> Actelion Pharmaceuticals Ltd / Gewerbestrasse 16 / CH-4123 Allschwil /
>> Switzerland
>>
>>
>>
>> The information of this email and in any file transmitted with it is
strictly confidential and may be legally privileged.
>> It is intended solely for the addressee. If you are not the intended
recipient, any copying, distribution or any other use of this email is
prohibited and may be unlawful. In such case, you should please notify the
sender immediately and destroy this email.
>> The content of this email is not legally binding unless confirmed by
letter.
>> Any views expressed in this message are those of the individual sender,
except where the message states otherwise and the sender is authorised to
state them to be the views of the sender's company. For further information
about Actelion please see our website at http://www.actelion.com
>>
>> _______________________________________________
>> 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
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109
Location: Arnold Building M1 B861
Phone: (206) 667-2793
_______________________________________________
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
The information of this email and in any file transmitted with it is strictly confidential and may be legally privileged.
It is intended solely for the addressee. If you are not the intended recipient, any copying, distribution or any other use of this email is prohibited and may be unlawful. In such case, you should please notify the sender immediately and destroy this email.
The content of this email is not legally binding unless confirmed by letter.
Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of the sender's company. For further information about Actelion please see our website at http://www.actelion.com
More information about the Bioconductor
mailing list