-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge PR #29061, commits were: * Update build number * Add patch file * Fix midas patch as given here snayfach/MIDAS#113
- Loading branch information
1 parent
b49c7b9
commit cd695da
Showing
3 changed files
with
86 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--- setup.py 2017-11-26 11:00:47.000000000 -0600 | ||
+++ setup.py.new 2021-06-16 12:39:18.363149855 -0500 | ||
@@ -1,5 +1,5 @@ | ||
try: | ||
- from setuptools import setup | ||
+ from setuptools import setup, find_packages | ||
except: | ||
from distutils.core import setup | ||
import os | ||
@@ -12,5 +12,7 @@ | ||
author = 'Stephen Nayfach', | ||
author_email='[email protected]', | ||
url='https://github.com/snayfach/MIDAS', | ||
- install_requires = ['biopython >= 1.62', 'numpy >= 1.7.0', 'pysam >= 0.8.1', 'pandas >= 0.17.1'] | ||
+ install_requires = ['biopython >= 1.62', 'numpy >= 1.7.0', 'pysam >= 0.8.1', 'pandas >= 0.17.1'], | ||
+ packages = find_packages(), | ||
+ scripts = ['scripts/build_midas_db.py', 'scripts/call_consensus.py', 'scripts/compare_genes.py', 'scripts/merge_midas.py', 'scripts/query_by_compound.py', 'scripts/run_midas.py', 'scripts/snp_diversity.py', 'scripts/strain_tracking.py'] | ||
) | ||
--- midas/utility.py 2017-11-26 11:00:47.000000000 -0600 | ||
+++ midas/utility.py.new 2021-06-16 12:37:09.019590551 -0500 | ||
@@ -5,6 +5,7 @@ | ||
# Freely distributed under the GNU General Public License (GPLv3) | ||
|
||
import io, os, stat, sys, resource, gzip, platform, bz2, Bio.SeqIO | ||
+from distutils.spawn import find_executable | ||
|
||
__version__ = '1.3.0' | ||
|
||
@@ -106,23 +107,23 @@ | ||
pool.join() | ||
sys.exit("\nKeyboardInterrupt") | ||
|
||
+def find_exe(exe, path): | ||
+ """ Finding executable """ | ||
+ if find_executable(exe) is None: | ||
+ exe = os.path.join(path, exe) | ||
+ if not os.path.isfile(exe): | ||
+ sys.exit("\nError: File not found: %s\n" % exe) | ||
+ if find_executable(exe) is None: | ||
+ sys.exit("\nError: Executable not found: %s\n" % exe) | ||
+ return exe | ||
+ | ||
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]) | ||
+ args['stream_seqs'] = find_exe('stream_seqs.py', os.path.join(src_dir, 'run')) | ||
+ for exe in ['hs-blastn', 'bowtie2-build', 'bowtie2', 'samtools']: | ||
+ args[exe] = find_exe(exe, os.path.join(main_dir, 'bin', platform.system())) | ||
|
||
import subprocess as sp | ||
|
||
--- midas/run/snps.py 2017-11-26 11:00:47.000000000 -0600 | ||
+++ midas/run/snps.py.new 2021-06-16 12:32:36.982415965 -0500 | ||
@@ -220,6 +220,8 @@ | ||
start = time() | ||
print("\nCounting alleles") | ||
args['log'].write("\nCounting alleles\n") | ||
+ args['log'].close() | ||
+ args.pop('log', None) | ||
|
||
# run pileups per species in parallel | ||
argument_list = [] |