[BioC] RefPlus error
Harbron, Chris
Chris.Harbron at astrazeneca.com
Mon Feb 23 15:26:33 CET 2009
Dear Christian,
Thanks for pointing this out. This is an example of R being over-efficient in its simplification of data structures from matrices down to vectors.
We'll sort this out. In the short term can I suggest one of two workarounds:
Either:
Artificially create a duplicate sample in the AffyBatch, so that RefPlus thinks its dealing with two samples and the matrix simplification problem doesn't arise:
affybatch.copy <- affybatch.example
sampleNames(affybatch.copy) <- "COPY"
affybatch.duplicate <- merge.AffyBatch(affybatch.example , affybatch.copy)
Results <- rmaplus(affybatch.duplicate , rmapara=Para , bg = TRUE)[,1]
or edit the function rmaref.predict() to include an extra line, so that it reads:
rmaref.predict <- function (Future, p.e)
{
PMindex <- pmindex(Future)
PM <- log2(pm(Future))
PM <- sweep(PM, 1, unlist(p.e))
pm(Future) <- PM
PMlist <- lapply(PMindex, function(x, y) intensity(y)[x,
], Future)
future <- t(sapply(PMlist, colMedians))
if(nrow(future)==1) {future <- t(future)}
colnames(future) <- sampleNames(Future)
return(future)
}
All the best
Chris Harbron,
Technical Lead Statistician,
Discovery Statistics,
AstraZeneca,
Alderley Park,
Macclesfield,
SK10 4TG.
Chris.Harbron at AstraZeneca.Com
------------------------------
Message: 14
Date: Thu, 19 Feb 2009 17:57:35 +0100
From: Christian Ruckert <cruckert at uni-muenster.de>
Subject: [BioC] RefPlus error
To: bioconductor at stat.math.ethz.ch, Kai-Ming.Chang at astrazeneca.com
Message-ID: <499D8F7F.2030603 at uni-muenster.de>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
When using the rmaplus function from RefPlus package with only one
sample in the AffyBatch object I get the following error message:
Error in dimnames(x) <- dn :
length of 'dimnames' [2] not equal to array extent
The problem lies somewhere in function rmaref.predict, in the line:
colnames(future)<-sampleNames(Future)
where future has its dimensions switched.
"rmaref.predict" <- function(Future,p.e){
## Derive RMA+ expression.
PMindex<-pmindex(Future)
PM<-log2(pm(Future))
PM<-sweep(PM,1,unlist(p.e))
pm(Future)<-PM
PMlist<-lapply(PMindex,function(x,y) intensity(y)[x,],Future)
future<-t(sapply(PMlist,colMedians))
colnames(future)<-sampleNames(Future)
return(future)
}
Greetings,
Christian
--------------------------------------------------------------------------
AstraZeneca UK Limited is a company incorporated in Engl...{{dropped:21}}
More information about the Bioconductor
mailing list