Bio Geo Data
GPTomics/bioSkills
Query and download from NCBI Gene Expression Omnibus (GEO) and EMBL-EBI's BioStudies/ArrayExpress mirror.
Bulk RNA-seq DE with R/Bioconductor DESeq2. An agent skill from jaechang-hits/SciAgent-Skills.
$ npx skills add jaechang-hits/SciAgent-Skills --skill deseq2-differential-expression -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install jaechang-hits/SciAgent-Skills deseq2-differential-expression --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/jaechang-hits/SciAgent-Skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/genomics-bioinformatics/rnaseq/deseq2-differential-expression .claude/skills/deseq2-differential-expression && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "deseq2-differential-expression" agent skill from https://github.com/jaechang-hits/SciAgent-Skills/tree/main/skills/genomics-bioinformatics/rnaseq/deseq2-differential-expression into .claude/skills/deseq2-differential-expression/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "deseq2-differential-expression", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/jaechang-hits/SciAgent-Skills/tree/main/skills/genomics-bioinformatics/rnaseq/deseq2-differential-expressionType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add jaechang-hits/SciAgent-Skills --skill deseq2-differential-expression -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install jaechang-hits/SciAgent-Skills deseq2-differential-expression --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jaechang-hits/SciAgent-Skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/genomics-bioinformatics/rnaseq/deseq2-differential-expression .agents/skills/deseq2-differential-expression && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "deseq2-differential-expression" agent skill from https://github.com/jaechang-hits/SciAgent-Skills/tree/main/skills/genomics-bioinformatics/rnaseq/deseq2-differential-expression into .agents/skills/deseq2-differential-expression/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "deseq2-differential-expression", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jaechang-hits/SciAgent-Skills --skill deseq2-differential-expression -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install jaechang-hits/SciAgent-Skills deseq2-differential-expression --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jaechang-hits/SciAgent-Skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/genomics-bioinformatics/rnaseq/deseq2-differential-expression .cursor/skills/deseq2-differential-expression && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "deseq2-differential-expression" agent skill from https://github.com/jaechang-hits/SciAgent-Skills/tree/main/skills/genomics-bioinformatics/rnaseq/deseq2-differential-expression into .cursor/skills/deseq2-differential-expression/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "deseq2-differential-expression", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/jaechang-hits/SciAgent-Skills.git --path skills/genomics-bioinformatics/rnaseq/deseq2-differential-expression--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add jaechang-hits/SciAgent-Skills --skill deseq2-differential-expression -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install jaechang-hits/SciAgent-Skills deseq2-differential-expression --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jaechang-hits/SciAgent-Skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/genomics-bioinformatics/rnaseq/deseq2-differential-expression .gemini/skills/deseq2-differential-expression && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "deseq2-differential-expression" agent skill from https://github.com/jaechang-hits/SciAgent-Skills/tree/main/skills/genomics-bioinformatics/rnaseq/deseq2-differential-expression into .gemini/skills/deseq2-differential-expression/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "deseq2-differential-expression", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install jaechang-hits/SciAgent-Skills deseq2-differential-expressionInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add jaechang-hits/SciAgent-Skills --skill deseq2-differential-expression -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/jaechang-hits/SciAgent-Skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/genomics-bioinformatics/rnaseq/deseq2-differential-expression .github/skills/deseq2-differential-expression && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "deseq2-differential-expression" agent skill from https://github.com/jaechang-hits/SciAgent-Skills/tree/main/skills/genomics-bioinformatics/rnaseq/deseq2-differential-expression into .github/skills/deseq2-differential-expression/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "deseq2-differential-expression", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jaechang-hits/SciAgent-Skills --skill deseq2-differential-expression -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install jaechang-hits/SciAgent-Skills deseq2-differential-expression --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jaechang-hits/SciAgent-Skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/genomics-bioinformatics/rnaseq/deseq2-differential-expression .opencode/skills/deseq2-differential-expression && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "deseq2-differential-expression" agent skill from https://github.com/jaechang-hits/SciAgent-Skills/tree/main/skills/genomics-bioinformatics/rnaseq/deseq2-differential-expression into .opencode/skills/deseq2-differential-expression/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "deseq2-differential-expression", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
deseq2-differential-expressionBulk RNA-seq DE with R/Bioconductor DESeq2. An agent skill from jaechang-hits/SciAgent-Skills.
Deseq2 Differential Expression is an agent skill from jaechang-hits/SciAgent-Skills. Bulk RNA-seq DE with R/Bioconductor DESeq2. Negative binomial GLM, empirical Bayes shrinkage, Wald/LRT tests, multi-factor designs, Salmon tximeta import, apeglm LFC shrinkage, MA/volcano/heatmap viz. R gold standard. Use pydeseq2-differential-expression for Python; use edgeR for TMM normalization.
Its SKILL.md is about 6.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Research & Science, covering Bioinformatics and Database schema design. It works with Python. The repository describes itself as: 197 bioinformatics & life science skills for Claude Code and AI agents — BixBench 92.0% accuracy. RNA-seq, single-cell, drug discovery, proteomics, and more. Powers OmicsHorizon. The licence is LGPL-3.0.
8 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 82c862c. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are r and yaml).
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
bioconductor.orgdoi.orgFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Deseq2 Differential Expression loads about 6.4k tokens when it runs. Until then it costs about 83 tokens; SKILL.md has 1,488 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from jaechang-hits/SciAgent-Skills at commit 82c862c, republished under its LGPL-3.0 licence (© jaechang-hits). 1,488 words, ~6,439 tokens.
.claude/skills/deseq2-differential-expression/SKILL.md (or your agent's skills folder).DESeq2 is the Bioconductor R package for differential gene expression analysis from bulk RNA-seq count data. It fits a negative binomial generalized linear model per gene, estimates dispersion parameters using empirical Bayes shrinkage across genes, and tests differential expression using Wald tests (two-group) or likelihood ratio tests (complex designs). DESeq2 is the R gold standard for RNA-seq DE analysis, with native Bioconductor integration for seamless import from Salmon (tximeta/tximport), featureCounts, or HTSeq.
~ batch + condition)DESeq2 (Bioconductor), tximeta or tximport (Salmon import), apeglm (LFC shrinkage), pheatmap, ggplot2, EnhancedVolcanoquant.sf files and a transcript-to-gene mapping# Install Bioconductor packages
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install(c("DESeq2", "tximeta", "tximport", "apeglm",
"EnhancedVolcano"))
install.packages(c("pheatmap", "ggplot2", "dplyr"))Settle these with the user before writing any analysis code.
decisions:
- id: D1
param: design
kind: required
source: data
ask: "Which column of the sample sheet separates the groups you want to compare?"
default: null
- id: D2
param: contrast
kind: required
source: user
depends_on: [D1]
ask: "Which two groups should be compared, and which group should have positive log2 fold changes?"
default: null
- id: D3
param: design
kind: required
source: data
depends_on: [D1]
ask: "Which available variables should be included to adjust for nuisance variation (batch, donor, sex, sequencing run)?"
default: "none"
skip_if: "sample sheet carries no column besides the grouping variable"
- id: D4
param: test
kind: required
source: user
depends_on: [D1, D2]
ask: "Is the primary hypothesis a named comparison, or an overall effect of this factor across its levels?"
default: "named comparison (Wald test)"
- id: D5
param: alpha
kind: optional
source: user
ask: "How strong must the evidence be before a gene counts as changed (false-discovery rate)?"
default: 0.05
- id: D6
param: lfcThreshold
kind: optional
source: user
ask: "Test against a zero change, or against a minimum fold change worth caring about?"
default: 0
- id: D7
param: lfcShrink.type
kind: derived
source: upstream
ask: "Shrink fold-change estimates so low-count genes stop dominating the rankings and plots?"
default: "apeglm, applied for ranking and visualization"
- id: D8
param: blind (vst/rlog)
kind: derived
source: upstream
ask: "Should the variance-stabilizing transform ignore the design?"
default: "TRUE for QC/clustering, FALSE for design-aware downstream uses"
- id: D9
param: independentFilter
kind: optional
source: user
ask: "Should DESeq2 use its adaptive mean-count filter to maximize discoveries at the chosen FDR threshold?"
default: truedesign appears twice because the formula is assembled from both D1 and D3;
D2 defines the direction of the reported effect. The pipeline explicitly passes
alpha: 0.05 to results() so independent filtering is optimized for the
reported FDR threshold rather than DESeq2's default of 0.1.
Complete two-group comparison from a count matrix in under 20 lines.
library(DESeq2)
# Load count matrix (genes x samples) and metadata
counts <- as.matrix(read.csv("counts.csv", row.names = 1))
coldata <- read.csv("metadata.csv", row.names = 1)
coldata$condition <- factor(coldata$condition)
# Build DESeqDataSet, run full pipeline
dds <- DESeqDataSetFromMatrix(countData = counts,
colData = coldata,
design = ~ condition)
dds <- dds[rowSums(counts(dds)) >= 10, ] # pre-filter
dds <- DESeq(dds)
# Extract results (treated vs. control)
res <- results(dds, contrast = c("condition", "treated", "control"),
alpha = 0.05)
summary(res)
# LFC shrinkage for visualization
res_shrunk <- lfcShrink(dds, contrast = c("condition", "treated", "control"),
type = "apeglm", coef = 2)Build a DESeqDataSet from a gene × sample count matrix and a colData data frame. Column names of the count matrix must match row names of colData.
library(DESeq2)
library(dplyr)
# Load raw count matrix (genes as rows, samples as columns)
counts <- as.matrix(read.csv("featureCounts_matrix.csv", row.names = 1))
# Or from featureCounts tab-delimited output — skip first comment line
# fc <- read.table("featurecounts_output.txt", header = TRUE, skip = 1, row.names = 1)
# counts <- as.matrix(fc[, 7:ncol(fc)]) # columns 7+ are sample counts
# Load sample metadata
coldata <- data.frame(
condition = factor(c("control", "control", "control",
"treated", "treated", "treated")),
batch = factor(c("A", "A", "B", "A", "B", "B")),
row.names = colnames(counts)
)
# Build DESeqDataSet
dds <- DESeqDataSetFromMatrix(countData = counts,
colData = coldata,
design = ~ condition)
cat("Samples:", ncol(dds), "\n")
cat("Genes:", nrow(dds), "\n")
cat("Condition levels:", levels(coldata$condition), "\n")When reads were quantified with Salmon, use tximeta to import transcript-level estimates with proper offset correction that accounts for transcript length and GC bias.
library(tximeta)
# Build a coldata with a "files" column pointing to quant.sf files
quant_dirs <- file.path("salmon_output", coldata$sample_id, "quant.sf")
coldata$files <- quant_dirs
coldata$names <- coldata$sample_id
# Import with tximeta — automatically fetches transcript metadata from Ensembl
se <- tximeta(coldata) # SummarizedExperiment with transcript-level data
# Summarize to gene level (requires Ensembl or custom txdb)
gse <- summarizeToGene(se) # gene-level SummarizedExperiment
# Build DESeqDataSet from the SummarizedExperiment
dds <- DESeqDataSet(gse, design = ~ condition)
cat("Gene-level SE dimensions:", dim(gse), "\n")
cat("Assay names:", assayNames(gse), "\n")
# Assay "counts" = estimated counts; "abundance" = TPM; "length" = eff. lengthsRemove genes with very low counts to improve statistical power and reduce the multiple testing burden. Explore sample quality with PCA on variance-stabilized counts.
library(ggplot2)
# Pre-filter: keep genes with at least 10 reads total
keep <- rowSums(counts(dds)) >= 10
dds <- dds[keep, ]
cat("Genes after pre-filtering:", nrow(dds), "\n")
# Variance-stabilizing transformation for QC visualization
vsd <- vst(dds, blind = TRUE) # blind = TRUE for exploratory QC
# PCA plot
pca_data <- plotPCA(vsd, intgroup = c("condition", "batch"), returnData = TRUE)
percent_var <- round(100 * attr(pca_data, "percentVar"))
ggplot(pca_data, aes(PC1, PC2, color = condition, shape = batch)) +
geom_point(size = 3) +
xlab(paste0("PC1: ", percent_var[1], "% variance")) +
ylab(paste0("PC2: ", percent_var[2], "% variance")) +
ggtitle("PCA — Variance-Stabilized Counts") +
theme_bw()
ggsave("pca_plot.pdf", width = 6, height = 5)
cat("Saved pca_plot.pdf\n")DESeq() runs three sequential steps: (1) median-of-ratios size factor estimation, (2) gene-wise and shrunken dispersion estimation, (3) negative binomial GLM fitting and Wald statistics.
# Run full DESeq2 pipeline
dds <- DESeq(dds)
# Inspect size factors (library normalization)
cat("Size factors:\n")
print(sizeFactors(dds))
# Expected range: 0.3–3.0; outliers indicate library quality issues
# Dispersion plot — should show decreasing dispersion trend with mean
plotDispEsts(dds, main = "Dispersion Estimates")
# Inspect fitted model coefficients
resultsNames(dds)
# [1] "Intercept" "condition_treated_vs_control"Use results() to extract Wald test statistics. Specify the contrast explicitly for clarity. Independent filtering maximizes the number of detectable genes.
# Extract results for the contrast of interest
res <- results(dds,
contrast = c("condition", "treated", "control"),
alpha = 0.05, # FDR threshold for independent filtering
lfcThreshold = 0, # Test H0: |LFC| = 0 (Wald test)
independentFilter = TRUE) # Maximize power via adaptive filtering
# Summary: how many genes are up/down/NA
summary(res)
# out of N with nonzero total read count:
# adjusted p-value < 0.05: ...
# LFC > 0 (up): ...
# LFC < 0 (down): ...
# outliers [Cook's distance]: ...
# low counts [below independent filtering threshold]: ...
# Convert to data frame and sort by adjusted p-value
res_df <- as.data.frame(res)
res_df <- res_df[order(res_df$padj, na.last = TRUE), ]
cat("Significant genes (padj < 0.05):", sum(res_df$padj < 0.05, na.rm = TRUE), "\n")
cat("Upregulated:", sum(res_df$padj < 0.05 & res_df$log2FoldChange > 0, na.rm = TRUE), "\n")
cat("Downregulated:", sum(res_df$padj < 0.05 & res_df$log2FoldChange < 0, na.rm = TRUE), "\n")
write.csv(res_df, "deseq2_all_results.csv")Shrink log2 fold changes using the adaptive t prior (apeglm). Use shrunk LFCs for MA plots, volcano plots, and gene ranking — NOT for significance calling (padj comes from the unshrunk Wald test).
library(apeglm)
# apeglm shrinkage — specify coefficient name from resultsNames(dds)
res_shrunk <- lfcShrink(dds,
coef = "condition_treated_vs_control",
type = "apeglm",
res = res) # pass original results for speed
# Compare shrunk vs. unshrunk LFC
cat("Max |LFC| unshrunk:", max(abs(res$log2FoldChange), na.rm = TRUE), "\n")
cat("Max |LFC| shrunk: ", max(abs(res_shrunk$log2FoldChange), na.rm = TRUE), "\n")
# Export shrunk results
res_shrunk_df <- as.data.frame(res_shrunk)
res_shrunk_df <- res_shrunk_df[order(res_shrunk_df$padj, na.last = TRUE), ]
write.csv(res_shrunk_df, "deseq2_shrunk_results.csv")
# Filter significant with effect size threshold
sig_genes <- res_shrunk_df[
!is.na(res_shrunk_df$padj) &
res_shrunk_df$padj < 0.05 &
abs(res_shrunk_df$log2FoldChange) > 1, ]
cat("Significant (padj<0.05, |LFC|>1):", nrow(sig_genes), "\n")
write.csv(sig_genes, "deseq2_significant.csv")Compute/viz separation (required): Do not combine DESeq2 computation and plotting in the same code block. Step 6 (or Step 5) saves the results CSV; this step loads that CSV and produces plots only. This way plots can be regenerated or restyled without re-running the expensive computation. Plotting: for the volcano, read
skills/data-visualization/omics-plotting/SKILL.mdand follow its "Volcano" recipe on the exported DEG CSV (→figures/volcano_plot.pdf). The heatmap below stays native R (pheatmap).
# Volcano: use the omics-plotting SKILL (`skills/data-visualization/omics-plotting/SKILL.md`) "Volcano" recipe on the exported DEG CSV -> figures/volcano_plot.pdf
library(pheatmap)
# ---Heatmap of top 50 DE genes ---
top50 <- head(rownames(sig_genes[order(sig_genes$padj), ]), 50)
mat <- assay(vsd)[top50, ] # variance-stabilized expression
mat <- mat - rowMeans(mat) # center by gene mean
annotation_col <- data.frame(
Condition = coldata$condition,
Batch = coldata$batch,
row.names = colnames(mat)
)
# Use the code in the omics-plotting SKILL (`skills/data-visualization/omics-plotting/SKILL.md`) for publication-quality heatmap plots or use below code to generate a heatmap
pheatmap(mat,
annotation_col = annotation_col,
cluster_rows = TRUE,
cluster_cols = TRUE,
show_rownames = TRUE,
fontsize_row = 6,
filename = "figures/heatmap_top50.pdf",
width = 8,
height = 10)
For designs with batch correction, paired samples, or interaction effects between two variables.
# --- Batch-corrected two-group comparison ---
dds_batch <- DESeqDataSetFromMatrix(countData = counts,
colData = coldata,
design = ~ batch + condition)
dds_batch <- dds_batch[rowSums(counts(dds_batch)) >= 10, ]
dds_batch <- DESeq(dds_batch)
res_batch <- results(dds_batch,
contrast = c("condition", "treated", "control"),
alpha = 0.05)
cat("Significant (batch-corrected):", sum(res_batch$padj < 0.05, na.rm = TRUE), "\n")
# --- Interaction design: test whether treatment effect differs between genotypes ---
# H0: the effect of treatment is the same in WT and KO
coldata$genotype <- factor(coldata$genotype) # "WT" or "KO"
dds_int <- DESeqDataSetFromMatrix(
countData = counts, colData = coldata,
design = ~ genotype + condition + genotype:condition
)
dds_int <- DESeq(dds_int)
resultsNames(dds_int)
# Interaction coefficient: "genotypeKO.conditiontreated"
# Extract interaction term — genes where treatment effect differs by genotype
res_int <- results(dds_int, name = "genotypeKO.conditiontreated", alpha = 0.05)
cat("Genes with significant interaction:", sum(res_int$padj < 0.05, na.rm = TRUE), "\n")
# --- Likelihood Ratio Test for complex designs (e.g., time series) ---
# LRT compares full model vs. reduced model
dds_lrt <- DESeq(dds_int, test = "LRT", reduced = ~ genotype + condition)
res_lrt <- results(dds_lrt)
cat("Genes with genotype:condition interaction (LRT):",
sum(res_lrt$padj < 0.05, na.rm = TRUE), "\n")| Parameter | Function | Default | Range / Options | Effect |
|---|---|---|---|---|
design | DESeqDataSetFromMatrix() | (required) | ~ var or ~ cov + var | Specifies the GLM formula; put batch/covariates before variable of interest |
contrast | results() | NULL | c(var, level1, level2) or coefficient name | Defines the comparison; always specify explicitly for clarity |
alpha | results() | 0.1 | 0.01–0.10 | FDR threshold used for independent filtering; does not change padj values |
lfcThreshold | results() | 0 | 0–2 | Test H0: |
independentFilter | results() | TRUE | TRUE/FALSE | Adaptive mean-count filtering to maximize the number of rejectible hypotheses |
type | lfcShrink() | "apeglm" | "apeglm", "ashr", "normal" | Shrinkage prior; apeglm is fastest and best calibrated |
coef | lfcShrink() | (required) | coefficient name from resultsNames() | Which model coefficient to shrink; must match resultsNames() output |
test | DESeq() | "Wald" | "Wald", "LRT" | Wald: two-group comparisons; LRT: model comparison for complex designs |
reduced | DESeq() | NULL | formula without the term to test | Required for LRT; specifies the null model |
blind | vst() / rlog() | TRUE | TRUE/FALSE | TRUE for QC/exploration; FALSE for downstream analysis using dispersion info |
DESeq2 models each gene's count as Negative Binomial(mean = µ, dispersion = α), where mean µ depends on the experimental design through a log-linear model. The key innovation is dispersion shrinkage: gene-wise dispersion estimates are shrunk toward a fitted trend across all genes using an empirical Bayes approach, borrowing information across genes to stabilize estimates from small sample sizes.
DESeq2 uses the median-of-ratios method: for each sample, compute the ratio of each gene's count to the geometric mean of that gene across all samples, then take the median ratio across all genes as the size factor. This is robust to differentially expressed genes and does not require any assumptions about the fraction of DE genes.
β = 0; fast and appropriate for two-group comparisons and specific contrasts in multi-factor designsreduced model by the likelihood ratio; appropriate for testing whether any level of a multi-level factor (e.g., 5 time points) has an effect, or for testing interaction terms as a groupDESeq2 computes Cook's distance per gene per sample to flag potential expression outliers. Genes where any sample has a Cook's distance above a threshold are automatically replaced with NA in the results. With refit = TRUE (default), outlier samples are excluded and the model is refit for that gene.
Efficient when comparing multiple treatment groups — fit DESeq() once, extract multiple contrasts.
# Fit once
dds_multi <- DESeqDataSetFromMatrix(counts, coldata, design = ~ condition)
dds_multi <- dds_multi[rowSums(counts(dds_multi)) >= 10, ]
dds_multi <- DESeq(dds_multi)
# Extract contrasts — all vs. "control"
contrasts_list <- list(
A_vs_ctrl = c("condition", "treatment_A", "control"),
B_vs_ctrl = c("condition", "treatment_B", "control"),
C_vs_ctrl = c("condition", "treatment_C", "control")
)
results_list <- lapply(names(contrasts_list), function(nm) {
res <- results(dds_multi, contrast = contrasts_list[[nm]], alpha = 0.05)
res_shrunk <- lfcShrink(dds_multi, contrast = contrasts_list[[nm]],
type = "apeglm", res = res)
write.csv(as.data.frame(res_shrunk), paste0("results_", nm, ".csv"))
cat(nm, "— significant:", sum(res$padj < 0.05, na.rm = TRUE), "\n")
as.data.frame(res_shrunk)
})
names(results_list) <- names(contrasts_list)Eliminate within-subject variability by including subject as a blocking factor.
# Paired design: each subject has pre- and post-treatment samples
coldata$subject <- factor(c("S1","S1","S2","S2","S3","S3"))
coldata$timepoint <- factor(c("pre","post","pre","post","pre","post"))
dds_paired <- DESeqDataSetFromMatrix(counts, coldata,
design = ~ subject + timepoint)
dds_paired <- dds_paired[rowSums(counts(dds_paired)) >= 10, ]
dds_paired <- DESeq(dds_paired)
res_paired <- results(dds_paired,
contrast = c("timepoint", "post", "pre"),
alpha = 0.05)
cat("Significant (paired):", sum(res_paired$padj < 0.05, na.rm = TRUE), "\n")Create a pre-ranked gene list for input to GSEA or gseapy's prerank function.
# Build ranking metric: signed -log10(pvalue) with LFC direction
res_rank <- as.data.frame(res_shrunk)
res_rank <- res_rank[!is.na(res_rank$pvalue) & !is.na(res_rank$log2FoldChange), ]
res_rank$rank_metric <- sign(res_rank$log2FoldChange) *
(-log10(res_rank$pvalue + 1e-300))
res_rank <- res_rank[order(res_rank$rank_metric, decreasing = TRUE), ]
# Export as two-column TSv for fgsea or gseapy prerank
write.table(data.frame(gene = rownames(res_rank),
score = res_rank$rank_metric),
"gsea_ranked_list.rnk",
sep = "\t", quote = FALSE, row.names = FALSE, col.names = FALSE)
cat("Ranked gene list saved:", nrow(res_rank), "genes\n")Avoid re-running the expensive DESeq() step in subsequent sessions.
# Save fitted DDS object
saveRDS(dds, "dds_fitted.rds")
cat("Saved fitted DESeqDataSet to dds_fitted.rds\n")
# Reload in a new session
dds_loaded <- readRDS("dds_fitted.rds")
# Continue with results(), lfcShrink(), etc.
res_reloaded <- results(dds_loaded, contrast = c("condition", "treated", "control"))| File | Description |
|---|---|
deseq2_all_results.csv | Full results table: baseMean, log2FoldChange, lfcSE, stat, pvalue, padj for all genes |
deseq2_shrunk_results.csv | Results with apeglm-shrunk LFC; use for ranking and visualization |
deseq2_significant.csv | Filtered results: padj < 0.05 and |
pca_plot.pdf | PCA of variance-stabilized counts; used to check batch structure and outliers |
dispersion_plot.pdf | Gene-wise vs. fitted dispersions; should show tight cloud around trend |
figures/volcano_plot.pdf | Volcano plot with significance and LFC thresholds labeled |
figures/heatmap_top50.pdf | Hierarchically clustered heatmap of top 50 DE genes |
gsea_ranked_list.rnk | Pre-ranked gene list for pathway enrichment (fgsea/gseapy) |
dds_fitted.rds | Serialized DESeqDataSet for checkpoint/resume |
| Problem | Cause | Solution |
|---|---|---|
Error: design contains one or more variables with all samples having the same value | A design factor has only one level | Check table(coldata$condition); ensure all factor levels are present |
Model matrix not full rank | Confounded design (e.g., batch perfectly correlated with condition) | Run table(coldata$batch, coldata$condition); drop the confounded variable or collect more samples |
All or most padj = NA | Genes flagged by independent filtering (low mean count) or Cook's outliers | Check summary(res) for count of filtered genes; relax alpha or verify data quality |
| No significant genes despite strong biology | Under-powered experiment or high within-group variability | Verify n ≥ 3 per group; check PCA for outliers; inspect p-value histogram (should show spike near 0) |
Error in lfcShrink: coefficient not found | coef name does not match resultsNames(dds) | Run resultsNames(dds) and copy the exact coefficient string into coef = |
apeglm fails with convergence warning | Extreme LFC estimates (sparse data or complete separation) | Switch to type = "ashr" which is more robust to these cases |
| Very large size factors (> 5) | Extremely different library sizes, or normalized counts accidentally used | Check colSums(counts(dds)); ensure input is raw integer counts from aligner/counter |
| Dispersion plot shows outlier cloud far from trend | Noisy or failed libraries; incorrect metadata grouping | Examine PCA; remove outlier samples; check that design formula matches biological groups |
© jaechang-hits, LGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/genomics-bioinformatics/rnaseq/deseq2-differential-expression of jaechang-hits/SciAgent-Skills.
Open the folder on GitHubat commit 82c862c
We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in jaechang-hits/SciAgent-Skills, which our catalogue first saw on October 7, 2026.
Deseq2 Differential Expression next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Deseq2 Differential Expression this skilljaechang-hits/SciAgent-Skills | 374 | 1 repos | ~6.4k | Automated safety check: Pass | LGPL-3.0 | |
| Bio Geo DataGPTomics/bioSkills | 1.2k | 2 repos | ~4.4k | Automated safety check: Pass | MIT | |
| Bio Single Cell PreprocessingFreedomIntelligence/OpenClaw-Medical-Skills | 3.1k | 1 repos | ~2.4k | Automated safety check: Pass | None | |
| Bio Chipseq Super EnhancersGPTomics/bioSkills | 1.2k | 2 repos | ~4.1k | Automated safety check: Pass | MIT | |
| Bio Proteomics Data ImportGPTomics/bioSkills | 1.2k | 1 repos | ~4.5k | Automated safety check: Pass | MIT | |
| Bio Proteomics Differential AbundanceGPTomics/bioSkills | 1.2k | 1 repos | ~5.7k | Automated safety check: Pass | MIT |
GPTomics/bioSkills
Query and download from NCBI Gene Expression Omnibus (GEO) and EMBL-EBI's BioStudies/ArrayExpress mirror.
FreedomIntelligence/OpenClaw-Medical-Skills
Quality control, filtering, and normalization for single-cell RNA-seq using Seurat (R) and Scanpy (Python).
GPTomics/bioSkills
Identifies super-enhancers from H3K27ac, MED1, or BRD4 ChIP-seq using ROSE, ROSE2, LILY, HOMER -style super, and ENCODE dELS cross-referencing.
GPTomics/bioSkills
Loads mass-spectrometry data into Python/R and strips the search engine's bookkeeping before any number is trusted -- removes decoys (REV/Reverse), contaminants (CON/Potential contaminant)…
GPTomics/bioSkills
Tests for differentially abundant proteins between conditions with limma/DEqMS empirical-Bayes moderation, proDA/msqrob2/MSstats missingness modeling, and Python Welch+BH alternatives.
google-deepmind/science-skills
Analyzes genetic variant effects on gene expression (RNA-seq), chromatin accessibility (DNASE), histone marks (ChIP), and transcription factors using the AlphaGenome API.
jaechang-hits/SciAgent-Skills
NEB-IRC activation energy pipeline for reaction barriers using GFN2-xTB and pysisyphus.
jaechang-hits/SciAgent-Skills
3Dmol.js WebGL molecular visualization emitted as self-contained HTML.
jaechang-hits/SciAgent-Skills
Constraint-based (COBRA) analysis of genome-scale metabolic models: FBA, FVA, knockouts, flux sampling, production envelopes, gapfilling, media optimization.
jaechang-hits/SciAgent-Skills
Read, write, and edit ChemDraw CDX/CDXML files with RDKit's rdkit.Chem.rdChemDraw plus direct XML editing, always paired with a rendered PNG.
jaechang-hits/SciAgent-Skills
Programmatic PubMed access via NCBI E-utilities REST API. An agent skill from jaechang-hits/SciAgent-Skills.
jaechang-hits/SciAgent-Skills
Scaffold a new SciAgent-Skills entry. An agent skill from jaechang-hits/SciAgent-Skills.
Works with
Categories
Bulk RNA-seq DE with R/Bioconductor DESeq2. An agent skill from jaechang-hits/SciAgent-Skills. Deseq2 Differential Expression is an agent skill from jaechang-hits/SciAgent-Skills. Bulk RNA-seq DE with R/Bioconductor DESeq2.
Deseq2 Differential Expression fits situations like: tasks that involve Bioinformatics; tasks that involve Database schema design.
Run `npx skills add jaechang-hits/SciAgent-Skills --skill deseq2-differential-expression -a claude-code`. Or copy the skill folder (skills/genomics-bioinformatics/rnaseq/deseq2-differential-expression in jaechang-hits/SciAgent-Skills) into .claude/skills/deseq2-differential-expression in your project. Claude Code loads it when a task matches its description.
Run `npx skills add jaechang-hits/SciAgent-Skills --skill deseq2-differential-expression -a codex`. Or copy the skill folder (skills/genomics-bioinformatics/rnaseq/deseq2-differential-expression in jaechang-hits/SciAgent-Skills) into .agents/skills/deseq2-differential-expression in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jaechang-hits/SciAgent-Skills --skill deseq2-differential-expression -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/deseq2-differential-expression, .gemini/skills/deseq2-differential-expression, .github/skills/deseq2-differential-expression and .opencode/skills/deseq2-differential-expression in your project.
SKILL.md names no scripts, command-line tools or credentials: Deseq2 Differential Expression is instructions for the agent only.
SKILL.md names 2 domains. As links in the text: bioconductor.org and doi.org. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Deseq2 Differential Expression is published under the LGPL-3.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 6.4k tokens (SKILL.md is roughly 26k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Deseq2 Differential Expression: Bio Geo Data (GPTomics/bioSkills, 1.2k stars), Bio Single Cell Preprocessing (FreedomIntelligence/OpenClaw-Medical-Skills, 3.1k stars), Bio Chipseq Super Enhancers (GPTomics/bioSkills, 1.2k stars) and Bio Proteomics Data Import (GPTomics/bioSkills, 1.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
jaechang-hits (a GitHub user) maintains it in jaechang-hits/SciAgent-Skills, which has 374 GitHub stars. The repository holds 169 skills in this directory. The repository was last updated on September 29, 2026.
Source: jaechang-hits/SciAgent-Skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.