Closed:Parallelise Watermelon Dasen normalisation
0
0
Entering edit mode
15 months ago
lamia_203 ▴ 90

Hi, I'm running quality control on 2 thousand samples and normalisation using the dasen function (from watermelon) - however it takes hours for this to run. I have attached the code below and want to parallelise the function to normalize.quantiles each type of probe at the same time on different clusters. I'm using R to parallelise it and I'm not sure where to start. Any help will be much appreciated.

dasen <- function(mns, uns, onetwo, alfa=100, MvalueConv=TRUE, ...){

   mnsc <- dfsfit(mns,  onetwo, ...)  
   unsc <- dfsfit(uns,  onetwo, roco=NULL)

   mnsc[onetwo=='I' ,] <- normalize.quantiles(mnsc[onetwo=='I', ])
   unsc[onetwo=='I' ,] <- normalize.quantiles(unsc[onetwo=='I', ])

   mnsc[onetwo=='II',] <- normalize.quantiles(mnsc[onetwo=='II',])
   unsc[onetwo=='II',] <- normalize.quantiles(unsc[onetwo=='II',])

   indexNegU <- which(!is.numeric(unsc), arr.ind=TRUE)
   indexNegM <- which(!is.numeric(mnsc), arr.ind=TRUE)
   if(length(indexNegU)>0 || length(indexNegM)>0){
     cat("\tWarning: NA values introduced. Value is replaced by 0.\n")

     unsc[indexNegU] <- 0
     mnsc[indexNegM] <- 0
   }

   #check and "correct" for negative values
   indexNegU <- which(unsc < 0, arr.ind=TRUE)
   indexNegM <- which(mnsc < 0, arr.ind=TRUE)
   unsc[indexNegU] <- 0
   mnsc[indexNegM] <- 0

   if(MvalueConv){
     return(log2((mnsc+alfa)/(unsc + alfa)))
   } else{
     return(mnsc/( mnsc + unsc + alfa ))
   }

}
Watermelon R Normalisation Epic array parallelise • 64 views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 1032 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