Skip to content

Commit 6dc2781

Browse files
committed
Raise AlignmentError if no alignment result for target
1 parent 2bd58d2 commit 6dc2781

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/dcd_mapping/align.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,11 @@ def align(
363363
msg = f"BLAT result {target_label} matches multiple target gene names in scoreset {scoreset_metadata.urn}"
364364
target_gene = scoreset_metadata.target_genes[target_label]
365365
alignment_results[target_label] = _get_best_match(blat_result, target_gene)
366+
# confirm that there is an alignment result for each target gene
367+
for target_gene in scoreset_metadata.target_genes:
368+
if target_gene not in alignment_results:
369+
msg = f"No BLAT result found for target gene {target_gene} in scoreset {scoreset_metadata.urn}"
370+
raise AlignmentError(msg)
366371
return alignment_results
367372

368373

0 commit comments

Comments
 (0)