RefPlus error
1
0
Entering edit mode
@christian-ruckert-3294
Last seen 5.4 years ago
Germany
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
RefPlus RefPlus • 1.1k views
ADD COMMENT
0
Entering edit mode
@harbron-chris-1976
Last seen 10.2 years ago
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@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}}
ADD COMMENT

Login before adding your answer.

Traffic: 908 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6