Skip to content

Commit

Permalink
Simplify Align.expected_outputs() CRAM path construction (#552)
Browse files Browse the repository at this point in the history
We want .path and .index_path from sequencing_group.cram if it
has been set; otherwise fall back to the generic make_cram_path().
Fixes #543.
  • Loading branch information
jmarshall authored Dec 13, 2023
1 parent eadff3f commit 04cdf9f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions cpg_workflows/stages/align.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,13 @@ def expected_outputs(self, sequencing_group: SequencingGroup) -> dict[str, Path]
Stage is expected to generate a CRAM file and a corresponding index.
"""
if sequencing_group.cram:
if sequencing_group.cram.index_path:
crai_path = sequencing_group.cram.index_path
else:
crai_path = None
cram_path = sequencing_group.cram
else:
crai_path = sequencing_group.make_cram_path().index_path
cram_path = sequencing_group.make_cram_path()

return {
'cram': sequencing_group.cram or sequencing_group.make_cram_path().path,
'crai': crai_path,
'cram': cram_path.path,
'crai': cram_path.index_path,
}

def queue_jobs(
Expand Down

0 comments on commit 04cdf9f

Please sign in to comment.