← ClaudeAtlas

bulk-rnaseq-counts-to-de-deseq2listed

Run differential expression analysis on bulk RNA-seq count data with DESeq2 (R). Covers DESeqDataSet construction from a count matrix, tximport (Salmon/Kallisto), featureCounts, or SummarizedExperiment; pre-filtering; design formulas (simple, batch, paired, interaction, multi-factor, LRT); result extraction by coefficient or contrast; log-fold-change shrinkage (apeglm/ashr); VST/rlog transformations; and exporting significant genes. Use when the user has RNA-seq counts and wants differential expression, DE genes, volcano/MA inputs, or a DESeq2 workflow.
hossainlab/omics-skills · ★ 0 · Data & Documents · score 68
Install: claude install-skill hossainlab/omics-skills
# DESeq2 Comprehensive Reference Complete code patterns for DESeq2 differential expression analysis. Adapt these examples to your experimental design. **Decision-making:** see `decision-guide.md` | **Errors:** see `troubleshooting.md` ## Complete Standard Workflow ```r library(DESeq2) library(apeglm) # 1. Create DESeqDataSet dds <- DESeqDataSetFromMatrix(countData = counts, colData = coldata, design = ~ condition) # 2. Pre-filter low counts keep <- rowSums(counts(dds)) >= 10 dds <- dds[keep,] # 3. Set reference level dds$condition <- relevel(dds$condition, ref = 'control') # 4. Run DESeq2 pipeline dds <- DESeq(dds) # 5. Extract results res <- results(dds) # 6. Apply LFC shrinkage resLFC <- lfcShrink(dds, coef = 'condition_treated_vs_control', type = 'apeglm') # 7. Get significant genes sig <- subset(res, padj < 0.05 & abs(log2FoldChange) > 1) ``` ## Design Formulas ### Simple Two-Group ```r design = ~ condition ``` Use: Single factor, no batch effects, most common starting point. ### Batch Correction ```r design = ~ batch + condition ``` Use: Multiple sequencing runs, PCA shows batch clustering. Requirement: each condition must have samples in each batch (not confounded). ### Paired Samples ```r design = ~ individual + condition ``` Use: Before/after treatment, tumor vs normal from same patient. Benefit: controls individual variation, increases power. ### Interaction ```r design = ~ genotype * treatment # Expands to: ~ genotype + treatment + genotype:tr