Skip to content

Commit

Permalink
Fix bug that results in an empty Vapor report (#754)
Browse files Browse the repository at this point in the history
* Initial commit

* Conditionally get dict fields if they exist
  • Loading branch information
kjaisingh authored Jan 6, 2025
1 parent a1f302d commit e902bf4
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ def main(argv: Optional[List[Text]] = None) -> get_truth_overlap.ConfidentVarian
vapor_support_old = vapor_rec['p_non_ref_old'] > 1 - arguments.vapor_min_precision
vapor_support_genotyped = vapor_rec['p_non_ref_genotyped'] > 1 - arguments.vapor_min_precision
vapor_support_read_threshold = vapor_rec['p_non_ref_read_threshold'] > 1 - arguments.vapor_min_precision
if vapor_support_old or vapor_support_genotyped or vapor_support_read_threshold:
vapor_support = vapor_support_old or vapor_support_genotyped or vapor_support_read_threshold
if vapor_support:
vapor_support_gt = vapor_rec[genomics_io.Keys.gt]
vapor_support_gq = vapor_rec[genomics_io.Keys.gq]
vapor_support_reads = vapor_rec[genomics_io.Keys.vapor_read_scores]
Expand Down Expand Up @@ -259,9 +260,9 @@ def main(argv: Optional[List[Text]] = None) -> get_truth_overlap.ConfidentVarian
sample,
record.info['SVTYPE'],
record.info['SVLEN'],
record.samples[sample]['GT'][0],
record.samples[sample]['GT'][1],
record.samples[sample]['GQ'],
record.samples[sample].get('GT', ['N/A', 'N/A'])[0],
record.samples[sample].get('GT', ['N/A', 'N/A'])[1],
record.samples[sample].get('GQ', 'N/A'),
vapor_support_gt,
vapor_support_gq,
vapor_support_reads,
Expand Down

0 comments on commit e902bf4

Please sign in to comment.