Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Fits probabilistic scvi-tools models for single-cell omics: batch integration, annotation, CITE-seq, RNA/ATAC, and differential expression.
59% 95%+36 ptsof test cases passed
Passed 21 of 22 test cases with the skill, and 13 of 22 without it.
This test ran on v2. v3 is the current version and hasn’t been tested on gemini-3.6-flash yet.
3 of 3 safety checks passed
Not used yet
Targets scvi-tools 1.5.1. Specialized examples are illustrative and source-verified; see SKILL.md for the narrower set of native synthetic checks performed.
Both models require MuData. Their setup_anndata methods raise
NotImplementedError. Each methylation context (for example mCG, mCH) is a
modality containing a cells-by-regions matrix with two layers: methylated cytosine
counts and total coverage counts. Require integer 0 <= mc <= cov, shared cell
order and unique region IDs. Zero coverage means no observation, not an observed
unmethylated region; methylation ratios cannot replace the two count arrays.
import scvi
from mudata import MuData
# mcg_adata.layers['mc'] and ['cov'] have already been validated.
mdata = MuData({"mCG": mcg_adata})
mdata.obs["batch"] = mcg_adata.obs["batch"].reindex(mdata.obs_names)
scvi.external.METHYLVI.setup_mudata(
mdata, mc_layer="mc", cov_layer="cov",
methylation_contexts=["mCG"], batch_key="batch",
)
methylvi = scvi.external.METHYLVI(mdata)
methylvi.train()
mdata.obsm["X_MethylVI"] = methylvi.get_latent_representation()
methylation_by_context = methylvi.get_normalized_methylation()
mcg_estimates = methylvi.get_normalized_methylation(context="mCG")
The first methylation result is a dictionary keyed by context; specifying context
returns that context's array/DataFrame. Region/coverage QC must use coverage,
not the number of methylated counts, or it preferentially removes hypomethylated
regions. Default likelihood is beta-binomial; binomial is also supported. The
relevant dispersion setting is region/region-cell, not region_factors.
# Use a separate prepared MuData object for the semi-supervised example.
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.