diff --git a/README.md b/README.md index 54977bc..3502936 100644 --- a/README.md +++ b/README.md @@ -8,17 +8,10 @@ Installation Prerequisites: * [NCBI BLAST] [NCBI BLAST] blast+, and optionally blastall, installed and their commands in your path - * [Fastaq] [Fastaq] >= v0.1 - * [Farmpy] [Farmpy] >= v0.2 -Once the prerequisites are installed, run the tests: +Once the prerequisites are installed, install with pip: - python3 setup.py test - -Note that the tests check that blast+ is installed, but not blastall because it is optional. -If all was OK, then install: - - python3 setup.py install + pip3 install farm_blast Synopsis -------- @@ -48,5 +41,3 @@ To get all the options, use --help: farm_blast --help [NCBI BLAST]: http://blast.ncbi.nlm.nih.gov/Blast.cgi?CMD=Web&PAGE_TYPE=BlastDocs&DOC_TYPE=Download -[Fastaq]: https://github.com/sanger-pathogens/Fastaq -[Farmpy]: https://github.com/sanger-pathogens/Farmpy diff --git a/farm_blast/utils.py b/farm_blast/utils.py index 1921475..49cde84 100644 --- a/farm_blast/utils.py +++ b/farm_blast/utils.py @@ -1,4 +1,4 @@ -from fastaq import utils +from pyfastaq import utils import sys class Error (Exception): pass diff --git a/setup.py b/setup.py index 044862b..fce9ec5 100644 --- a/setup.py +++ b/setup.py @@ -1,21 +1,44 @@ import os +import shutil +import sys import glob from setuptools import setup, find_packages -def read(fname): - return open(os.path.join(os.path.dirname(__file__), fname)).read() + +required_progs = [ + 'blastn', + 'tblastn', + 'tblastx', + 'blastp', + 'blastx', + 'deltablast' +] + +found_all_progs = True +print('Checking blast+ programs found in path:') +for program in required_progs: + if shutil.which(program) is None: + found_all_progs = False + found = ' NOT FOUND' + else: + found = ' OK' + print(found, program, sep='\t') + +if not found_all_progs: + print('Cannot install because some programs from the blast+ package not found.', file=sys.stderr) + sys.exit(1) + setup( - name='Farm_blast', - version='0.1.1', + name='farm_blast', + version='0.1.2', description='Package to run blast in parallel on a compute farm', - long_description=read('README.md'), packages = find_packages(), author='Martin Hunt', author_email='mh12@sanger.ac.uk', url='https://github.com/sanger-pathogens/Farm_blast', scripts=glob.glob('scripts/*'), test_suite='nose.collector', - install_requires=['nose >= 1.3', 'fastaq >= 1.2', 'farmpy >= 0.2'], + install_requires=['nose >= 1.3', 'pyfastaq >= 3.0.1', 'farmpy >= 0.2'], license='GPLv3', )