saezlab / MetaProViz

R-package to perform metabolomics pre-processing, differential metabolite analysis, metabolite clustering and custom visualisations.
https://saezlab.github.io/MetaProViz/
GNU General Public License v3.0
8 stars 0 forks source link

Load_Kegg function: Cache the results #36

Closed ChristinaSchmidt1 closed 10 months ago

ChristinaSchmidt1 commented 1 year ago

To make the run faster, we can cache the results similar how Denes did for OmnipathR: https://github.com/saezlab/OmnipathR/blob/master/R/cache.R

OR use: library(memoise)

ChristinaSchmidt1 commented 1 year ago

Denes suggested me to use simple caching with rappdirs (https://cran.r-project.org/web/packages/rappdirs/rappdirs.pdf). Basically, we access the user_chache_dir() and if there is a rds file with the KEGG_pathways already, we open it opposed to using KEGGRest to load from scratch.

ChristinaSchmidt1 commented 10 months ago

I saved the .rds file in the cache directory of R. If the user already has file in this directory after using the function, it is not loaded again.