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

Update the polypharmacy example and GripNet implementation #346

Merged
merged 36 commits into from
Oct 16, 2022

Conversation

NYXFLOWER
Copy link
Collaborator

@NYXFLOWER NYXFLOWER commented Aug 31, 2022

This PR will update and test the polypharmacy gripnet example and the core API related to GripNet. A tutorial notebook for Gripnet will be added in the next PR after this one is merged.

Change summary:

  • In the core API
    • remove the old GripNet implementation and test.
    • add PolypharmacyDataset to kale.loaddata.polypharmacy_datasets
    • add DistMultDecoder and GripNetLinkPrediction to kale.predict.decode
    • add negative_sampling and typed_negative_sampling to kale.prepdata.graph_negative_sampling
    • add out_channels to GripNet in kale.embed.gripnet
    • add auprc_auroc_ap to kale.evaluate.metrics
  • update the example and configs
  • update README and docs

Follow-up future works in order of priority

  • Add an example dataset with fixed training, validation, and test sets and update this example.
    • The variable names should be made more descriptive than the current version (g_, gg_, d_, gd_). Also be more consistent whether gene or protein.
    • Fix: some side effects do not have pairs in the test set.
  • Provide functionalities to split graph data into training, validation, and test sets.
  • Add Jupyter Notebook example.
  • Improve test coverage.

Status

Ready

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • In-line docstrings updated.
  • Source for documentation at docs manually updated for new API.

@NYXFLOWER NYXFLOWER added the enhancement Improvement of existing code label Aug 31, 2022
@github-actions github-actions bot added this to In progress in v0.2.0 Aug 31, 2022
@NYXFLOWER NYXFLOWER changed the title Rewrite polypharmacy example Update the polypharmacy example and GripNet implementation Aug 31, 2022
@codecov-commenter
Copy link

codecov-commenter commented Aug 31, 2022

Codecov Report

Merging #346 (35ebc9b) into main (de78831) will decrease coverage by 1.42%.
The diff coverage is 38.75%.

@@            Coverage Diff             @@
##             main     #346      +/-   ##
==========================================
- Coverage   92.81%   91.38%   -1.43%     
==========================================
  Files          46       48       +2     
  Lines        5078     5130      +52     
==========================================
- Hits         4713     4688      -25     
- Misses        365      442      +77     
Impacted Files Coverage Δ
kale/loaddata/polypharmacy_datasets.py 0.00% <0.00%> (ø)
kale/prepdata/graph_negative_sampling.py 26.66% <26.66%> (ø)
kale/evaluate/metrics.py 71.42% <33.33%> (-28.58%) ⬇️
kale/predict/decode.py 63.44% <53.42%> (-36.56%) ⬇️
kale/embed/gripnet.py 86.62% <100.00%> (-3.38%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

kale/predict/decode.py Outdated Show resolved Hide resolved
kale/evaluate/metrics.py Outdated Show resolved Hide resolved
Copy link
Member

@haipinglu haipinglu left a comment

Choose a reason for hiding this comment

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

Many thanks for the great efforts. Almost there, with a few minor issues remaining.

Shall we ask @JunseKim1159 to help with unit tests to improve the coverage?

@NYXFLOWER
Copy link
Collaborator Author

Many thanks for the great efforts. Almost there, with a few minor issues remaining.

Shall we ask @JunseKim1159 to help with unit tests to improve the coverage?

Why not. @JunseKim1159 will be very helpful if he is interested. Besides the code format and testing cases, he can probably help with reconstructing a new valid polypharmacy example dataset and writing the notebook!

Copy link
Member

@haipinglu haipinglu left a comment

Choose a reason for hiding this comment

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

We'd better talk through the remaining problems to move forward. Many thanks.

self.protein_feat = data.g_feat
self.protein_edge_index = data.gg_edge_index
self.drug_feat = data.d_feat
self.protein_drug_edge_index = data.gd_edge_index
Copy link
Member

@haipinglu haipinglu Oct 16, 2022

Choose a reason for hiding this comment

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

I thought we have corrected the above variable named. g_, gg_, d_, gd_. Is it else where? Can we make them more descriptive here? Also gene or protein, again. I saw you used protein more.

Copy link
Member

Choose a reason for hiding this comment

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

This is due to the variable name in the dataset, to be updated in another PR.

@haipinglu haipinglu merged commit 4d6deae into main Oct 16, 2022
v0.2.0 automation moved this from In progress to Done Oct 16, 2022
@haipinglu haipinglu deleted the rewrite_polypharmacy_example branch October 16, 2022 22:02
This was referenced Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement of existing code
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants