PYPI PACKAGE AUDIT v0.8.0 Healthy Package

sampledisco

Cross-omics, cross-condition sample embedding for single-cell data (RNA, ATAC, multi-omics)

PyPkgScore sampledisco
Methodology & Criteria โ™ฅ Donate
720 / 1000
Quick Install
pip install sampledisco
1. Governance
50/200
2. PEP Metadata
200/200
3. Security
150/200
4. Docs & SEO
155/200
5. CI Engineering
165/200
๐Ÿ“ฃ Share Audit: Share this report and visual preview in the current language
Advertisement
PYPI TELEMETRY

Downloads & Community Adoption

Last 30 days (without mirrors)
Last 7 days
334
Last 30 days
530
Total (180 days)
3648
Metric / Ecosystem Status / Value Source
Downloads (30d / 180d) โ€” PyPI Stats (without mirrors)
Trusted Publishing (PEP 740) โœ• Not detected PyPI Integrity / Sigstore
Django Packages โ€” djangopackages.org
PyTech / PyPkgScore 720 / 1000 PyPkgScore Engine

Health & Engineering Analysis (5 Pillars)

1. Governance & Community50 / 200 โ–พ
LICENSEโœ“ 50 pts
SECURITY.mdโœ• 0 pts
CONTRIBUTING.mdโœ• 0 pts
CODE_OF_CONDUCT.mdโœ• 0 pts
2. PEP Metadata & Packaging200 / 200 โ–พ
Wheel (.whl)โœ“ 50 pts
pyproject.tomlโœ“ 50 pts
Project URLsโœ“ 50 pts
Trove Classifiersโœ“ 50 pts
3. Security & Supply Chain150 / 200 โ–พ
Zero CVEs (OSV)โœ“ 60 pts
Trusted Publishing (OIDC)โœ• 0 pts
Snyk / Audit Linkโœ“ 40 pts
HTTPS Repositoryโœ“ 50 pts
4. Documentation, SEO & Ecosystem155 / 200 โ–พ
Structured READMEโœ“ 60 pts
Read the Docsโœ“ 50 pts
Django Packagesโœ• 0 pts
Website / Technical Articlesโœ“ 45 pts
5. Engineering, CI & Quality165 / 200 โ–พ
Automated Testsโœ“ 65 pts
GitHub Actions CIโœ“ 65 pts
CHANGELOG.mdโœ“ 35 pts
Env & Lockfile (uv/rye/poetry/pdm/hatch)โœ• 0 pts
Advertisement
README & DOCS

Official Documentation & Usage Guide โ€” sampledisco

PyPI Metadata v0.8.0
Show full original documentation (English README) โ–พ

SampleDisco

A cross-omics, cross-condition sample embedding tool for single-cell data.

SampleDisco takes a cell-level embedding (from any standard scRNA / scATAC / multi-omics integration method) and lifts it to a sample-level embedding that captures both cell-type composition and the per-cell-type state of each sample. Every downstream analysis โ€” sample-to-sample distance, clustering, trajectory inference, phenotype association โ€” then runs on that single shared sample embedding, regardless of modality.

Documentation and tutorial: https://j041120h.github.io/SampleDisco_tutorial/


What the method does

For each modality (RNA, ATAC, or integrated multi-omics) the pipeline produces two cell-level views:

Key Role Source
Z_comp sample-removed embedding โ€” used for cell typing and the composition blocks Harmony (single-omics) / Harmony post-pass on scGLUE (multi-omics)
Z_rmd sample-preserved embedding โ€” used for the reference-relative mean displacement (RMD) block second Harmony pass (single-omics) / scGLUE primary output (multi-omics)

It then assembles four blocks per sample (or per sample ร— modality for multi-omics):

  1. A1 โ€” one-hot cell-type composition
  2. A2 โ€” soft k-means composition at K_med (โ‰ˆ120)
  3. A3 โ€” soft k-means composition at K_fine (โ‰ˆ300)
  4. RMD โ€” leave-one-out cell-type-resolved displacement on Z_rmd

The four blocks are inverse-variance weighted, Frobenius-stacked, PCA-reduced to 10 dimensions (at most the number of samples โˆ’ 1), and Harmony-corrected at sample level when there are at least 8 samples in more than one batch / modality group. The result is stored as adata.uns['X_DR_sample'] and feeds every downstream module.


Repository layout

./
โ”œโ”€โ”€ pyproject.toml                 # package metadata; `pip install -e .` installs the `sampledisco` command
โ”œโ”€โ”€ config/                        # 10 YAML configs for the paper's datasets: covid / blood (1M-scBloodNL) / eye / heart / ENCODE / healthy-aging PBMC / long_covid / unpaired (+ RNA-tuned) / default
โ”œโ”€โ”€ src/sampledisco/               # the package
โ”‚   โ”œโ”€โ”€ cli.py                     # `sampledisco` command: `-m complex --config <yaml>`, `--init-config <path>`
โ”‚   โ”œโ”€โ”€ config/config_demo.yaml    # demo config written by `sampledisco --init-config`
โ”‚   โ”œโ”€โ”€ wrapper/                   # Orchestration
โ”‚   โ”‚   โ”œโ”€โ”€ wrapper.py             # Master wrapper; gates RNA + ATAC + multiomics + shared downstream
โ”‚   โ”‚   โ”œโ”€โ”€ rna_wrapper.py
โ”‚   โ”‚   โ”œโ”€โ”€ atac_wrapper.py
โ”‚   โ”‚   โ””โ”€โ”€ multiomics_wrapper.py
โ”‚   โ”œโ”€โ”€ preparation/               # Preprocessing
โ”‚   โ”‚   โ”œโ”€โ”€ rna_preprocess_{cpu,gpu}.py   # QC โ†’ HVG โ†’ PCA โ†’ dual Harmony โ†’ Z_comp + Z_rmd
โ”‚   โ”‚   โ”œโ”€โ”€ atac_preprocess_{cpu,gpu}.py  # QC โ†’ TF-IDF โ†’ HVF โ†’ LSI โ†’ dual Harmony โ†’ Z_comp + Z_rmd
โ”‚   โ”‚   โ”œโ”€โ”€ cell_type_{cpu,gpu}.py        # Leiden clustering on Z_comp (RNA or ATAC)
โ”‚   โ”‚   โ”œโ”€โ”€ ATAC_cell_type{,_gpu}.py      # ATAC-specific cell typing variants
โ”‚   โ”‚   โ”œโ”€โ”€ multi_omics_glue.py           # scGLUE integration (cross-modality VAE + guidance graph)
โ”‚   โ”‚   โ”œโ”€โ”€ multi_omics_batch_correction.py # Harmony post-pass on X_glue โ†’ Z_comp
โ”‚   โ”‚   โ”œโ”€โ”€ multi_omics_merge.py          # post-GLUE merge + per-modality preprocess/slimming
โ”‚   โ”‚   โ””โ”€โ”€ multi_omics_cell_type_{cpu,gpu}.py  # RNA-Leiden + k-NN label transfer to ATAC
โ”‚   โ”œโ”€โ”€ sample_embedding/          # Core method
โ”‚   โ”‚   โ”œโ”€โ”€ blocks.py              # composition, RMD, weighting, Frobenius stack, final PCA + Harmony
โ”‚   โ”‚   โ”œโ”€โ”€ sample_embedding.py    # CPU pipeline
โ”‚   โ”‚   โ””โ”€โ”€ sample_embedding_gpu.py # GPU pipeline (cuML + cupy)
โ”‚   โ”œโ”€โ”€ parameter_selection/
โ”‚   โ”‚   โ””โ”€โ”€ autotune.py            # Bayesian GP sweep over RMD ฮฑ; adaptive proxy ensemble
โ”‚   โ”œโ”€โ”€ sample_distance/           # Pairwise sample distances (DR / EMD / chi-square / JS)
โ”‚   โ”œโ”€โ”€ sample_clustering/         # K-means sample clusters, proportion test, RAISIN cluster DGE
โ”‚   โ”œโ”€โ”€ sample_trajectory/         # CCA (supervised) and TSCAN (unsupervised) + GAM-based trajectory DGE
โ”‚   โ”œโ”€โ”€ sample_association/        # Per-PC variance explained vs sample-level covariates (permutation FDR)
โ”‚   โ”œโ”€โ”€ sample_prediction/         # Cross-validated phenotype prediction from the PCs; kNN label transfer
โ”‚   โ”œโ”€โ”€ visualization/             # Embedding plots, dendrograms, DGE volcanos, modality-aware multi-omics scatters
โ”‚   โ”œโ”€โ”€ utils/                     # Shared helpers: seed, safe h5ad I/O, limma, TF-IDF, batch regress, Grouping
โ”‚   โ””โ”€โ”€ gene_activity/             # ATAC peak โ†’ gene activity inference + RNA-ATAC validation
โ”œโ”€โ”€ Benchmark_covid/, Benchmark_multiomics/  # benchmark drivers used for the paper
โ””โ”€โ”€ claude/                        # one-off run scripts (rerun launchers, monitored runs, parameter sweeps)

Usage

Run โ€” YAML-driven

sampledisco -m complex --config config/config.yaml     # same as: python -m sampledisco.cli -m complex --config ...

The YAML drives every flag and parameter for all three pipelines:

  • Pipeline gates (top-level): run_rna_pipeline, run_atac_pipeline, run_multiomics_pipeline
  • Per-modality phase gates (Phase 1): *_preprocessing, *_cell_type_cluster, *_derive_sample_embedding
  • Per-modality downstream gates (Phase 2): *_sample_distance_calculation, *_trajectory_analysis, *_trajectory_dge, *_sample_cluster, *_proportion_test, *_cluster_dge, *_visualize_data, *_dimension_association_analysis
  • Multi-omics-specific: multiomics_run_glue_*, multiomics_treat_sample_as_batch, multiomics_run_glue_twice_for_sample_removal

The 10 ready-to-use configs in config/ are point-in-time snapshots for the datasets used in the paper; copy one and adjust paths / column names for your own data.

Starter config

sampledisco --init-config my_config.yaml

writes the demo config (tuned for the Zenodo demo dataset) to my_config.yaml. The YAML is validated against every wrapper() parameter, so edit values rather than deleting keys.


Inputs

A standard scanpy AnnData file with at minimum:

  • .X โ€” count matrix (genes for RNA, peaks for ATAC)
  • .obs['sample'] โ€” sample column (required)
  • Optional: .obs['batch'], .obs['cell_type'], sample-level metadata file (CSV) to merge

For multi-omics, the pipeline takes two separate h5ads (RNA + ATAC) and integrates them via scGLUE; samples may be paired (1:1 cell correspondence) or unpaired.


Outputs (under output_dir)

<output_dir>/
โ”œโ”€โ”€ rna/
โ”‚   โ”œโ”€โ”€ preprocess/adata_preprocessed.h5ad
โ”‚   โ”œโ”€โ”€ sample_embedding/sample_embedding.csv
โ”‚   โ”œโ”€โ”€ Sample_distance/{cosine,correlation}/*
โ”‚   โ”œโ”€โ”€ CCA/  or  TSCAN/                       # whichever trajectory mode
โ”‚   โ”œโ”€โ”€ trajectoryDEG/
โ”‚   โ”œโ”€โ”€ sample_cluster/{kmeans_*,proportion_test/}
โ”‚   โ”œโ”€โ”€ sample_association/variance_explained_sample.csv + figures/
โ”‚   โ””โ”€โ”€ visualization/*.png
โ”œโ”€โ”€ atac/   (parallel structure)
โ”œโ”€โ”€ multiomics/
โ”‚   โ”œโ”€โ”€ integration/glue/{rna-pp,atac-pp,guidance.graphml.gz}
โ”‚   โ”œโ”€โ”€ preprocess/adata_sample.h5ad           # post-GLUE merged adata with Z_comp + Z_rmd
โ”‚   โ”œโ”€โ”€ sample_embedding/sample_embedding.csv
โ”‚   โ””โ”€โ”€ (same downstream subdirs as single-omics)
โ””โ”€โ”€ sys_log/main_process_status.json           # which stages completed

Installation

One conda environment runs every part of the package: the RNA / ATAC / multi-omics pipelines, scGLUE training (with bedtools), MaxFuse and all downstream analyses.

# CPU (recommended)
conda env create -f environment-cpu.yml && conda activate sampledisco-cpu

# GPU (Linux + NVIDIA): the CPU environment + RAPIDS 24.12
conda env create -f environment-gpu.yml && conda activate sampledisco-gpu
pip install --no-deps rapids-singlecell==0.13.1 sampledisco==0.8.0

# pip only
conda create -n sampledisco -c conda-forge -c bioconda python=3.10 pip bedtools && conda activate sampledisco
pip install "sampledisco[all]"

pip install sampledisco alone gives the core pipeline; the extras [glue], [maxfuse] and [all] add scGLUE and MaxFuse. GPU acceleration runs only with use_gpu: true in the config (otherwise, or when RAPIDS is missing, the CPU path runs). See INSTALL.md for the version pins, driver notes and troubleshooting.