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

Created Cohort Viewer that shows Excluded Patients #85

Merged
merged 11 commits into from
Oct 31, 2023
Merged

Conversation

lnrekerle
Copy link
Collaborator

No description provided.

@ielis ielis self-requested a review October 20, 2023 16:59
Copy link
Member

@ielis ielis left a comment

Choose a reason for hiding this comment

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

Hi @lnrekerle see the comments below.

src/genophenocorr/model/_variant_effects.py Outdated Show resolved Hide resolved
src/genophenocorr/model/_protein.py Outdated Show resolved Hide resolved
src/genophenocorr/model/_protein.py Outdated Show resolved Hide resolved
src/genophenocorr/model/_protein.py Outdated Show resolved Hide resolved
src/genophenocorr/preprocessing/_phenopacket.py Outdated Show resolved Hide resolved
src/genophenocorr/preprocessing/_uniprot.py Outdated Show resolved Hide resolved
src/genophenocorr/preprocessing/_uniprot.py Show resolved Hide resolved
src/genophenocorr/preprocessing/_uniprot.py Outdated Show resolved Hide resolved
@lnrekerle lnrekerle requested a review from ielis October 25, 2023 17:49
@lnrekerle lnrekerle self-assigned this Oct 25, 2023
Copy link
Member

@ielis ielis left a comment

Choose a reason for hiding this comment

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

Hi @lnrekerle
looks good, thanks!

I fixed one bug in the code that searched for overlap between protein coordinates and a protein feature. I added few new methods to Region to do that.

Otherwise, there is one thing that I'd like to point out (see also the comment below). You should use type annotations to write your code. When you look into Region, the start and end properties return int. Not an int or None. Therefore, testing if the coordinate is None is redundant and wrong.

This is the point of using the type annotations. Please work on adding them into your repertoire.

src/genophenocorr/model/_protein.py Outdated Show resolved Hide resolved
src/genophenocorr/preprocessing/_uniprot.py Show resolved Hide resolved
@lnrekerle lnrekerle requested a review from ielis October 27, 2023 16:20
…anscriptAnnotation`, and validate inputs in `TranscriptAnnotation`.
Copy link
Member

@ielis ielis left a comment

Choose a reason for hiding this comment

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

Hi @lnrekerle looks good, thank you!

While looking at the ProteinMetadata.get_features_variant_overlaps(), I went ahead and changed the signature to take a Region instead of a pair of ints. Thanks to this we have few things less to worry about in the downstream code.

First, we do not have to worry about an invalid state in the method where start comes after end. We would have to check this in the function to be sure but now we don't have to, because coordinate "sanity" is one of Region's invariants.

Next, we don't have to worry about coordinate system in the downstream code, e.g. in predicates. Thanks to using Region, we can be sure that we're comparing apples with apples, when e.g. checking the values in ProtFeatureTypePredicate or ProtFeaturePredicate predicates. In other words, we are certain that the coordinates are in the same coordinate system and we are not prone to off-by-one bugs, a very frequent bugs in bioinformatics due to mishandling of the coordinate systems.

With these, I think we're good to merge, thanks a lot!

@lnrekerle lnrekerle merged commit 60328e5 into develop Oct 31, 2023
4 checks passed
@lnrekerle lnrekerle deleted the cohort_viewer branch October 31, 2023 18:45
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