omicverse/omicverse-skills/tcga-preprocessing
Claude Code and agent skill by omicverse/omicverse-skills
- community
Checking that the SKILL.md file is still in the repository.
TCGA bulk RNA-seq preprocessing with pyTCGA: GDC sample sheets, expression archives, clinical metadata, Kaplan-Meier survival analysis, and annotated AnnData export.
Install
npx vskill@latest install omicverse/omicverse-skills/tcga-preprocessingSKILL.md
TCGA Bulk Data Preprocessing with OmicVerse
Overview
Use this skill for loading TCGA data from GDC downloads, building normalised expression matrices, attaching clinical metadata, and running survival analyses through ov.bulk.pyTCGA.
Instructions
1. Gather required downloads
Confirm the user has three items from the GDC Data Portal:
gdc_sample_sheet.<date>.tsv— the sample sheet export- Decompressed
gdc_download_xxxxx/directory with expression archives clinical.cart.<date>/directory with clinical XML/JSON files
2. Initialise the TCGA helper
3. Persist and reload
4. Initialise metadata and survival
5. Run survival analysis
6. Export results
Critical API Reference
IMPORTANT: Method Name Spelling Inconsistency
The pyTCGA API has an intentional spelling inconsistency. Two methods use "survial" (missing the 'v') while one uses the correct "survival":
| Method | Spelling | Purpose | |
|---|---|---|---|
survial_init() | survial (no 'v') | Initialize survival metadata columns | |
survival_analysis(gene, layer, plot) | survival (correct) | Single-gene Kaplan-Meier curve | |
survial_analysis_all() | survial (no 'v') | Sweep all genes for survival significance |
Survival Analysis Methodology
survival_analysis() performs Kaplan-Meier analysis:
- Splits patients into high/low expression groups using the median as cutoff
- Computes a log-rank test p-value to assess significance
- If
plot=True, renders survival curves with confidence intervals
Layer selection matters: Use layer='deseq_normalize' (recommended) because DESeq2 normalization accounts for library size and composition bias, making expression comparable across samples. Alternative: layer='tpm' for TPM-normalized values.
Defensive Validation Patterns
Troubleshooting
- `AttributeError: 'pyTCGA' object has no attribute 'survival_init'`: Use the misspelled name
survial_init()(missing 'v'). Same forsurvial_analysis_all(). See Critical API Reference above. - `KeyError` during `adata_meta_init()`: Gene IDs in the expression matrix don't match expected format. TCGA uses ENSG IDs; the method maps them to symbols internally. Ensure archives are from the same GDC download.
- Empty survival plot or NaN p-values: Clinical XML files are missing date fields (days_to_death, days_to_last_follow_up). Check that the
clinical.cart.*directory contains complete XML files, not just metadata JSONs. - `survial_analysis_all()` runs very slowly: This tests every gene individually. For a genome with ~20,000 genes, expect 5-15 minutes. Consider filtering to genes of interest first.
- Sample sheet column mismatch: Verify the TSV uses tab separators and the header row matches GDC's expected format. Re-download from GDC if column names differ.
- Missing `deseq_normalize` layer: This layer is created during
adata_meta_init(). If absent, re-run the metadata initialization step.
Examples
- "Read my TCGA OV download, initialise metadata, and plot MYC survival curves using DESeq-normalised counts."
- "Reload a saved AnnData file, attach survival annotations, and export the updated
.h5ad." - "Run survival analysis for all genes and store the enriched dataset."
References
- Tutorial page: `t_tcga`
- Quick copy/paste commands: `reference.md`
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsrc/omicverse_skills/skills/tcga-preprocessing/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/omicverse/omicverse-skills/tcga-preprocessing)