ctlab / fgsea

Fast Gene Set Enrichment Analysis
Other
379 stars 67 forks source link

Code completes, but gives "Warning in serialize" warnings when running fgsea command #102

Closed RobertWhitener closed 3 years ago

RobertWhitener commented 3 years ago

Hi,

Although my code is completing fine, anytime I run the fgsea command to calculate enrichments, I get a long string of:

Warning in serialize(data, node$con) : 'package:stats' may not be available when loading

Errors. I've tried loading the BiocParallel package explicity and running

options(MulticoreParam=quote(MulticoreParam(workers=4))) prior to running the fgsea calculations incase that was the issues, with no luck.

Thanks for any help Robert

assaron commented 3 years ago

Does it work fine for you if you run in from base R console, not from Rstudio?

Btw, MulticoreParam is not working in Windows, you should use SnowParam

RobertWhitener commented 3 years ago

Hi,

Did some investigating. It does look like bbparam was defaulting to SnowParam automatically for me.

I also did as you asked, and ran a process in base R console, which also defaulted to SnowParam.

fgsea(pathways = PATHWAY, stats = STATS, eps = 0, minSize = 15, maxSize = 200) In both R Console and R Studio: warnings() from RStudio: warnings() Warning messages: 1: In preparePathwaysAndStats(pathways, stats, minSize, maxSize, ... : There are ties in the preranked stats (11.52% of the list). The order of those tied genes will be arbitrary, which may produce unexpected results. 2: In serialize(data, node$con) : 'package:stats' may not be available when loading 3: In serialize(data, node$con) : 'package:stats' may not be available when loading 4: In serialize(data, node$con) : 'package:stats' may not be available when loading 5: In serialize(data, node$con) : 'package:stats' may not be available when loading 6: In serialize(data, node$con) : 'package:stats' may not be available when loading 7: In serialize(data, node$con) : 'package:stats' may not be available when loading 8: In serialize(data, node$con) : 'package:stats' may not be available when loading 9: In serialize(data, node$con) : 'package:stats' may not be available when loading 10: In serialize(data, node$con) : 'package:stats' may not be available when loading 11: In serialize(data, node$con) : 'package:stats' may not be available when loading `

Warnings from R console: `

warnings() Warning message: In preparePathwaysAndStats(pathways, stats, minSize, maxSize, ... : There are ties in the preranked stats (11.52% of the list). The order of those tied genes will be arbitrary, which may produce unexpected results. `

sessionInfo() returns identical attached base and other attached packages. So it looks like there may be an issue with the current RStudio version? I'll head over there to see if they might have an idea of whats going on.

Atleast, it seems the rankings and leadingEdge results are not different (there are small differences in the pvals, etc, which did not affect the rankings)

assaron commented 3 years ago

I can't find it now, but I saw a similar issue for rstudio and your output confirms it. By the way, I believe you can reproduce this warnings even without fgsea, by something like:

library(BiocParallel)
register(SnowParam(2))
bplapply(1:10, sqrt)
RobertWhitener commented 3 years ago

Yes, looks like it might be a known, low-priority bug in RStudio. I'll go ahead and close this. Thanks for the help!