ctlab / fgsea

Fast Gene Set Enrichment Analysis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

RobertWhitener opened this issue · comments

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

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

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)

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)

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