Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIDAS is looking in the wrong place for 3rd party executables #99

Open
jolespin opened this issue Apr 1, 2019 · 2 comments
Open

MIDAS is looking in the wrong place for 3rd party executables #99

jolespin opened this issue Apr 1, 2019 · 2 comments

Comments

@jolespin
Copy link

jolespin commented Apr 1, 2019

I have MIDAS installed and all of the 3rd party tools as well. Has anyone else had this issue?

(midas_env) -bash-4.1$ which run_midas.py
/usr/local/devel/ANNOTATION/jespinoz/anaconda/envs/midas_env/bin/run_midas.py
(midas_env) -bash-4.1$ which hs-blastn
/usr/local/devel/ANNOTATION/jespinoz/anaconda/envs/midas_env/bin/hs-blastn
(midas_env) -bash-4.1$ run_midas.py species -1 WATER-17B_P01-CTRL_BC-80_BR-2_S80_001.paired_trimmed.fna -t 4 tmp_output

Error: File not found: hs-blastn

From this https://github.com/snayfach/MIDAS/blame/master/midas/utility.py

def add_executables(args):
	""" Identify relative file and directory paths """
	src_dir = os.path.dirname(os.path.abspath(__file__))
	main_dir = os.path.dirname(src_dir)
	args['stream_seqs'] = '/'.join([src_dir, 'run', 'stream_seqs.py'])
	args['hs-blastn'] = '/'.join([main_dir, 'bin', platform.system(), 'hs-blastn'])
	args['bowtie2-build'] = '/'.join([main_dir, 'bin', platform.system(), 'bowtie2-build'])
	args['bowtie2'] = '/'.join([main_dir, 'bin', platform.system(), 'bowtie2'])
	args['samtools'] = '/'.join([main_dir, 'bin', platform.system(), 'samtools'])

What about using this instead as default?
https://codereview.stackexchange.com/questions/123597/find-a-specific-file-or-find-all-executable-files-within-the-system-path

@jolespin
Copy link
Author

jolespin commented May 9, 2019

I ended up doing this for the python2 installation b/c the python3 version had an io error with the TextIOWrapper in the snps module:

conda create --name midas2_env -c bioconda python=2.7 --yes

Then I changed this file:

nano /usr/local/devel/ANNOTATION/jespinoz/anaconda/envs/midas2_env/lib/python2.7/site-packages/midas/utility.py

to the following:

def add_executables(args):
        """ Identify relative file and directory paths """
        src_dir = os.path.dirname(os.path.abspath(__file__))
        main_dir = os.path.dirname(src_dir)
        bin_dir = "/" + os.path.join(*sys.executable.split("/")[:-1])
        args['stream_seqs'] = '/'.join([src_dir, 'run', 'stream_seqs.py'])
        args['hs-blastn'] = '/'.join([bin_dir,  'hs-blastn'])
        args['bowtie2-build'] = '/'.join([bin_dir,  'bowtie2-build'])
        args['bowtie2'] = '/'.join([bin_dir,  'bowtie2'])
        args['samtools'] = '/'.join([bin_dir,  'samtools'])

@jolespin
Copy link
Author

If anyone needs this:

pip install git+https://github.com/jolespin/MIDAS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant