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

VS 396 clinvar grabs too many values #7823

Merged
merged 9 commits into from
May 4, 2022

Conversation

RoriCremer
Copy link
Contributor

currently clinvar grabs all values in the variants section of the annotation json---this is wrong because nirvana includes clinvar values from all overlapping variants.

this change limits the clinvar values to the correct variant only
and tests the change as well

@codecov
Copy link

codecov bot commented Apr 29, 2022

Codecov Report

❗ No coverage uploaded for pull request base (ah_var_store@d77ebf5). Click here to learn what that means.
The diff coverage is n/a.

@@               Coverage Diff                @@
##             ah_var_store     #7823   +/-   ##
================================================
  Coverage                ?   51.397%           
  Complexity              ?     26413           
================================================
  Files                   ?      2170           
  Lines                   ?    164837           
  Branches                ?     17775           
================================================
  Hits                    ?     84721           
  Misses                  ?     74715           
  Partials                ?      5401           

@RoriCremer RoriCremer force-pushed the rc-vs-396-clinvar-greedy branch 6 times, most recently from 616eed2 to a624d03 Compare May 3, 2022 17:43

def test_clinvar_inclusion(self):
clinvar_swap = [{ 'id': 'RCV01', \
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you want to add a test case for a case where the id does NOT start with 'RCV'?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes and I think that line 88 should handle that case

@@ -143,6 +143,7 @@ def get_gnomad_subpop(gnomad_obj):
max_an = None
max_af = None
max_subpop = ""
## TODO will there ever be unexpected values in gnomad_subpop (values not in gnomad_ordering) ?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this TODO more like "defend against possible unexpected values appearing in gnomad_subpop"?

Copy link
Contributor Author

@RoriCremer RoriCremer May 3, 2022

Choose a reason for hiding this comment

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

yes I think that's a good distinction

row["clinvar_classification"] = ordered_significance_values # special sorted array
updated_dates.sort(key=lambda date: datetime.strptime(date, "%Y-%m-%d")) # note: method is in-place, and returns None
row["clinvar_last_updated"] = updated_dates[-1] # most recent date
row["clinvar_phenotype"] = sorted(phenotypes) # union of all phenotypes
Copy link
Collaborator

Choose a reason for hiding this comment

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

indent inconsistency issues

ordered_significance_values.extend(values_not_accounted_for) # add any values that aren't in significance_ordering to the end
row["clinvar_id"] = clinvar_ids # array
row["clinvar_classification"] = ordered_significance_values # special sorted array
updated_dates.sort(key=lambda date: datetime.strptime(date, "%Y-%m-%d")) # note: method is in-place, and returns None
Copy link
Collaborator

Choose a reason for hiding this comment

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

thank you for the comment, I forget that every time I've been away from Python for a while and it never fails to bite me 🙂

Copy link
Collaborator

@mcovarr mcovarr left a comment

Choose a reason for hiding this comment

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

👍

@RoriCremer RoriCremer merged commit 02cbbf1 into ah_var_store May 4, 2022
@RoriCremer RoriCremer deleted the rc-vs-396-clinvar-greedy branch May 4, 2022 15:35
This was referenced Mar 17, 2023
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.

3 participants