Skip to content

Commit 3807272

Browse files
Tiny fixes regarding BUSCO downloading and running (better error messages; do not run on Python 2.6 and earlier)
1 parent 6726475 commit 3807272

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

quast.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,9 @@ def main(args):
220220
if qconfig.platform_name == 'macosx':
221221
logger.main_info("")
222222
logger.warning("BUSCO can be run on Linux only")
223-
elif sys.version[0:3] == '2.5':
223+
elif sys.version[0:3] < '2.7':
224224
logger.main_info("")
225-
logger.warning("BUSCO does not support Python versions earlier than 2.6.")
225+
logger.warning("BUSCO does not support Python versions earlier than 2.7.")
226226
else:
227227
from quast_libs import run_busco
228228
run_busco.do(contigs_fpaths, os.path.join(output_dirpath, qconfig.busco_dirname), logger)

quast_libs/qutils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,9 @@ def download_file(url, fpath, tool_name, move_file=True):
997997
_, exc_value, _ = sys.exc_info()
998998
logger.error(
999999
'Failed downloading %s (url: %s), QUAST functionality will be limited! '
1000-
'Exception caught: %s' % (tool_name, url, exc_value))
1000+
'Exception caught: %s\n'
1001+
'You can try to download the file manually, place it in %s and restart QUAST'
1002+
% (tool_name, url, exc_value, fpath))
10011003
return None
10021004
if move_file:
10031005
shutil.move(fpath + '.download', fpath)

quast_libs/ra_utils/misc.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,14 @@ def get_gridss_fpath():
6262

6363

6464
def download_unpack_compressed_tar(name, download_url, downloaded_fpath, final_dirpath, logger, ext='gz'):
65-
if download_file(download_url, downloaded_fpath, name, move_file=False):
66-
unpack_tar(downloaded_fpath + '.download', final_dirpath, ext=ext)
65+
if download_file(download_url, downloaded_fpath, name, move_file=True):
66+
unpack_tar(downloaded_fpath, final_dirpath, ext=ext)
6767
logger.main_info(' Done')
68-
else:
69-
logger.main_info(' Failed downloading %s from %s!' % (name, download_url))
70-
return False
68+
return True
69+
return False
7170

7271

7372
def unpack_tar(fpath, dst_dirpath, ext='bz2'):
74-
shutil.move(fpath, fpath)
7573
import tarfile
7674
tar = tarfile.open(fpath, "r:" + ext)
7775
tar.extractall(dst_dirpath)

tc_tests/test_busco.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
print('Busco can be run on Linux only')
1010
sys.exit(0)
1111

12+
if sys.version[:3] < '2.7':
13+
print('BUSCO does not support Python versions earlier than 2.7')
14+
sys.exit(0)
15+
1216
name = os.path.basename(__file__)[5:-3]
1317
contigs = [meta_contigs_1, meta_contigs_2]
1418

0 commit comments

Comments
 (0)