This is an alternative to https://github.com/katholt/srst2/pull/50 which also adds tests. These can be invoked as follows and require the mock module (i.e. pip install mock).
python -m unittest discover tests/
As discussed in https://github.com/katholt/srst2/issues/49 this PR allows you to specify the path to your samtools or bowtie executables using an environment variable. This is useful if you've got multiple versions of samtools installed on your cluster (for example).
If SRST2_SAMTOOLS is set and the path it is set to exists, it uses that executable. If not it looks for 'samtools' in your path
If SRST2_BOWTIE2 is set and the path it is set to exists, it uses that executable. If not it looks for 'bowtie2' in your path
If SRST2_BOWTIE2_BUILD is set and the path it is set to exists, it uses that executable. If SRST2_BOWTIE2 is ok, it appends '-build' to it's path and checks whether that exists. If neither of those exist then it looks for 'bowtie2-build' in your path
This is an alternative to https://github.com/katholt/srst2/pull/50 which also adds tests. These can be invoked as follows and require the
mock
module (i.e.pip install mock
).As discussed in https://github.com/katholt/srst2/issues/49 this PR allows you to specify the path to your samtools or bowtie executables using an environment variable. This is useful if you've got multiple versions of samtools installed on your cluster (for example).
I've tested the changes by running https://github.com/katholt/srst2/blob/master/example.txt; the output was https://gist.github.com/bewt85/70af411d276c22a53d8d
The behaviour is as follows:
Let me know if you've got any questions.
Ben