Skip to content

add xgdp - #446

Open
tereshchuk1 wants to merge 21 commits into
daisybio:developmentfrom
tereshchuk1:add-xgdp
Open

add xgdp#446
tereshchuk1 wants to merge 21 commits into
daisybio:developmentfrom
tereshchuk1:add-xgdp

Conversation

@tereshchuk1

Copy link
Copy Markdown
Contributor

Adds XGDP. The model combines a GNN branch for drug molecular graphs with a 1D-CNN branch for cell line gene expression, with optional cross-attention.

Adapted from the original repository with the following changes for drevalpy integration:

  • Merged upstream/development and resolved conflicts
  • Edge features aligned to 7-dim to match the existing create_drug_graphs.py featurizer
  • CNN input size computed dynamically instead of hardcoded
  • Fixed MSE loss shape mismatch
  • Added ensure_drug_graphs fixture to tests/conftest.py
  • Suppressed S614 for torch.load(..., weights_only=False) (required for torch_geometric.data.Data)

@codecov-commenter

codecov-commenter commented Jul 2, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 21.09308% with 924 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.97%. Comparing base (7d24cd6) to head (8f6e7cd).
⚠️ Report is 54 commits behind head on development.

Files with missing lines Patch % Lines
drevalpy/models/XGDP/_models.py 11.45% 881 Missing ⚠️
drevalpy/models/XGDP/xgdp.py 84.61% 22 Missing ⚠️
tests/conftest.py 22.22% 21 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@               Coverage Diff               @@
##           development     #446      +/-   ##
===============================================
- Coverage        80.34%   74.97%   -5.37%     
===============================================
  Files              101      122      +21     
  Lines             8171    10783    +2612     
===============================================
+ Hits              6565     8085    +1520     
- Misses            1606     2698    +1092     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread drevalpy/models/XGDP/xgdp.py Outdated

trainer = pl.Trainer(
# max_epochs=self.hyperparameters.get("epochs", 100), #changed to 10 fro testing
max_epochs=1,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

max_epoch=1 is hardcoded here, it doesnt use the epochs from the hpams

Comment thread drevalpy/models/XGDP/xgdp.py Outdated
Comment on lines +228 to +229
self.gene_expression_scaler: StandardScaler | None = None
self.gene_expression_normalizer: MinMaxScaler | None = None

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

the scaler and normalizer are declared here but never fit or applied, so the gene expression goes into the cnn unscaled. how does the publication do it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Checked the original XGDP repo - gene expression is never scaled/normalized there, only variance basedfiltering is applied before it goes into the CNN. So this is currently dead code. Should I remove it?

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.

6 participants