Skip to content

Allow G123 to run without phasing analysis when no default phasing exists#963

Open
SKM2227229725 wants to merge 1 commit intomalariagen:masterfrom
SKM2227229725:fix-g123-phasing
Open

Allow G123 to run without phasing analysis when no default phasing exists#963
SKM2227229725 wants to merge 1 commit intomalariagen:masterfrom
SKM2227229725:fix-g123-phasing

Conversation

@SKM2227229725
Copy link

Fixes #795

Summary

Previously, g123_gwss() required a default phasing analysis ID,
which caused an assertion error for datasets such as amin1 and adir1
where no phasing analysis is available.

What this PR changes

  • Allows sites=None when no default phasing analysis exists
  • Adds None to valid site options
  • Maintains backward compatibility for datasets that do use phasing
  • Avoids the need for placeholder strings like "noneyet"

Rationale

G123 uses unphased genotype data for the main calculation.
Requiring a phasing analysis ID should not be mandatory for
datasets that do not provide phasing data.

This change enables G123 to run cleanly on such datasets
without breaking existing behaviour.

name = "g123_gwss_v1"

valid_sites = self.phasing_analysis_ids + ("all", "segregating")
# Allow None as a valid site (meaning unphased/all sites)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think it does what you say. It still uses the _default_phasing_analysis, which is a phasing analysis and thus excludes unphased data.

@SKM2227229725
Copy link
Author

@jonbrenas Thanks for the review and for pointing this out. I will re-check the implementation to ensure that G123 can run without relying on _default_phasing_analysis when no default phasing analysis exists. I will update the PR accordingly.

@SKM2227229725
Copy link
Author

Thanks for the review. I will work on the requested changes. Please assign this to me.

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