[R-sig-hpc] multicore and AnnotaionDBI (bioconductor) problem
Steve Weston
steve at revolution-computing.com
Fri Aug 21 15:10:31 CEST 2009
The problem appears to be that the child processes that are forked
by the mclapply function are not able to use the database connection
that they inherited from their parent. You need to figure out some
way for the child processes to create their own database connection
after they are created. I'm not sure of the best strategy for doing
that in your case. You could do some kind of test in the getSymbol
function, or use the lower level functions in the multicore package
instead of mclapply, but there might be a better option that I'm not
aware of.
- Steve
On Fri, Aug 21, 2009 at 4:24 AM, Morten Hansen<mhansen at sund.ku.dk> wrote:
> I am trying to use mclapply from package multicore on a Bioconductor function, but I get an error with the function mget from library AnnotationDbi.
>
> When I run the following code:
>
> # You need to install Biobase from http://www.bioconductor.org
> require( Biobase )
> require( hgu95av2.db )
>
> getSymbol <- function ( x ) {
> return( AnnotationDbi::mget( x , hgu95av2SYMBOL ) )
> }
>
> x <- list( "36090_at" , "38785_at" )
>
> mclapply( x , getSymbol )
>
> I get this error:
>
> [[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"
>
> It work fine with lapply instead of mclapply:
>
> [[1]]
> [[1]]$`36090_at`
> [1] "TBL2"
>
>
> [[2]]
> [[2]]$`38785_at`
> [1] "MUC1"
>
> This could of course be a problem in the AnnotationDbi::mget function, but it looks like multicore is having some problem with RS-DBI driver.
>
> Any suggestions?
>
> Regards -
>
> Morten Hansen
> MD, Ph.D. student
> ICMM
> Panum Institute
> Blegdamsvej 3B
> DK-2200 Copenhagen N
>
> _______________________________________________
> R-sig-hpc mailing list
> R-sig-hpc at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-hpc
>
--
Steve Weston
REvolution Computing
One Century Tower | 265 Church Street, Suite 1006
New Haven, CT 06510
P: 203-777-7442 x266 | www.revolution-computing.com
More information about the R-sig-hpc
mailing list