Release/0.3.0#34
Merged
Merged
Conversation
Reshape the user-facing API around a single MuData input and
mdata.obsm output keys. New entry points:
- MIDAS.setup_mudata(mdata, batch_key=...) registers data setup info
on the MuData (mdata.uns['_scmidas']) and replaces the previous
class-level state mutation.
- MIDAS(mdata, configs=..., batch_size=...) constructs the model
directly from a registered MuData. Instance state instead of
class-level state — fixes a bug where two MIDAS() instances in one
process would clobber each other.
- model.get_latent_representation(kind='c'|'u'|'joint') and
model.get_imputed_values(modality=...) return arrays aligned to
mdata.obs_names, ready for direct assignment to mdata.obsm /
mdata.layers.
- model.save(dir) / MIDAS.load(dir, mdata) write/read a model.pt +
setup.json pair.
- scmidas.datasets.from_dir(dir_path, label_dir=...) loads the
directory-format datasets (mat/<m>.mtx, mask/<m>.csv,
feat/feat_dims.toml) into a MuData, including per-batch masks,
cell labels, and ATAC chromosome chunk dims.
- scmidas.pl.umap(mdata, basis='X_midas', color=[...]) and
scmidas.pl.modality_grid(model, mdata, label_key=...) wrap the
common visualizations as one-call helpers and route through a thin
AnnData wrapper to side-step the current scanpy + MuData plotting
limitations.
- ATAC binarization is now applied by default whenever 'atac' is
among the modalities; pass transform={'atac': None} to opt out.
scmidas.integrate() now uses the new path internally and writes the
joint biological latent to mdata.obsm['X_midas'] (configurable via
key_added).
Backwards compatibility:
- MIDAS.configure_data_from_mdata and MIDAS.configure_data_from_dir
still work — they emit a DeprecationWarning and will be removed
in 0.4.0.
- save_checkpoint / load_checkpoint still work; new code should use
save / load.
Other fixes:
- predict(joint_latent=False) no longer raises KeyError: 'z_c'.
15 new pytest cases pin the new API surface (setup, construct,
multi-instance independence, latent/imputation shapes, save/load
round-trip, deprecation warning).
Tutorials: - New preparing_your_data.ipynb walks from a public 10x Genomics 5k PBMC CITE-seq sample through QC, HVG selection, MuData wrap, MIDAS integration, Leiden clustering, and a synthetic mosaic example. Single-file Python pipeline; ~5 min on a mid-range GPU. - Merge inputs.rst + outputs.rst into a single data_layout.rst that describes the MuData input/output contract. The directory format is moved to an "Advanced" subsection. - Rewrite demo1, demo2, demo3 to use the new API: scmidas.datasets.from_dir(...) -> setup_mudata -> MIDAS(mdata) -> get_latent_representation. The 22-line per-modality grid block in each demo collapses to scmidas.pl.modality_grid(model, mdata). Each demo gains a 6.4 "After integration" section showing Leiden + UMAP on mdata.obsm['X_midas']. - examples/quickstart.ipynb uses scmidas.pl.umap and a 5-line scanpy-friendly downstream. - Rewrite advanced/tensorboard.rst and advanced/development_instructions.rst to use the new API; the "Adding a new modality" section is reorganized into two clear steps (configs, then registry registration) with a concrete asinh5 example for transform_registry. - tutorials/basics/index.rst toctree leads with preparing_your_data and data_layout, then the three demos. API reference: - New scmidas.api.rst, scmidas.datasets.rst, scmidas.plot.rst. - modules_index.rst toctree updated. README: - Quick start uses the new API (sc.pp.neighbors(use_rep='X_midas')). - New "Bring your own data" section linking the preparing_your_data tutorial and the data_layout reference.
See docs/source/release.md for the full v0.3.0 entry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Type of change
Checklist
pytest tests/passes locally.docs/source/release.mdupdated under the next version heading.Related issues