KarchinLab / open-cravat

A modular annotation tool for genomic variants
MIT License
113 stars 27 forks source link

Add an environment variable to override modules directory #112

Closed skchronicles closed 2 years ago

skchronicles commented 2 years ago

Hello there,

I just want to start off by saying thank you for creating and maintaining this amazing tool.

Would it be possible to update OpenCRAVAT so you can override the default modules directory with an environment variable? It looks like HPC staff at the NIH are doing this at the current moment: https://hpc.nih.gov/apps/OpenCRAVAT.html

I know this can be achieved to a certain degree with the oc config md command; however, this command does not appear to be stateless. I am running OpenCRAVAT on a shared filesystem where multiple users could be running the program. The problem is that after running the oc config md this path is saved, and it could interfere with other running processes or could permanently use this path in the future (which could have undesired effects).

I have read through the documentation and I currently do not see a way of doing this without modifying the source code. I took a peek at what HPC staff at Biowulf were doing, and it looks like they only needed to modify two scripts:

admin_util.py image

constants.py image

The actual implementation of this looks pretty straightforward:

try:
    default_modules_dir = os.environ["OC_MODULE"]
except KeyError:
    # Environment variable not set
    <do whatever you were doing before>

Please let me know what you think, or if there is a current way to achieve said functionality.

Best Regards, @skchronicles

skchronicles commented 2 years ago

I just noticed this can be achieved with --system-option.

The docs do not list this as an option: image

Feel free to ignore and close this issue. If you have a chance, can you please update the documentation here.