agentleFS
Scientific-ToolingScientific-Tooling/structured-intelligence/skills/stat-nonlinear-embedding/SKILL.md

stat-nonlinear-embedding

Skill4 starsChanged 12 days agoMITView on GitHub

Embed high-dimensional data into 2D using t-SNE or UMAP for exploratory visualization of sample or cell relationships.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use stat-pca for linear embedding first, then this skill for refined visualization

    line 13
  2. Distinctive:

    Read data matrix or precomputed PCA coordinates.

    line 31
  3. Distinctive:

    If raw data: run PCA first (top 50 PCs) and use PCs as input to embedding (standard practice for large omics datasets).

    line 32
  4. Distinctive:

    If metadata provided: join embedding coordinates with metadata.

    line 35
  5. Distinctive:

    If no metadata: generate plain scatter plot.

    line 36
  6. Distinctive:

    Write embedding coordinates (TSV) and scatter plot (PDF) to output directory.

    line 38

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
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-pca for 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) or tsne
    • Input type: raw (default) or pca (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)

Workflow

  1. Read data matrix or precomputed PCA coordinates.
  2. If raw data: run PCA first (top 50 PCs) and use PCs as input to embedding (standard practice for large omics datasets).
  3. Fit t-SNE or UMAP using specified parameters and random seed.
  4. Extract 2D embedding coordinates for each sample/cell.
  5. If metadata provided: join embedding coordinates with metadata; generate scatter plot colored by specified column.
  6. If no metadata: generate plain scatter plot.
  7. Report: number of samples embedded, method and parameters used, runtime.
  8. Write embedding coordinates (TSV) and scatter plot (PDF) to output directory.
  9. Save the executable analysis script (analysis_code.py or analysis_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.py or analysis_code.R, plus session_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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.