Differential Expression Analysis logo

Differential Expression Analysis

OrganizationPopular
aipoch
differential-expression-analysis

Use when analyzing bulk RNA-seq or microarray expression data to identify differentially expressed genes between two biological groups (case vs control), with volcano plots and heatmap visualization. NOT for:single-cell RNA-seq, methylation analysis, non-expression data.

Overview

Publisheraipoch
Repositorymedical-research-skills
Skill namedifferential-expression-analysis
Stars
1.9K
Forks
175
Bundled files
12
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 12 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by aipoch on GitHub. Read the source before you install it.

Installation

Install the Differential Expression Analysis AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.

Use it in TypingMind

Enable Differential Expression Analysis in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Differential Expression Analysis on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Differential Expression Analysis is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Source: https://github.com/aipoch/medical-research-skills

Differential Expression Analysis

When to Read External Files

SituationFile to ReadPurpose
Need algorithm detailsreferences/algorithm.mdStatistical methods, formulas, assumptions
Need to run analysisscripts/main.RExecute: Rscript scripts/main.R --input_file ... --group_file ...
Encounter errorsreferences/troubleshooting.mdCommon errors and solutions
Need CLI examplesreferences/cli-guide.mdDetailed CLI usage examples
Need test datatests/data/Sample input files for testing

Usage

bash
Rscript scripts/main.R \
  --input_file ./expression_matrix.csv \
  --group_file ./group_info.csv \
  --output_dir ./output/ \
  --diff_method limma \
  --p_threshold 0.05 \
  --logfc_threshold 0.1 \
  --seed 42

Arguments

ShortLongTypeDefaultDescription
-i--input_filecharacterrequiredExpression matrix file (genes as rows, samples as columns)
-g--group_filecharacterrequiredGroup information file (sample ID + group columns)
-o--output_dircharacter./output/Output directory
-m--diff_methodcharacterlimmaMethod: limma, deseq2, edger, t, wilcox
-n--norm_methodcharacterTMMNormalization for edgeR: TMM, RLE, upperquartile
-p--p_thresholdnumeric0.05P-value threshold
-f--logfc_thresholdnumeric0.1Log fold change threshold
-s--seedinteger42Random seed for reproducibility

Input Format

Expression Matrix (input_file)

Genes as rows, samples as columns, CSV format with gene ID in first column.

csv
"","GSM1442228","GSM1442229","GSM1442230"
"0610006L08Rik",3.438,3.237,3.265
"0610007P14Rik",6.734,7.017,6.807

Group File (group_file)

CSV with sample ID and group columns.

csv
"ID","group"
"GSM1442228","Control"
"GSM1442229","Control"
"GSM1442230","DIC"

Output Files

FileDescription
Diffanalysis.csvComplete DE results with gene_id, logFC, Pvalue, Padj
volcano_plot.pdfVolcano plot with significance thresholds
heatmap.pdfHeatmap of top upregulated/downregulated genes
session_info.txtR session and package version info
temp/rdegs.csvSignificant differentially expressed genes
temp/Diffanalysis_filtered.csvFull results with group annotations

Workflow

Step 1: Validate Input

  • Check file existence
  • Validate sample matching between expression matrix and group file
  • Verify at least 2 samples per group

Step 2: Run Differential Expression

  • Choose method: limma, DESeq2, edgeR, t-test, or Wilcoxon
  • Calculate logFC and p-values
  • Apply multiple testing correction (Benjamini-Hochberg)

Step 3: Filter Results

  • Filter by p-value and logFC thresholds
  • Classify genes as Up, Down, or Not significant

Step 4: Generate Visualizations

  • Volcano plot showing significance vs fold change
  • Heatmap of top differential genes

Methods

limma

Linear models for microarray and RNA-seq with empirical Bayes moderation. Recommended for normalized expression data (FPKM, TPM).

DESeq2

Negative binomial GLM with variance stabilization. Recommended for raw count data.

edgeR

Empirical Bayes methods with TMM normalization. Supports robust dispersion estimation.

t-test / Wilcoxon

Simple pairwise statistical tests. t-test for parametric, Wilcoxon for non-parametric.


Examples

Basic Usage (limma)

bash
Rscript scripts/main.R \
  -i expression_matrix.csv \
  -g group_info.csv \
  -o ./output \
  -m limma

With DESeq2 for Count Data

bash
Rscript scripts/main.R \
  -i count_matrix.csv \
  -g group_info.csv \
  -o ./output \
  -m deseq2

Custom Thresholds

bash
Rscript scripts/main.R \
  -i expression_matrix.csv \
  -g group_info.csv \
  -o ./output \
  -p 0.01 \
  -f 0.5

Error Handling

Common Errors

ErrorCauseSolution
SKILL_FILE_NOT_FOUNDInput file doesn't existCheck file path
SKILL_SAMPLE_MISMATCHSample names don't matchVerify group file matches expression matrix columns
SKILL_INVALID_DATALess than 2 groups or samples per groupCheck group file
SKILL_FILTER_ERRORNo significant genes foundRelax thresholds or check data quality
SKILL_DEPENDENCY_MISSINGR package not installedInstall required packages

IF error persists, READ: references/troubleshooting.md


Testing

Test with Sample Data

bash
# Check help
Rscript scripts/main.R --help

# Run with sample data
Rscript scripts/main.R \
  -i tests/data/Combined_Datasets_Matrix_mus.csv \
  -g tests/data/Combined_Datasets_mus_Group.csv \
  -o tests/output/

Validation Commands

bash
# Count lines in output
wc -l output/Diffanalysis.csv

# Check volcano plot exists
ls -la output/volcano_plot.pdf

Implementation Checklist

  • CLI parsing with optparse
  • set.seed() for reproducibility
  • requireNamespace() dependency checks
  • Session info recording
  • Temp file cleanup
  • File reading instructions in SKILL.md
  • Modular script structure (<100 lines per file)
  • Test data provided
  • Error handling with SKILL_* codes
  • Scripts in scripts/ directory
  • References in references/ directory

Last updated: 2026-04-01 | Version: 2.0.0

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Differential Expression Analysis AI skill do?

Use when analyzing bulk RNA-seq or microarray expression data to identify differentially expressed genes between two biological groups (case vs control), with volcano plots and heatmap visualization. NOT for:single-cell RNA-seq, methylation analysis, non-expression data.

Why use Differential Expression Analysis on TypingMind?

Because you install it once and use it with any model. Differential Expression Analysis is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Differential Expression Analysis in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/aipoch/medical-research-skills/tree/main/awesome-med-research-skills/Data%20Analysis/differential-expression-analysis. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Differential Expression Analysis?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Differential Expression Analysis?

As many as you like. As long as a model supports skills, you can use Differential Expression Analysis with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Differential Expression Analysis AI skill free?

Yes. It is published on GitHub by aipoch under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇