Skip to content

Conversation

@Starlitnightly
Copy link
Contributor

from spateo.external.MERFISHVI import MERFISHVI  



MERFISHVI.setup_anndata(adata_concat, batch_key="batch")
MERFISHVI.setup_nonspatial_anndata(adata=adata_sc)

model = MERFISHVI(
    adata_spatial=adata_concat,
    adata_nonspatial=adata_sc,  # 可选的非空间模态
    n_hidden=128,
    n_latent=30,
    n_spatial=10
)

model.train(max_epochs=100)

gene_means = model.get_normalized_expression(
    n_samples=1,
    transform_batch="2000panel",
)
adata_concat.layers['Impute_2000'] = gene_means

gene_means = model.get_normalized_expression(
    n_samples=1,
    transform_batch="250panel",
)
adata_concat.layers['Impute_250'] = gene_means

adata_concat.obsm["X_MERFISHVI"] = model.get_latent_representation()

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces the MERFISHVI and SpatialVI functionality for processing AnnData objects while updating the logging module usage to force the standard library logging rather than a package-specific one. The key changes include:

  • Refactored logging in spateo/external/lack.py to use stdlib logging via _logging.
  • Added conditional import logic and fallback for MERFISHVI in spateo/external/init.py.
  • Introduced a new module spateo/external/MERFISHVI exposing MERFISHVI and SpatialSCVI.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

File Description
spateo/external/lack.py Updated logger to use _logging and fixed a redundant self parameter in a method.
spateo/external/init.py Added conditional import for MERFISHVI with a placeholder for missing deps.
spateo/external/MERFISHVI/init.py Newly created module exposing MERFISHVI and SpatialSCVI.
Comments suppressed due to low confidence (1)

spateo/external/lack.py:202

  • Removed the redundant self parameter in the call to info_insert_adata; please ensure the method signature now aligns correctly.
return self.info_insert_adata(key, adata_attr="var", indent_level=1, *args, **kwargs)

@YifanLu2000 YifanLu2000 merged commit 3722f7f into aristoteleo:main Jun 3, 2025
3 checks passed
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