Permalink
Browse files

Bugfix in dec.py, minor modifications in amplian.py

dec.py now works also on file having more than a dot in the name
  • Loading branch information...
1 parent 5157d22 commit 2a0f127e7a4e15c1c766e8c22184cfe126970da4 @ozagordi ozagordi committed Dec 12, 2012
Showing with 9 additions and 18 deletions.
  1. +7 −4 amplian.py
  2. +2 −14 dec.py
View
@@ -59,11 +59,13 @@ def run_child(exe_name, arg_string):
if not arg_string.startswith(' '):
arg_string = ' ' + arg_string
+ amplog.debug(exe_name + arg_string)
+
try:
retcode = subprocess.call(exe_name + arg_string, shell=True)
- if retcode < 0:
+ if retcode > 0:
amplog.error(exe_name + arg_string)
- amplog.error("Child %s terminated by signal" % exe_name, -retcode)
+ amplog.error("Child %s terminated by signal" % exe_name, retcode)
else:
amplog.debug("Child %s returned %i" % (exe_name, retcode))
except OSError, ee:
@@ -139,8 +141,9 @@ def main(in_bam='', in_fasta='', min_overlap=0.95, max_coverage=50000,
n_reads = int(h.split()[-1])
assert os.path.exists(win_file), 'window file not found'
diri_exe = os.path.join(dn, 'diri_sampler')
- diri_args = '-i %s -j %d -a 0.1 -t 2000' % (win_file, n_reads * 10)
- # ret_diri = run_child(diri_exe, diri_args)
+ iterations = max(20000, n_reads * 10)
+ diri_args = '-i %s -j %d -a 0.1 -t 2000' % (win_file, iterations)
+ ret_diri = run_child(diri_exe, diri_args)
# diagnostics on the convergence
run_diagnostics(win_file, n_reads)
View
16 dec.py
@@ -511,21 +511,9 @@ def main(in_bam='', in_fasta='', win_length=201, win_shifts=3, region='',
cb = 'X'
to_correct[r][4].append(cb)
del this
- ## ccst = []
- ## for i in range(rlen):
- ## if i not in corrstore: ccst.append(i)
- ## if len(ccst) > 50:
- ## print aligned_reads[r]
- ## print ccst
- ## print correction[r]
- ## sys.exit()
- ## print ccst
- ## storestore.append(len(ccst))
- ## print storestore
-
- # print reason
+
ccx = {}
- cin_stem = os.path.split(in_bam)[1].split('.')[0]
+ cin_stem = '.'.join(os.path.split(in_bam)[1].split('.')[:-1])
fch = open('%s.cor.fas' % cin_stem, 'w')
for r in to_correct:
cor_read = ''.join(to_correct[r][4])

0 comments on commit 2a0f127

Please sign in to comment.