ctlab / fgsea

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

fora call errors when no pathways overlap with universe #81

Closed p-smirnov closed 4 years ago

p-smirnov commented 4 years ago

Hi, thanks for the great package!

I noticed that the fora function errors when there is no overlap between all the passed in pathways and the universe. Specifically, the error is:

Error in length(universe) - sapply(pathwaysFiltered, length) :
  non-numeric argument to binary operator

I think it should be possible to handle this case by simply returning a result table with 0 rows? If you are interested in handling this case, I can submit a pull request with this fix.

assaron commented 4 years ago

Yes, that's be great, thank you! Also would be helpful if you can provide a small example, so that I can add it to the tests (or add it yourself).

assaron commented 4 years ago

Should be fixed by https://github.com/ctlab/fgsea/commit/7fee6ed88b57db9a3f8a2720e6e085d0bbbe1585