[BioC] problem with using mclapply and org.Hs.eg.db

Martin Morgan mtmorgan at fhcrc.org
Thu Sep 9 23:57:11 CEST 2010


On 09/09/2010 02:23 PM, Andrew Yee wrote:
> I'm trying to use mclapply() with org.Hs.eg.db annotation package as
> follows:
>
> library('org.Hs.eg.db')
> library('multicore')
>
> foo <- list('EGFR', 'KRAS', 'TP53')
>
> # the following works fine
>
> result <- mclapply(foo, mc.cores=1, function(x) {
> mget(x, env=revmap(org.Hs.egSYMBOL))
> })
>
> # however when you try using more than one core, you start generating error
> messages
>
> result <- mclapply(foo, mc.cores=2, function(x) {
> mget(x, env=revmap(org.Hs.egSYMBOL))
> })
>
>   

I think this has been addressed in RSQLite 0.9-0, so updating (to R
2.11.1) might help; I'm not 100% sure that the problem is fully
resolved, though (it would be good to here your experiences), and
possible further workarounds are either to open the db connection in the
thread (within the function in the mclapply) or to do the database query
in the parent thread, and pass the results as a standard R object, e.g.,
as.list(org.Hs.egSYMBOL).

Martin
>   
>> result
>>     
> [[1]]
> [1] "Error in sqliteExecStatement(con, statement, bind.data) : \n  RS-DBI
> driver: (invalid dbManager handle)\n"
>
> [[2]]
> [1] "Error in sqliteExecStatement(con, statement, bind.data) : \n  RS-DBI
> driver: (invalid dbManager handle)\n"
>
> [[3]]
> [1] "Error in sqliteExecStatement(con, statement, bind.data) : \n  RS-DBI
> driver: (invalid dbManager handle)\n"
>
>
> This question has been explored previously here
> https://stat.ethz.ch/pipermail/r-sig-hpc/2009-August/000336.html on the HPC
> mailing list, but I figured it may be worth while to try it on the
> Bioconductor mailing list.  Any suggestions?
>
> Thanks,
> Andrew
>
>   
>> sessionInfo()
>>     
> R version 2.10.1 (2009-12-14)
> x86_64-unknown-linux-gnu
>
> locale:
>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
>  [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8
>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
>  [9] LC_ADDRESS=C               LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] multicore_0.1-3     org.Hs.eg.db_2.3.6  RSQLite_0.8-3
> [4] DBI_0.2-5           AnnotationDbi_1.8.1 Biobase_2.6.1
> [7] Biostrings_2.14.12  IRanges_1.4.11
>
> loaded via a namespace (and not attached):
> [1] tools_2.10.1
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> 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
>



More information about the Bioconductor mailing list