Skip to content

Commit

Permalink
Merge pull request #35 from martinghunt/master
Browse files Browse the repository at this point in the history
Allow gage to fail as long as we got the stats; v0.10.3
  • Loading branch information
martinghunt committed Jan 14, 2015
2 parents 0ccf3b9 + d121135 commit c8bce34
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion iva/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import sys
import subprocess
version = '0.10.2'
version = '0.10.3'

class abspathAction(argparse.Action):
def __call__(self, parser, namespace, value, option_string):
Expand Down
9 changes: 8 additions & 1 deletion iva/qc_external.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,17 @@ def run_gage(reference, scaffolds, outdir, nucmer_minid=80, clean=True):
'>', gage_out
]), file=f)
fastaq.utils.close(f)
common.syscall('bash ' + gage_script)
common.syscall('bash ' + gage_script, allow_fail=True)
if not os.path.exists(gage_out):
raise Error('Error running GAGE\nbash ' + gage_script)
stats = dummy_gage_stats()
wanted_stats = set(gage_stats)
f = fastaq.utils.open_file_read(gage_out)
got_all_stats = False

for line in f:
if line.startswith('Corrected Contig Stats'):
got_all_stats = True
break
elif ':' in line:
a = line.rstrip().split(': ')
Expand All @@ -98,6 +102,9 @@ def run_gage(reference, scaffolds, outdir, nucmer_minid=80, clean=True):
stats[a[0]] = float(stat)
fastaq.utils.close(f)

if not got_all_stats:
raise Error('Error running GAGE\nbash ' + gage_script)

if clean:
to_clean = [
'contigs.fa.delta',
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def read(fname):

setup(
name='iva',
version='0.10.2',
version='0.10.3',
description='Iterative Virus Assembler',
long_description=read('README.md'),
packages = find_packages(),
Expand Down

0 comments on commit c8bce34

Please sign in to comment.