Skip to content

Commit

Permalink
logic fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RaverJay committed Nov 4, 2020
1 parent d367050 commit da05f65
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions input_interpretation.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def parse_args():

def check_input(args):
bam_files = []
for bam_file in args.bam_files:
for bam_file in args.bamfile:
if not os.path.isfile(bam_file):
error(f'Not a file: {bam_file}')
if bam_file in bam_files:
Expand All @@ -47,8 +47,11 @@ def check_input(args):
f'Bam index missing for file: {bam_file}. Trying "samtools index {bam_file}" ...')
ret = os.system(f'samtools index {bam_file}')
if ret != 0:
log(
f'Warning: samtools index returned exit code {ret} - everything might crash and burn.')
error(
f'ERROR: samtools index returned exit code {ret}')
# checked
bam_files.append(bam_file)

num_bam_files = len(bam_files)
log(f'Number of .bam files: {num_bam_files}')
return bam_files, num_bam_files
Expand Down

0 comments on commit da05f65

Please sign in to comment.