[R] using SNOW and clusterApplyLB to run jobs parallel
Uwe Ligges
ligges at statistik.tu-dortmund.de
Sat Feb 5 18:24:23 CET 2011
On 01.02.2011 23:07, kparamas wrote:
>
> I have this function and want to run it parallel with different sets of data.
> Using SNOW and clusterApplyLB.
Nice, but what is your question?
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Uwe Ligges
> system.time(out<- mclapply(cData, plotGraph)) #each cData contains 100X6000
> doubles
> system.time(out<- mclapply(cData2, plotGraph))
> system.time(out<- mclapply(cData3, plotGraph))
> system.time(out<- mclapply(cData4, plotGraph))
> system.time(out<- mclapply(cData5, plotGraph))
> system.time(out<- mclapply(cData6, plotGraph))
>
> plotGraph()<- function(cData)
> {
> cl = unname(cor(cData))
>
> result = cbind(as.vector(row(cl)),as.vector(col(cl)),as.vector(cl))
> result = result[result[,1] != result[,2],]
>
> corm = result
>
> corm =corm[abs(corm[,3])>= CORRELATION, ]
> # remove low cor pairs
> library(network); library(sna)
> net<- network(corm, directed = F)
> # the network
> cd<- component.dist(net)
> # component analysis
> delete.vertices(net, which(cd$csize[cd$membership] == 1))
> # delete genes not connected with others
> plot(net)
> }
>
More information about the R-help
mailing list