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

[hail]] Add transition/transversion summary to summarize_variants #7787

Merged
merged 5 commits into from
Jan 8, 2020

Conversation

tpoterba
Copy link
Contributor

@tpoterba tpoterba commented Jan 2, 2020

No description provided.

@@ -1070,6 +1086,8 @@ def summarize_variants(mt: Union[MatrixTable, MatrixTable], show=True, *, handle
- `contigs` (:obj:`Dict[str, int]`): Number of variants on each contig.
Copy link
Contributor

Choose a reason for hiding this comment

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

Above this line, under Notes, it says this is a struct with "four" fields. Should be changed to "five"

summary = f' {allele_type_formatter % allele_type}: {count} alternate alleles'
if allele_type == 'SNP':
nti = self.nti
ntv = self.ntv
Copy link
Contributor

Choose a reason for hiding this comment

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

Why rebind these as nti and ntv instead of just directly using self.nti in the fstring?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

seems about equivalent, looked sorta gross with the division though

assert r['allele_types'] == {'Deletion': 27, 'Insertion': 18, 'SNP': 301}
assert r['contigs'] == {'20': 346}
assert r['n_variants'] == 346
assert r['r_ti_tv'] == 2.5
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we test allele_counts field here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, sure

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.

None yet

3 participants