본문으로 건너뛰기
cccskills
무료GitHub에 공개

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(13)

  • SKILL.md5.9 KB
  • eval_report_differential-expression-analysis_result.json15.6 KB
  • references/algorithm.md2.0 KB
  • references/cli-guide.md1.7 KB
  • references/troubleshooting.md2.1 KB
  • scripts/diff_methods.R2.9 KB
  • scripts/diff_visualization.R3.3 KB
  • scripts/functions.R2.0 KB
  • scripts/main.R3.2 KB
  • scripts/run_analysis.R2.1 KB
  • scripts/utils.R1.6 KB
  • tests/data/Combined_Datasets_Matrix_mus.csv6.6 MB
  • tests/data/Combined_Datasets_mus_Group.csv618 B

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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

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.

"","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.

"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)

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

With DESeq2 for Count Data

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

Custom Thresholds

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

# 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

# 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

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Transform lengthy academic papers into concise, structured 250-word abstracts.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aipoch/medical-research-skills2천2026년 9월 17일 업데이트

Precision editing tool that reduces abstract word count through intelligent compression techniques, maintaining scientific rigor while meeting strict journal and conference requirements.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aipoch/medical-research-skills2천2026년 9월 17일 업데이트

Refines long medical academic texts into SCI-style unstructured Chinese and English abstracts; use when you need to condense drafts/reports/summaries into bilingual abstracts and generate Summary_Report.md.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aipoch/medical-research-skills2천2026년 9월 17일 업데이트

Generates submission-ready Elsevier/SCI Highlights from manuscript text or extracted PDF/DOCX/TXT content. Use when a user needs 3-5 concise, evidence-grounded highlight bullets for a research paper, review, meta-analysis, case report, or bioinformatics manuscript.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aipoch/medical-research-skills2천2026년 9월 17일 업데이트

Generates complete FAERS pharmacovigilance study designs for multi-drug or class-level safety comparison inside one predefined SOC or AE family using active comparators, disproportionality analysis, subgroup characterization, and reviewer-facing evidence control.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aipoch/medical-research-skills2천2026년 9월 17일 업데이트

Analyze data with `adme-property-predictor` using a reproducible workflow, explicit validation, and structured outputs for review-ready interpretation.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aipoch/medical-research-skills2천2026년 9월 17일 업데이트

aipoch의 스킬 모두 보기

이 스킬의 문제 신고