thelovelab / tximeta

Transcript quantification import with automatic metadata detection
https://thelovelab.github.io/tximeta/
64 stars 11 forks source link

Allow setting cache directory via environment variable #31

Closed csoneson closed 3 years ago

csoneson commented 4 years ago

In addition to setting it via the setTximetaBFC() function. This would be similar to what AnnotationHub and ExperimentHub allow, via the ANNOTATION_HUB_CACHE and EXPERIMENT_HUB_CACHE variables (see e.g. here).

mikelove commented 3 years ago

I've added this functionality in 1.7.10. Thanks for patience!

Now TXIMETA_HUB_CACHE will set tximeta's cache location if it is set to a non-empty string.

I still use the same machinery as I did before for recording the location across sessions, to avoid too much additional code, instead of the new.env(parent=emptyenv()) mechanism of AnnotationHub.

If after setting the cache location with the environmental variable, users want to return to the "default" cache location they can just use the following (and they would need to start a new session where the environmental variable is not set):

bfc <- BiocFileCache()
setTximetaBFC(bfccache(bfc))
csoneson commented 3 years ago

This is great, thank you!