RNA API¶
The RNA branch of SampleDisco takes a cell-level .h5ad with raw counts and turns it into a single sample-level embedding (uns['X_DR_sample']). Two RNA-specific functions live in this section; sample embedding is shared across modalities and lives under Shared.
| Function | Purpose |
|---|---|
preprocess |
QC filter, normalize, log-transform, select HVGs, PCA, 2-pass Harmony. Writes one adata_preprocessed.h5ad carrying obsm['Z_clust'] (sample-removed) and obsm['Z_rmd'] (sample-preserved). |
cell_types |
Leiden clustering on the sample-removed Z_clust embedding, with optional adaptive resolution tuning to hit a target cluster count and optional UMAP. Writes labels into .obs["cell_type"]. |
Shared with ATAC¶
compute_sample_embedding— composition blocks onZ_clust+ RMD displacement block onZ_rmd, reduced to the single keyuns['X_DR_sample'].run_autotune— parameter selection: optimizes the RMD-weight α (composition vs displacement), enabled via therna_autotune_enableflag in the config-driven wrapper.
Typical order¶
preprocess
└─> cell_types
└─> compute_sample_embedding
└─> downstream analyses (see Downstream section)
For a runnable walkthrough, see the RNA tutorial.