MIDAS icon indicating copy to clipboard operation
MIDAS copied to clipboard

Conda Install

Open JChristopherEllis opened this issue 4 years ago • 5 comments

Installed Midas with the conda install and also download the database.

However, I get the following error....

Error: File not found: hs-blastn

Are there other items that need to be installed with conda?

Thanks, Chris

JChristopherEllis avatar Feb 28 '20 17:02 JChristopherEllis

I ran into this too. It seems to be due to midas assuming that the executables are in certain paths instead of just checking the PATH var:

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'])

        for arg in ['hs-blastn', 'stream_seqs', 'bowtie2-build', 'bowtie2', 'samtools']:
                if not os.path.isfile(args[arg]):
                        sys.exit("\nError: File not found: %s\n" % args[arg])

        for arg in ['hs-blastn', 'bowtie2-build', 'bowtie2', 'samtools']:
                if not os.access(args[arg], os.X_OK):
                        sys.exit("\nError: File not executable: %s\n" % args[arg])

Changing this to:

from distutils.spawn import find_executable
for exe in [...]:
    if find_executable(exe) is None:
        sys.exit("\nError: File not found: {}\n".format(exe))

...would fix that check, but then the code that specifies the paths for the executables would also need to change. I'll create a PR

nick-youngblut avatar Dec 19 '20 06:12 nick-youngblut

Can you specify which file has to be modified?

marcomeola avatar Jan 22 '21 11:01 marcomeola

Can you specify which file has to be modified?

./midas/utility.py

nick-youngblut avatar Jan 22 '21 11:01 nick-youngblut

Any updates on merging Nick's PR? I can patch the conda recipe to look for the executables in PATH, but it is much better if the code is updated in MIDAS release itself.

npavlovikj avatar Jun 16 '21 16:06 npavlovikj

Hello! I am encountering the same issue, but since I am using a High Performance Computing cluster from my institution I do not have the permissions to change the files. Has this been solved in any other way or with an update? The version that is installed in the HPC is midas/1.3.2

cirodri1 avatar Sep 22 '21 22:09 cirodri1