Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in ClusterBatch when SR2POS not present #775

Merged
merged 3 commits into from
Feb 10, 2025

Conversation

epiercehoffman
Copy link
Collaborator

With the latest version, ClusterBatch failed during GatkToSvtkVcf due to SR2POS being missing. This PR updates the check to one that does not fail if SR2POS is not in the header. Tested on a clone of the joint-calling workspace with an updated docker and the same inputs that failed before.

@@ -153,7 +153,7 @@ def convert(record: pysam.VariantRecord,
new_record.info['STRANDS'] = '+-'
# END information is lost when setting POS=END, so we need to set it to SR2POS if it's available
# Note that the END position is only important following SR breakpoint refinement in FilterBatch
if record.info.get('SR2POS') is not None:
if 'SR2POS' in record.info:
Copy link
Collaborator

@mwalker174 mwalker174 Feb 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if 'SR2POS' in record.info:
if 'SR2POS' in record.info and record.info['SR2POS'] is not None:

I would check for both that the key doesn't exist but also if the key exists and the value is not null to be safe

@mwalker174
Copy link
Collaborator

Did you test this on CombineBatches as well?

@epiercehoffman
Copy link
Collaborator Author

@mwalker174 Updated with your suggestion and retested ClusterBatch & CombineBatches with the new docker

Copy link
Collaborator

@mwalker174 mwalker174 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@epiercehoffman epiercehoffman merged commit 72c15c6 into main Feb 10, 2025
8 checks passed
@epiercehoffman epiercehoffman deleted the eph_clusterbatch_sr2pos branch February 10, 2025 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants