Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Workflows for RNA-seq, GWAS, and variant calling in genomic research
.claude/skills/brycewang-stanford-genomics-analysis-guide/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 57% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 145% | 0% |
| case-22 | ✓→✓ | = Same ✓ | 153% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 140% | 0% |
| case-06 | ✓→✓ | = Same ✓ | 199% | 0% |
Genomic data analysis is the computational backbone of modern molecular biology. From identifying disease-associated variants through Genome-Wide Association Studies (GWAS) to quantifying gene expression with RNA-seq, these workflows transform raw sequencing data into biological insights that drive discoveries in medicine, agriculture, and evolutionary biology.
This guide covers the three most common genomic analysis workflows: RNA-seq differential expression analysis, GWAS for variant-trait associations, and variant calling from whole-genome sequencing (WGS) data. Each workflow is described with tool recommendations, command-line examples, and downstream analysis steps in R and Python.
The emphasis is on reproducibility and best practices. Genomic analyses involve many sequential steps, and errors in early stages propagate through the entire pipeline. Following standardized workflows -- like those from the Broad Institute, ENCODE, and Bioconductor -- reduces the risk of methodological errors.
Raw FASTQ files
|
v
[Quality Control] --> FastQC, MultiQC
|
v
[Trimming] --> Trimmomatic, fastp
|
v
[Alignment] --> STAR, HISAT2
|
v
[Quantification] --> featureCounts, Salmon
|
v
[Differential Expression] --> DESeq2, edgeR
|
v
[Pathway Analysis] --> clusterProfiler, GSEAbash# Run FastQC on all FASTQ files fastqc -t 8 -o qc_results/ raw_data/*.fastq.gz # Aggregate QC reports multiqc qc_results/ -o multiqc_report/
bash# fastp for quality trimming and adapter removal fastp \ --in1 sample_R1.fastq.gz \ --in2 sample_R2.fastq.gz \ --out1 trimmed_R1.fastq.gz \ --out2 trimmed_R2.fastq.gz \ --detect_adapter_for_pe \ --thread 8 \ --html fastp_report.html
bash# Build genome index (one time) STAR --runMode genomeGenerate \ --genomeDir star_index/ \ --genomeFastaFiles genome.fa \ --sjdbGTFfile annotations.gtf \ --runThreadN 16 # Align reads STAR --runMode alignReads \ --genomeDir star_index/ \ --readFilesIn trimmed_R1.fastq.gz trimmed_R2.fastq.gz \ --readFilesCommand zcat \ --outSAMtype BAM SortedByCoordinate \ --quantMode GeneCounts \ --outFileNamePrefix sample_ \ --runThreadN 16
rlibrary(DESeq2) # Load count matrix and sample info counts <- read.csv("gene_counts.csv", row.names = 1) coldata <- read.csv("sample_info.csv", row.names = 1) # Create DESeq2 object dds <- DESeqDataSetFromMatrix( countData = counts, colData = coldata, design = ~ condition ) # Filter low-count genes keep <- rowSums(counts(dds) >= 10) >= 3 dds <- dds[keep, ] # Run differential expression dds <- DESeq(dds) res <- results(dds, contrast = c("condition", "treated", "control"), alpha = 0.05) # Summary summary(res) # Export significant genes sig_genes <- subset(as.data.frame(res), padj < 0.05 & abs(log2FoldChange) > 1) write.csv(sig_genes, "significant_genes.csv")
Genotype Data (VCF/PLINK)
|
v
[Quality Control] --> Sample/variant filtering
|
v
[Population Stratification] --> PCA
|
v
[Association Testing] --> PLINK2, REGENIE
|
v
[Multiple Testing Correction] --> Bonferroni, FDR
|
v
[Visualization] --> Manhattan plot, QQ plotbash# Sample QC plink2 \ --bfile dataset \ --mind 0.05 \ # Remove samples with >5% missing --geno 0.02 \ # Remove variants with >2% missing --maf 0.01 \ # Remove rare variants (MAF < 1%) --hwe 1e-6 \ # HWE filter --make-bed \ --out dataset_qc # LD pruning for PCA plink2 \ --bfile dataset_qc \ --indep-pairwise 50 5 0.2 \ --out pruned # PCA for population stratification plink2 \ --bfile dataset_qc \ --extract pruned.prune.in \ --pca 10 \ --out pca_results
bash# Linear/logistic regression with covariates plink2 \ --bfile dataset_qc \ --glm \ --pheno phenotypes.txt \ --covar pca_results.eigenvec \ --covar-col-nums 3-12 \ --out gwas_results
pythonimport pandas as pd import matplotlib.pyplot as plt import numpy as np def manhattan_plot(gwas_file, output='manhattan.pdf'): df = pd.read_csv(gwas_file, sep='\t') df['-log10p'] = -np.log10(df['P']) # Assign cumulative positions df = df.sort_values(['CHR', 'BP']) df['pos_cum'] = 0 offset = 0 for chrom in df['CHR'].unique(): mask = df['CHR'] == chrom df.loc[mask, 'pos_cum'] = df.loc[mask, 'BP'] + offset offset = df.loc[mask, 'pos_cum'].max() fig, ax = plt.subplots(figsize=(16, 5)) colors = ['#3B82F6', '#94A3B8'] for i, chrom in enumerate(df['CHR'].unique()): subset = df[df['CHR'] == chrom] ax.scatter(subset['pos_cum'], subset['-log10p'], s=2, color=colors[i % 2], alpha=0.7) ax.axhline(-np.log10(5e-8), color='red', linestyle='--', linewidth=0.8) ax.set_xlabel('Chromosome') ax.set_ylabel('-log10(p-value)') fig.savefig(output, dpi=300, bbox_inches='tight')
bash# Mark duplicates gatk MarkDuplicates \ -I aligned.bam \ -O dedup.bam \ -M metrics.txt # Base quality score recalibration gatk BaseRecalibrator \ -I dedup.bam \ -R reference.fa \ --known-sites dbsnp.vcf \ -O recal_table.txt gatk ApplyBQSR \ -I dedup.bam \ -R reference.fa \ --bqsr-recal-file recal_table.txt \ -O recal.bam # Call variants gatk HaplotypeCaller \ -I recal.bam \ -R reference.fa \ -O variants.g.vcf \ -ERC GVCF
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-22 | pass→pass | 9,184 | 11,377 | +24% | 1 | 1 | 0% | 1,658 | 4,191 | +153% | 0 | 0 | — |
case-01 | fail→fail | 13,992 | 13,773 | -2% | 1 | 1 | 0% | 2,752 | 4,826 | +75% | 0 | 0 | — |
case-02 | fail→pass | 14,147 | 10,348 | -27% | 1 | 1 | 0% | 2,766 | 4,356 | +57% | 0 | 0 | — |
case-03 | fail→fail | 20,506 | 25,052 | +22% | 1 | 1 | 0% | 4,052 | 7,208 | +78% | 0 | 0 | — |
case-04 | pass→pass | 6,406 | 3,791 | -41% | 1 | 1 | 0% | 1,201 | 2,884 | +140% | 0 | 0 | — |
case-05 | fail→pass | 6,371 | 4,763 | -25% | 1 | 1 | 0% | 1,236 | 3,027 | +145% | 0 | 0 | — |
case-06 | pass→pass | 4,785 | 4,838 | +1% | 1 | 1 | 0% | 1,041 | 3,116 | +199% | 0 | 0 | — |
case-07 | pass→pass | 8,180 | 4,727 | -42% | 1 | 1 | 0% | 1,453 | 3,022 | +108% | 0 | 0 | — |
case-08 | fail→fail | 6,437 | 5,243 | -19% | 1 | 1 | 0% | 1,203 | 3,170 | +164% | 0 | 0 | — |
case-09 | pass→pass | 9,609 | 3,693 | -62% | 1 | 1 | 0% | 1,805 | 2,954 | +64% | 0 | 0 | — |
case-10 | pass→pass | 4,342 | 3,778 | -13% | 1 | 1 | 0% | 756 | 2,868 | +279% | 0 | 0 | — |
case-11 | pass→pass | 6,750 | 3,284 | -51% | 1 | 1 | 0% | 1,352 | 2,753 | +104% | 0 | 0 | — |
case-12 | pass→pass | 4,437 | 3,306 | -25% | 1 | 1 | 0% | 909 | 2,673 | +194% | 0 | 0 | — |
case-13 | pass→pass | 3,773 | 3,752 | -1% | 1 | 1 | 0% | 676 | 2,825 | +318% | 0 | 0 | — |
case-14 | pass→pass | 7,524 | 5,013 | -33% | 1 | 1 | 0% | 1,262 | 2,950 | +134% | 0 | 0 | — |
case-15 | pass→pass | 14,177 | 14,192 | +0% | 1 | 1 | 0% | 2,542 | 4,736 | +86% | 0 | 0 | — |
case-16 | pass→pass | 9,082 | 6,254 | -31% | 1 | 1 | 0% | 1,515 | 3,160 | +109% | 0 | 0 | — |
case-17 | pass→pass | 9,805 | 6,641 | -32% | 1 | 1 | 0% | 1,802 | 3,276 | +82% | 0 | 0 | — |
case-18 | pass→pass | 17,403 | 22,160 | +27% | 1 | 1 | 0% | 3,150 | 5,914 | +88% | 0 | 0 | — |
case-19 | pass→pass | 16,604 | 18,398 | +11% | 1 | 1 | 0% | 2,709 | 5,169 | +91% | 0 | 0 | — |
case-20 | pass→pass | 12,044 | 13,930 | +16% | 1 | 1 | 0% | 2,487 | 5,091 | +105% | 0 | 0 | — |
case-21 | pass→pass | 13,547 | 23,497 | +73% | 1 | 1 | 0% | 2,322 | 6,499 | +180% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +9 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.