problem with using mclapply and org.Hs.eg.db
1
0
Entering edit mode
Andrew Yee ▴ 350
@andrew-yee-2667
Last seen 9.6 years ago
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)) }) > 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]]
Annotation Annotation • 1.2k views
ADD COMMENT
0
Entering edit mode
@martin-morgan-1513
Last seen 4 days ago
United States
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 >
ADD COMMENT
0
Entering edit mode
You're right. I've updated to 2.11.1 and re-installed multicore and org.Hs.eg.db. With these updates, it works fine now. Thanks, Andrew > sessionInfo() R version 2.11.1 Patched (2010-09-04 r52880) Platform: x86_64-unknown-linux-gnu (64-bit) 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.4.1 RSQLite_0.9-2 [4] DBI_0.2-5 AnnotationDbi_1.10.2 Biobase_2.8.0 loaded via a namespace (and not attached): [1] tools_2.11.1 On Thu, Sep 9, 2010 at 5:57 PM, Martin Morgan <mtmorgan@fhcrc.org> wrote: > 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@stat.math.ethz.ch > > https://stat.ethz.ch/mailman/listinfo/bioconductor > > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > > > > [[alternative HTML version deleted]]
ADD REPLY

Login before adding your answer.

Traffic: 1062 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