Skip to content

Commit

Permalink
find bam file from log if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewprzh committed Apr 3, 2024
1 parent e8184e6 commit 44acced
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions tests/github/run_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,18 @@ def check_value(etalon_value, output_value, name):
return exit_code


def find_bam(output_folder, label):
bam = glob.glob(os.path.join(output_folder, "%s/aux/%s*.bam" % (label, label)))
if bam:
return bam[0]

for l in open(os.path.join(output_folder, "isoquant.log")):
if l.find("BAM file: ") != -1:
return l.strip().split("-1")

return None


def run_assignment_quality(args, config_dict):
log.info('== Running quality assessment ==')
config_file = args.config_file
Expand All @@ -159,11 +171,10 @@ def run_assignment_quality(args, config_dict):
genedb = fix_path(config_file, config_dict["genedb"])
reads = fix_path(config_file, config_dict["reads"])
if "bam" not in config_dict:
bam = glob.glob(os.path.join(output_folder, "%s/aux/%s*.bam" % (label, label)))
if not bam:
bam = find_bam(output_folder, label)
if not bam or not os.path.exists(bam):
log.error("BAM file was not found")
return -21
bam = bam[0]
else:
bam = fix_path(config_file, config_dict["bam"])

Expand Down

0 comments on commit 44acced

Please sign in to comment.