scsilhouette.cli module
Command-line interface for scsilhouette.
This module provides CLI commands for computing silhouette scores and generating visualizations.
- scsilhouette.cli.compute_summary_stats_command(cluster_summary: Path = typer.Option, nsforest_results: Path | None = typer.Option, metadata: Path | None = typer.Option, cluster_header: str = typer.Option, organ: str = typer.Option, first_author: str = typer.Option, journal: str = typer.Option, year: str = typer.Option, embedding_key: str = typer.Option)
Compute dataset-level summary statistics from cluster summaries.
- scsilhouette.cli.compute_silhouette_command(h5ad_path: Path = typer.Option, cluster_header: str = typer.Option, embedding_key: str = typer.Option, organ: str = typer.Option, first_author: str = typer.Option, journal: str = typer.Option, year: str = typer.Option, dataset_version_id: str = typer.Option, organism: str = typer.Option, disease: str = typer.Option, use_binary_genes: bool = typer.Option, gene_list_path: Path | None = typer.Option, metric: str = typer.Option, filter_normal: bool = typer.Option, uberon: Path | None = typer.Option, disease_json: Path | None = typer.Option, hsapdv: Path | None = typer.Option, save_scores: bool = typer.Option, save_cluster_summary: bool = typer.Option, save_annotation: bool = typer.Option)
Compute silhouette scores for single-cell clusters.
- When –filter-normal is set, all three JSON files are required:
Tissue — tissue_ontology_term_id IN UBERON obo_ids (–uberon)
Disease — disease_ontology_term_id IN disease obo_ids (–disease)
- Age — development_stage_ontology_term_id IN HsapDv obo_ids (–hsapdv)
Age threshold is encoded in the JSON at resolve time.
Silhouette scores are computed on the filtered cell set only. Outputs are written to outputs_{organ}_{first_author}_{year}/.
- Example
scsilhouette compute-silhouette –h5ad-path data/dataset.h5ad –cluster-header cell_type –embedding-key X_umap –organ kidney –first-author Lake –journal Cell –year 2023 –dataset_version_id abcdefgh123456789 –filter-normal –uberon data/uberon_kidney.json –disease data/disease_normal.json –hsapdv data/hsapdv_adult_15.json
- scsilhouette.cli.viz_summary_command(silhouette_score_path: Path = typer.Option, silhouette_score_col: str = typer.Option, cluster_header: str = typer.Option, organ: str = typer.Option, first_author: str = typer.Option, journal: str = typer.Option, year: str = typer.Option, dataset_version_id: str = typer.Option, embedding_key: str = typer.Option, fscore_path: Path | None = typer.Option, sort_by: str = typer.Option, doi: str = typer.Option, collection_name: str = typer.Option, dataset_title: str = typer.Option, collection_url: str = typer.Option, explorer_url: str = typer.Option, h5ad_url: str = typer.Option)
Generate silhouette summary visualization with F-scores and dataset summary
- scsilhouette.cli.viz_2D_projection_command(h5ad_path: Path = typer.Option, embedding_key: str = typer.Option, cluster_header: str = typer.Option, organ: str = typer.Option, first_author: str = typer.Option, journal: str = typer.Option, year: str = typer.Option, dataset_version_id: str = typer.Option)
Generate embedding 2D projection colored by cluster
- scsilhouette.cli.viz_distribution_command(cluster_summary_path: Path = typer.Option, cluster_header: str = typer.Option, organ: str = typer.Option, first_author: str = typer.Option, journal: str = typer.Option, year: str = typer.Option, embedding: str = typer.Option, dataset_version_id: str = typer.Option)
Generate distribution plots of cluster sizes vs silhouette