diff --git a/README.md b/README.md index a177f44..aed7e7f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Workstation Housekeeping v1.5 +# Workstation Housekeeping v1.6 Scripts to manage data on the NGS workstation @@ -56,6 +56,7 @@ Delete local directories that have been uploaded to the DNAnexus cloud storage s git clone https://github.com/moka-guys/workstation_housekeeping.git pip install workstation_housekeeping/wscleaner wscleaner --version # Print version number +# If installing on workstation see wscleaner/README.md section 'Workstation Environment' ``` ### Usage @@ -65,4 +66,4 @@ wscleaner --set-key DNA_NEXUS_KEY # Cache dnanexus api key wscleaner ROOT_DIRECTORY --logfile LOGFILE_PATH ``` ---- \ No newline at end of file +--- diff --git a/wscleaner/README.md b/wscleaner/README.md index 515e4cb..91c17fb 100644 --- a/wscleaner/README.md +++ b/wscleaner/README.md @@ -52,6 +52,10 @@ optional arguments: pytest . --auth_token DNA_NEXUS_KEY ``` +## Workstation Environment +The directory `env/` in this repository contains conda environment scripts for the workstation. These remove conflicts in the PYTHONPATH environment variable by editing the variable when conda is activated. The conda documentation describes where to place these scripts under ['saving environment variables'](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#macos-and-linux). + + ## License Developed by Viapath Genome Informatics diff --git a/wscleaner/env/activate_env_vars.sh b/wscleaner/env/activate_env_vars.sh new file mode 100644 index 0000000..b77e02c --- /dev/null +++ b/wscleaner/env/activate_env_vars.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Cache the python path +export wsc_PPCACHE=$PYTHONPATH + +# Remove the dxtoolkit path from the pythonpath environment variable +# Python searches this when importing modules, causing clashes with conda install +PYTHONPATH_CLEAN=$(echo $PYTHONPATH | sed s,/usr/share/dnanexus/lib/python2.7/site-packages:,,) +# Set the new pythonpath +export PYTHONPATH=$PYTHONPATH_CLEAN diff --git a/wscleaner/env/deactivate_env_vars.sh b/wscleaner/env/deactivate_env_vars.sh new file mode 100644 index 0000000..e0f5191 --- /dev/null +++ b/wscleaner/env/deactivate_env_vars.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# Set the python path to the original before the environment was active +export PYTHONPATH=${wsc_PPCACHE}