stat-pca
Skill4 starsChanged 12 days agoMITView on GitHub
Perform PCA on a numeric data matrix to reduce dimensionality, visualize sample structure, and identify top contributing features.
In this repository56 other files it gives its agents.
- bioinformatics-env-setupSkill
- design-thermostable-mutationsSkill
- download-gdcSkill
- download-geoSkill
- download-sraSkill
- source-summarizerSkill
- genome-alignment-qcSkill
- genome-read-alignmentSkill
- genome-variant-annotationSkill
- genome-variant-callingSkill
- genome-variant-filteringSkill
- metagenome-assemblySkill
- metagenome-binningSkill
- metagenome-functional-profilingSkill
- metagenome-host-removalSkill
- metagenome-taxonomic-profilingSkill
- ncbi-eutilities-assistantSkill
- ngs-quality-controlSkill
- ngs-read-preprocessingSkill
- paper-to-briefSkill
- predict-protein-heat-stabilitySkill
- researchSkill
- rnaseq-alignment-qcSkill
- rnaseq-differential-expressionSkill
- rnaseq-functional-enrichmentSkill
- rnaseq-read-alignmentSkill
- rnaseq-read-countingSkill
- rnaseq-transcript-quantificationSkill
- rpsblast-assistantSkill
- scrnaseq-cellranger-countSkill
- scrnaseq-cell-type-annotationSkill
- scrnaseq-clusteringSkill
- scrnaseq-differential-expressionSkill
- scrnaseq-integrationSkill
- scrnaseq-quality-controlSkill
- scrnaseq-trajectory-analysisSkill
- search-enaSkill
- search-geoSkill
- search-gsaSkill
- search-ncbi-datasetsSkill
- search-sraSkill
- stat-analyze-distributionSkill
- stat-assess-data-qualitySkill
- stat-bayesian-estimationSkill
- stat-cluster-samplesSkill
- stat-compare-multiple-groupsSkill
- stat-compare-two-groupsSkill
- stat-fit-glmSkill
- stat-fit-linear-modelSkill
- stat-learn-bayesian-networkSkill
- stat-logistic-regressionSkill
- stat-nonlinear-embeddingSkill
- stat-pairwise-correlationSkill
- stat-survival-analysisSkill
- structured-intelligence-skill-creatorSkill
- <skill-id>Skill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 29
Read data matrix; orient so rows = samples.
- Distinctive: line 30
Check for and remove zero-variance features.
- Distinctive: line 37
Write PC coordinates (TSV), loadings (TSV), variance explained (TSV), scree plot (PDF), and PCA scatter plot (PDF) to output directory.
≈ “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.
Files
Skill: Principal Component Analysis
Use When
- User wants to explore sample structure or batch effects in high-dimensional data (RNA-seq, proteomics, metabolomics)
- User needs dimensionality reduction before clustering or modeling
- User wants to identify which features (genes, proteins) drive sample separation
- User wants a PCA plot colored by sample metadata
Inputs
- Required:
- Data matrix (CSV or TSV): rows = samples, columns = features (or transposed — specify orientation)
- Optional:
- Matrix orientation:
samples_as_rows(default) orsamples_as_columns - Number of PCs to compute (default:
10or min(n_samples, n_features)) - Metadata table (CSV or TSV) with sample annotations for plot coloring (must share sample IDs)
- Color-by column from metadata (default: first metadata column)
- Scale features before PCA:
true(default) orfalse - Output directory (default:
./pca_output)
- Matrix orientation:
Workflow
- Read data matrix; orient so rows = samples.
- Check for and remove zero-variance features; log-transform if all values are non-negative and range > 100 (log1p).
- Center and optionally scale features (z-score standardization).
- Compute PCA using singular value decomposition.
- Report variance explained per PC; plot scree plot.
- Extract sample coordinates on PC1–PC10 and feature loadings on PC1–PC5.
- Plot PC1 vs. PC2 scatter; if metadata provided, color by specified annotation column; label outlier samples.
- Report top 20 features with highest absolute loading on PC1 and PC2.
- Write PC coordinates (TSV), loadings (TSV), variance explained (TSV), scree plot (PDF), and PCA 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
- PC coordinates table (TSV): sample_id, PC1, PC2, ..., PC10
- Feature loadings table (TSV): feature_id, PC1_loading, PC2_loading, ..., PC5_loading
- Variance explained table (TSV): PC, variance_explained, cumulative_variance
- Scree plot (PDF)
- PCA scatter plot (PDF, PC1 vs. PC2)
- Reproducibility artifacts:
analysis_code.pyoranalysis_code.R, plussession_info.txt
Limits
- PCA is a linear method; nonlinear structure may not be captured — use
stat-nonlinear-embeddingfor t-SNE/UMAP. - Features must outnumber the number of components requested; otherwise reduce n_components.
- Scaling is critical when features have different units or dynamic ranges.
- Common failure: sample ID mismatch between data matrix and metadata table.
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
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.

