Skip to content

model: SENAVAE - #3571

Open
ori-kron-wis wants to merge 10 commits into
scverse:mainfrom
aperonalope:SENA-branch
Open

model: SENAVAE#3571
ori-kron-wis wants to merge 10 commits into
scverse:mainfrom
aperonalope:SENA-branch

Conversation

@ori-kron-wis

Copy link
Copy Markdown
Collaborator

No description provided.

@ori-kron-wis ori-kron-wis changed the title SENADVAE files added model: SENAVAE Oct 22, 2025
@codecov

codecov Bot commented Oct 22, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 62.88557% with 373 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.55%. Comparing base (3507d79) to head (6aa6ea8).

Files with missing lines Patch % Lines
src/scvi/external/SENADVAE/_model.py 42.06% 252 Missing ⚠️
src/scvi/external/SENADVAE/_module.py 70.68% 51 Missing ⚠️
src/scvi/external/SENADVAE/_dataloader.py 76.19% 50 Missing ⚠️
src/scvi/external/SENADVAE/_training_plan.py 88.95% 20 Missing ⚠️

❌ Your patch check has failed because the patch coverage (62.88%) is below the target coverage (85.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3571      +/-   ##
==========================================
- Coverage   88.58%   87.55%   -1.03%     
==========================================
  Files         241      246       +5     
  Lines       23744    24749    +1005     
==========================================
+ Hits        21033    21670     +637     
- Misses       2711     3079     +368     
Flag Coverage Δ
integration 74.21% <62.88%> (-0.46%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/scvi/external/SENADVAE/__init__.py 100.00% <100.00%> (ø)
src/scvi/external/__init__.py 100.00% <100.00%> (ø)
src/scvi/external/SENADVAE/_training_plan.py 88.95% <88.95%> (ø)
src/scvi/external/SENADVAE/_dataloader.py 76.19% <76.19%> (ø)
src/scvi/external/SENADVAE/_module.py 70.68% <70.68%> (ø)
src/scvi/external/SENADVAE/_model.py 42.06% <42.06%> (ø)

... and 2 files with indirect coverage changes

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

@ori-kron-wis ori-kron-wis left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Let's have the external folder name in lower case to match other external models.
Add the class model name to the index init file of the external folder.
Add Tutorial(s) to scvi-tutorials
Add model description md file
Add Unit tests (most important)
Add changlog

adata : AnnData
Annotated data object containing single-cell expression data with perturbation annotations.
Must be pre-registered via setup_anndata with control/perturbation labels.
go_file_path : str

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Those 2 go-file links and gene_symb file as mandatory inputs to the model will be untrivial to manage, as it doesn't exist for any of the other models. You will have to provide a function that checks for the correctness of those files.
You will have to provide a full description of what those files are and their structure.
You will have to upload such data for the unit-test example.

_data_splitter_cls = SENADataSplitter # Control-perturbation aware data splitting

@staticmethod
def set_seeds(seed: int) -> None:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think we can use the generic src/scvi/_settings.py set seed (+ what you added). better than the reuse of code.

logger = logging.getLogger(__name__)


class SENADVAE(UnsupervisedTrainingMixin, BaseModelClass):

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We usually use the VAE suffix to describe the module, not the model. It can be confusing.
How hard is is to change the model name to SENA and the module to SENAVAE

nn.init.uniform_(self.bias, -bound, bound)


class SENAModule(BaseModuleClass):

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Betten to have SENAVAE


# Load and process Gene Ontology pathway annotations for biological constraints

# Load gene-to-GO mapping file containing pathway memberships

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

can we wrap this whole part of files pre-processing into a util function? It should also check for correctness of files and their structures.
seems that we would only want a function that, given those 3 file links, we will produce rel_dict, go_map and gos that the model will use, and I want to separate the way to get them from the real init of the model.

perturbation_strings = adata.obs[perturbation_key].values

# Parse perturbation strings to extract unique intervention genes
for pert_str in perturbation_strings:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

There is more pre-processing here, can it fits in a function elsewhere? We want to keep the setup_anndata function to do just that....

@ori-kron-wis ori-kron-wis added the on-merge: backport to 1.4.x on-merge: backport to 1.4.x label Jan 15, 2026
@ori-kron-wis

Copy link
Copy Markdown
Collaborator Author

Hey @aperonalope , what is the status of the PR? Can we expect more commits to it?
Otherwise, could you please go over my comments here, review, and confirm correctness?
We can release it without docs or a tutorial, but they are very important for users to engage with the model.

@aperonalope

aperonalope commented Jan 21, 2026 via email

Copy link
Copy Markdown

@ori-kron-wis

Copy link
Copy Markdown
Collaborator Author

Hi Ori, Thanks for checking in. We’ve found a bug in the current implementation that affects the model’s behavior, so we’re looking into its impact and working on a fix. Once that’s resolved and things are stable, we’ll push additional commits to the PR. To avoid reviewing against a moving target, I’ll go through your comments and confirm them after the fix is in and the updated version is available. We agree that docs and a tutorial will be important for users, and we’ll plan to tackle those once the core implementation is finalized. Best, Alvaro El mié, 21 ene 2026 a las 8:30, Ori Kronfeld @.>) escribió:

ori-kron-wis left a comment (scverse/scvi-tools#3571) <#3571 (comment)> Hey @aperonalope https://github.com/aperonalope , what is the status of the PR? Can we expect more commits to it? Otherwise, could you please go over my comments here, review, and confirm correctness? We can release it without docs or a tutorial, but they are very important for users to engage with the model. — Reply to this email directly, view it on GitHub <#3571 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFJVIR4HEDNAOIF5ENSHM2L4H4TH7AVCNFSM6AAAAACJ4EXKJSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTONZWGU3TKOJRGY . You are receiving this because you were mentioned.Message ID: @.
>

Hi Alvaro, any new updates?

@ori-kron-wis ori-kron-wis added on-merge: backport to 1.5.x on-merge: backport to 1.5.x and removed on-merge: backport to 1.4.x on-merge: backport to 1.4.x labels Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

on-merge: backport to 1.5.x on-merge: backport to 1.5.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants