stat-nonlinear-embedding
Embed high-dimensional data into 2D using t-SNE or UMAP for exploratory visualization of sample or cell relationships.
- License 许可
- MIT
- 最近更新
- 2026-11-03
- Stars
- ★ 4
- Forks
- 1
01 前言 Front Matter
- name
- stat-nonlinear-embedding
- description
- Embed high-dimensional data into 2D using t-SNE or UMAP for exploratory visualization of sample or cell relationships.
02 资源文件 3
- 参考文档agents/claude.yaml344 B
- 参考文档agents/openai.yaml345 B
- 参考文档config.yaml311 B
03 SKILL.md 正文
Skill: Nonlinear Dimensionality Reduction
Use When
- User wants to visualize cell populations or sample clusters in 2D after scRNA-seq, flow cytometry, or omics analysis
- User wants a t-SNE or UMAP plot colored by cell type, cluster, or metadata
- User needs a nonlinear embedding that preserves local neighborhood structure
- Use
stat-pcafor linear embedding first, then this skill for refined visualization
Inputs
- Required:
- Data matrix (CSV or TSV): rows = samples/cells, columns = features; OR a precomputed PCA coordinate table
- Optional:
- Embedding method:
umap(default) ortsne - Input type:
raw(default) orpca(precomputed PC coordinates) - For t-SNE: perplexity (default:
30), max iterations (default:1000), learning rate (default:200) - For UMAP: n_neighbors (default:
15), min_dist (default:0.1), metric (default:euclidean) - Metadata table (CSV or TSV) for coloring the plot
- Color-by column from metadata
- Random seed (default:
42) - Output directory (default:
./embedding_output)
- Embedding method:
Workflow
- Read data matrix or precomputed PCA coordinates.
- If raw data: run PCA first (top 50 PCs) and use PCs as input to embedding (standard practice for large omics datasets).
- Fit t-SNE or UMAP using specified parameters and random seed.
- Extract 2D embedding coordinates for each sample/cell.
- If metadata provided: join embedding coordinates with metadata; generate scatter plot colored by specified column.
- If no metadata: generate plain scatter plot.
- Report: number of samples embedded, method and parameters used, runtime.
- Write embedding coordinates (TSV) and scatter plot (PDF) to output directory.
- Save the executable analysis script (
analysis_code.pyoranalysis_code.R) and software version manifest (session_info.txt) used to produce results.
Output Contract
- Embedding coordinates (TSV): sample_id, dim1, dim2
- Scatter plot (PDF): 2D embedding colored by metadata or uniform color
- Parameters used (printed to stdout): method, all hyperparameters, random seed
- Reproducibility artifacts:
analysis_code.pyoranalysis_code.R, plussession_info.txt
Limits
- t-SNE and UMAP are non-deterministic (set seed for reproducibility); results vary with hyperparameters.
- t-SNE distances between clusters are not interpretable — use only for local structure visualization.
- UMAP better preserves global structure than t-SNE and is generally faster.
- Both methods are sensitive to the scale of input data; ensure PCA pre-processing for high-dimensional input.
- Common failure: memory error for very large inputs (> 100k cells) — subsample or use approximate UMAP.
04 同仓库更多 Skills
structured-intelligence-skill-creator
Create or update repository skills that conform to local templates, provider metadata requirements, registry rules, and validation workflows.
stat-survival-analysis
Estimate and compare survival functions using Kaplan-Meier curves and log-rank test, with optional Cox proportional hazards regression.
stat-pca
Perform PCA on a numeric data matrix to reduce dimensionality, visualize sample structure, and identify top contributing features.
stat-pairwise-correlation
Compute pairwise correlations and significance tests across all numeric variables, and produce a correlation heatmap.
stat-logistic-regression
Fit a logistic regression model for binary outcomes, report odds ratios and model performance (AUC-ROC, confusion matrix).
stat-learn-bayesian-network
Learn the structure and conditional probabilities of a Bayesian network from observational data for causal discovery or dependency modeling.