pydeseq2
하는 일
이 도구는 대규모 RNA 데이터를 분석해 서로 다른 시료 사이에서 활성도가 바뀌는 유전자를 찾습니다. 살아 있는 생물을 대상으로 한 실험에서 생물학적 차이를 이해하도록 돕습니다.
사용하는 경우
- ✓처리군과 대조군 사이의 유전자 활성을 비교할 때.
- ✓특정 조건(예: 질병과 건강)으로 활성이 바뀌는 유전자를 찾을 때.
- ✓더 신뢰할 수 있는 결과를 위해 여러 생물이나 시료를 사용한 실험의 데이터를 분석할 때.
스킬 링크
https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/pydeseq2/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“‘treated’ 집단과 ‘control’ 집단 사이에서 변화한 유전자를 찾으려 합니다. ‘batch’를 고려하는 수식을 사용해 RNA-seq 데이터를 분석해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
유전자 개수 데이터와 시료에 대한 정보를 제공합니다. 도구는 통계 모델을 사용해 사용자가 정의한 집단 사이의 유전자 활성 수준을 비교합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
PyDESeq2
Use this skill for bulk RNA-seq negative-binomial GLMs, with explicit biological replicates, covariates, and comparisons. Cells, sequencing lanes, and repeated measurements from the same donor are not independent biological replicates. Donor-level pseudobulk can be appropriate when its aggregation and design match the scientific question; this is not a single-cell per-cell testing workflow.
Current PyDESeq2 0.5.4 provides Wald tests and apeGLM-style coefficient shrinkage. Do not assume every feature or numerical result of current R DESeq2 is implemented identically. See API and tested versions for supported calls, AnnData storage, and source/runtime verification limits.
Analysis contract
- Establish the experimental unit, count provenance, sample exclusions, reference levels, and intended comparison before fitting. Use nonnegative integer counts in samples × genes order, with unique sample/gene IDs. TPM, FPKM, log data, VST data, and library-normalized counts are not model inputs. Integer checks alone cannot establish raw-count provenance. Approved estimated-count imports need an explicit upstream conversion and offset/length-correction policy.
- Require equal sample sets and reorder metadata to the count index. Resolve unmatched IDs and missing design annotations explicitly; never silently take an intersection. Determine orientation from the file schema, not its shape.
- Apply a prespecified gene prefilter after intentional sample exclusions. Total counts >=10 is a small example rule, not a universal biological threshold. Keep enough genes to estimate normalization and dispersion trends jointly.
- Build a full-rank formula design with residual degrees of freedom. Explicitly encode categories/reference levels; numeric variables are continuous. Formula term order does not decide the tested effect when a contrast is explicit.
- Fit size factors, gene-wise/trend/MAP dispersions, LFCs, and Cook diagnostics. Inspect warnings, convergence and normalization assumptions before interpreting results. Large size factors can reflect real library-depth differences.
- Test an explicit contrast with the intended
alpha, preserve the full Wald table, and optionally shrink the same single positive coefficient. Export counts/model metadata separately from statistical results.
Quick start
Install in an isolated environment; the repository test runner supplies the scientific dependencies separately from the project environment:
uv venv --python 3.13 .venv-pydeseq2
uv pip install --python .venv-pydeseq2/bin/python 'pydeseq2==0.5.4' 'anndata==0.13.4'
Paths below are illustrative; run from this skill directory with your own files. The bundled driver expects counts CSV as genes × samples by default, and metadata CSV as samples × annotations, each with IDs in its first column:
python scripts/run_deseq2_analysis.py \
--counts counts.csv --metadata metadata.csv \
--design '~batch + condition' --contrast condition treated control \
--min-counts 10 --alpha 0.05 --n-cpus 1 --plots --output results/
Use --no-transpose for a counts file already in samples × genes order. The driver
rejects duplicate source CSV headers, unequal sample sets, invalid count values,
zero-count samples, missing contrast annotations, and unidentifiable designs. It
sets the CLI contrast variable's reference level before fitting; numeric category
codes supplied as the contrast variable are deliberately treated as categories.
Resolve other design variables' types and missing values in the input metadata.
The driver performs Wald testing and shrinkage by default. --no-shrink exports
only unshrunk effect estimates; --shrink-coeff can select only the coefficient
that exactly matches the tested contrast. For interactions, continuous effects,
or custom design matrices, use the Python patterns rather than guessing a CLI
coefficient. The CLI does not expose thresholded tests or alternative normalization
methods; use the API for those choices.
Outputs:
deseq2_results.csv: current estimates (shrunken if requested) with original Waldstat,pvalue, andpadj.deseq2_results_unshrunken.csv: preserved original Wald table.significant_genes.csvandresults_sorted_by_padj.csv: the configuredalpha
…
자주 묻는 질문
‘생물학적 반복(biological replicates)’이란 무엇인가요?
우연 때문이 아님을 보장하기 위해, 같은 종류의 생물이나 조건에서 얻은 독립적인 시료입니다.
‘log2FoldChange’란 무엇인가요?
두 조건 사이에서 유전자의 활성이 얼마나 변했는지를 나타내는 값입니다. 양수는 증가, 음수는 감소를 뜻합니다.
‘padj’(보정된 p-값)란 무엇인가요?
많은 검정을 수행한 것을 보정한 뒤, 결과가 거짓일 확률을 나타내는 값입니다. padj가 낮으면 신뢰할 수 있는 발견을 뜻합니다.
상세 정보
작성자의 원본 설명
Performs bulk RNA-seq differential expression analysis with PyDESeq2, including count validation, formula designs, explicit contrasts, Wald tests, FDR correction, coefficient-matched LFC shrinkage, and result visualization. Use for PyDESeq2 or Python DESeq2 workflows with biological replicates.
인기도
- GitHub 스타
- 51k
- 순위
- #3538
- 라이선스
- MIT
- 업데이트
- 2026. 10. 15.
댓글
- …
이 저장소의 다른 스킬
13c-metabolic-flux
51k탄소-13 동위원소 추적 데이터를 사용해 대사 흐름(플럭스)을 추정합니다. 세포 대사와 생화학 경로를 분석할 때 유용합니다.
adaptyv
51kAdaptyv API를 사용해 단백질 특성 분석 실험을 설계합니다. 비용을 추정하고, 서열을 제출하며, 실험실 결과를 확인하는 데 도움이 됩니다.
aeon
51k시계열 데이터에 대해 머신러닝 작업을 수행합니다. 순차 데이터를 분류하고, 예측하고, 이상을 탐지하고, 패턴을 찾을 때 유용합니다.
alphagenome
51k유전 변이에 대해 미리 계산된 게놈 영향을 조회합니다. 변이가 게놈에 주는 영향을 이해하도록 점수와 설명을 제공합니다.