Closed llrs closed 6 years ago
Hi Lluís,
Does it sitll happen if you set nproc=1
?
Same data:
system.time(gseaSizeEffect <- fgsea(grouping, comp1, nperm = 10000))
##
## Timing stopped at: 0.068 0.12 43.18
system.time(gseaSizeEffect <- fgsea(grouping, comp1, nperm = 10000, nproc = 1))
## user system elapsed
## 0.260 0.028 0.289
system.time(gseaSizeEffect <- fgsea(grouping, comp1, nperm = 20000, nproc = 1))
# I had to stop it after ~5 minutes (and restart Rstudio)
# In a R --vanilla session (After loading the previous part of the script):
system.time(gseaSizeEffect <- fgsea(grouping, comp1, nperm = 10000, nproc = 1))
# I had to close the terminal after ~5 minutes
# In a R --vanilla session
#(Only loading the data and some packages: fgsea, reactome.db, org.Hs.eg.db, data.table):
system.time(gseaSizeEffect <- fgsea(grouping, comp1, nperm = 10000, nproc = 1))
# I had to close the terminal after ~5 minutes
Thanks for the quick response
Is it specific for your grouping
and comp1
objects? How about exampleRanks
and examplePathways
? If yes, can you send these objects (with save(grouping, comp1, file="fgsea_test.rda")
) here or by e-mail?
Yes, it seems specific to my data (sorry I should have checked that before). I compressed here the data (in zip format) in order to be able to send it through the issue.
I can reproduce this. We'll look into it a bit later.
Oh 😮 , I didn't expect to be reproducible, I thought it was a problem in my computer 😭 That's worst than I expected. Let me know if there is anything I can do.
It doesn't seem to be driven by the number of permutations by it self, since repeated execution lead to the same outcome.
library(fgsea)
set.seed(123456789)
for (i in 1:10){
print(system.time(gseaSizeEffect <- fgsea(grouping, comp1, nperm = 1000,nproc = 1)))
}
user system elapsed
0.082 0.002 0.064
user system elapsed
0.838 0.008 0.153
user system elapsed
0.222 0.002 0.038
user system elapsed
0.230 0.003 0.039
user system elapsed
0.222 0.002 0.038
user system elapsed
0.215 0.003 0.037
user system elapsed
0.214 0.002 0.036
user system elapsed
0.208 0.002 0.035
user system elapsed
0.226 0.002 0.038
user system elapsed
0.238 0.003 0.042
Then executing the same code
user system elapsed
0.031 0.001 0.036
user system elapsed
0.028 0.000 0.029
user system elapsed
0.028 0.000 0.028
user system elapsed
0.028 0.000 0.029
### Frozen for 5 minutes ---
Sometimes I can execute this twice or thrice without an error, sometimes just once.
Also reproducible if sort.comp1 <- rev(sort(comp1))
it is used.
R version 3.4.3 (2017-11-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.3
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.4.3 magrittr_1.5 tools_3.4.3 pillar_1.1.0 glue_1.2.0 tibble_1.4.1 yaml_2.1.16 Rcpp_0.12.15 tidyr_0.7.2 rlang_0.1.6 purrr_0.2.4
@ToledoEM Thanks, nice report. This makes me think that the error is in the c++ code.
It works now, however, current algorithm does not properly support equal ranks (zero or not) as the ranking is not full in such case. So be cautious about the results. See #18
Thanks for the fix.
I have some problem for a while, it seems like fgsea never return the results:
So while the 10k permutations takes 0.116 and 0.516 for the system and in total, when I double it it takes much more and I had to stop the function (I had this same function running for 3 days without returning any value), despite being reported that to the user it took less than a second the output wasn't ready after 10 minutes. And a similar thing happened when I used 1k permutation and doubled to 2k.
Sorry I couldn't make it reproducible, I really don't understand what can be triggering this. Here is some information about the data I am testing:
Perhaps the problem is that ~78% of my stats are 0, and so they are equivalent in the position. But when I removed them I also had the same problem.
The
session_info("fgsea")
: