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

feat: nicheVI release #3172

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

feat: nicheVI release #3172

wants to merge 5 commits into from

Conversation

LevyNat
Copy link
Collaborator

@LevyNat LevyNat commented Feb 3, 2025

No description provided.

Copy link

codecov bot commented Feb 3, 2025

Codecov Report

Attention: Patch coverage is 72.60428% with 243 lines in your changes missing coverage. Please review.

Project coverage is 82.15%. Comparing base (bead49c) to head (50b3ff7).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...nal/nichevi/differential_expression/_classifier.py 21.33% 59 Missing ⚠️
src/scvi/external/nichevi/_module.py 67.44% 56 Missing ⚠️
src/scvi/external/nichevi/_model.py 74.76% 53 Missing ⚠️
src/scvi/external/nichevi/_components.py 65.51% 30 Missing ⚠️
...ernal/nichevi/differential_expression/_de_utils.py 73.33% 12 Missing ⚠️
...ternal/nichevi/differential_expression/_de_core.py 90.72% 9 Missing ⚠️
src/scvi/external/nichevi/_base_module.py 87.87% 8 Missing ⚠️
src/scvi/external/nichevi/_log_likelihood.py 75.00% 8 Missing ⚠️
src/scvi/external/nichevi/_vaemixin.py 84.37% 5 Missing ⚠️
...rnal/nichevi/differential_expression/_dataclass.py 84.21% 3 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (bead49c) and HEAD (50b3ff7). Click for more details.

HEAD has 53 uploads less than BASE
Flag BASE (bead49c) HEAD (50b3ff7)
56 3
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3172      +/-   ##
==========================================
- Coverage   89.43%   82.15%   -7.29%     
==========================================
  Files         185      199      +14     
  Lines       16182    17069     +887     
==========================================
- Hits        14473    14023     -450     
- Misses       1709     3046    +1337     
Files with missing lines Coverage Δ
src/scvi/external/__init__.py 100.00% <100.00%> (ø)
src/scvi/external/nichevi/__init__.py 100.00% <100.00%> (ø)
src/scvi/external/nichevi/_constants.py 100.00% <100.00%> (ø)
src/scvi/external/nichevi/_rnamixin.py 100.00% <100.00%> (ø)
...ternal/nichevi/differential_expression/__init__.py 100.00% <100.00%> (ø)
...rnal/nichevi/differential_expression/_dataclass.py 84.21% <84.21%> (ø)
src/scvi/external/nichevi/_vaemixin.py 84.37% <84.37%> (ø)
src/scvi/external/nichevi/_base_module.py 87.87% <87.87%> (ø)
src/scvi/external/nichevi/_log_likelihood.py 75.00% <75.00%> (ø)
...ternal/nichevi/differential_expression/_de_core.py 90.72% <90.72%> (ø)
... and 5 more

... and 27 files with indirect coverage changes

@ori-kron-wis ori-kron-wis changed the title code for nicheVI feat: nicheVI release Feb 3, 2025
Copy link
Collaborator

@ori-kron-wis ori-kron-wis Feb 4, 2025

Choose a reason for hiding this comment

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

please move this class into the _module.py file.
We cant have 2 base_module files in the codebase, very confusing.


Examples
--------
>>> loss_output = LossOutput(
Copy link
Collaborator

Choose a reason for hiding this comment

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

you meant "NicheLossOutput" (its the same as original now), please make sure

qkv = torch.cat([z_proj, cell_type_embedding], dim=2)
qkv = qkv.view(-1, qkv.size(2), qkv.size(3))

p = self.transformer_encoder(qkv)
Copy link
Collaborator

Choose a reason for hiding this comment

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

can the z.ndim be different than 2 or 3? in such case what will be the value of qkv?

raise ValueError("Must provide either n_obs_minibatch or reconstruction_loss")

default = 0 * self.loss
if self.reconstruction_loss is None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

seems to me those next lines can be simply re-written in a for loop of different attributes, all is going under same thing (but I guess we need to fix also original class)

Copy link
Collaborator

@ori-kron-wis ori-kron-wis Feb 4, 2025

Choose a reason for hiding this comment

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

a tutorial and model description doc are missing

Copy link
Collaborator

Choose a reason for hiding this comment

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

give better name for file

plt.show()


# def _fdr_de_prediction(posterior_probas: pd.Series, fdr: float = 0.05) -> pd.Series:
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is under comment please remove. we do not merge such things to main

Copy link
Collaborator

@ori-kron-wis ori-kron-wis Feb 4, 2025

Choose a reason for hiding this comment

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

this is also already exists for the main use of DE. why do we need to have this duplications?
Can't it be inherited from updated DE , init and adjusted locally with those parameters? will save alot of code.

nichevae.predict_niche_activation() # specific to nicheSCVI


def test_nichevi_differential(adata):
Copy link
Collaborator

Choose a reason for hiding this comment

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

except for the fact that it is actually running, dont you also want to verify the pytest to give us good results?

early_stopping=True,
check_val_every_n_epoch=1,
accelerator="cpu",
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would add to check if model is trained and several down stream analysis function you should use

@ori-kron-wis ori-kron-wis added the on-merge: backport to 1.2.x on-merge: backport to 1.2.x label Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on-merge: backport to 1.2.x on-merge: backport to 1.2.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants