Source: https://github.com/aipoch/medical-research-skills
Volcano Plot Script Generator
A skill for generating publication-ready volcano plots from differential gene expression analysis results.
When to Use
- Use this skill when the task is to Generate R/Python code for volcano plots from DEG (Differentially Expressed Genes) analysis results. Triggered when user needs visualization of gene expression data, p-value vs fold-change scatter plots, publication-ready figures for bioinformatics analysis.
- Use this skill for data analysis tasks that require explicit assumptions, bounded scope, and a reproducible output format.
- Use this skill when you need a documented fallback path for missing inputs, execution errors, or partial evidence.
Key Features
- Scope-focused workflow aligned to: Generate R/Python code for volcano plots from DEG (Differentially Expressed Genes) analysis results. Triggered when user needs visualization of gene expression data, p-value vs fold-change scatter plots, publication-ready figures for bioinformatics analysis.
- Packaged executable path(s):
scripts/main.py.
- Reference material available in
references/ for task-specific guidance.
- Reusable packaged asset(s), including
assets/example_volcano.R.
- Structured execution path designed to keep outputs consistent and reviewable.
Dependencies
Example Usage
See ## Usage above for related details.
cd "20260318/scientific-skills/Data Analytics/volcano-plot-script"
python -m py_compile scripts/main.py
python scripts/main.py --help
Example run plan:
- Confirm the user input, output path, and any required config values.
- Edit the in-file
CONFIG block or documented parameters if the script uses fixed settings.
- Run
python scripts/main.py with the validated inputs.
- Review the generated output and return the final artifact with any assumptions called out.
Implementation Details
See ## Workflow above for related details.
- Execution model: validate the request, choose the packaged workflow, and produce a bounded deliverable.
- Input controls: confirm the source files, scope limits, output format, and acceptance criteria before running any script.
- Primary implementation surface:
scripts/main.py.
- Reference guidance:
references/ contains supporting rules, prompts, or checklists.
- Packaged assets: reusable files are available under
assets/.
- Parameters to clarify first: input path, output path, scope filters, thresholds, and any domain-specific constraints.
- Output discipline: keep results reproducible, identify assumptions explicitly, and avoid undocumented side effects.
Quick Check
Use this command to verify that the packaged script entry point can be parsed before deeper execution.
python -m py_compile scripts/main.py
Audit-Ready Commands
Use these concrete commands for validation. They are intentionally self-contained and avoid placeholder paths.
python -m py_compile scripts/main.py
python scripts/main.py --help
python scripts/main.py --input "Audit validation sample with explicit symptoms, history, assessment, and next-step plan."
Workflow
- Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.
- Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.
- Use the packaged script path or the documented reasoning path with only the inputs that are actually available.
- Return a structured result that separates assumptions, deliverables, risks, and unresolved items.
- If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.
Overview
Volcano plots visualize the relationship between statistical significance (p-values) and magnitude of change (fold changes) in gene expression data. This skill generates customizable R or Python scripts for creating high-quality figures suitable for publications.
Use Cases
- Visualize RNA-seq DEG analysis results
- Identify significantly upregulated and downregulated genes
- Highlight genes of interest (markers, pathways)
- Generate publication-quality figures for manuscripts
- Compare multiple experimental conditions
Input Requirements
Required input data format:
- Gene identifier (gene symbol or ENSEMBL ID)
- Log2 fold change values
- Adjusted or raw p-values
- Optional: gene annotations, pathways
Output
- Publication-ready volcano plot (PNG/PDF/SVG)
- Customizable R or Python script
- Optional: labeled significant gene lists
Usage
# Example: Run the volcano plot generator
python scripts/main.py --input deg_results.csv --output volcano_plot.png
Parameters
| Parameter |
Description |
Default |
--input |
Path to DEG results CSV/TSV |
required |
--output |
Output plot file path |
volcano_plot.png |
--log2fc-col |
Column name for log2 fold change |
log2FoldChange |
--pvalue-col |
Column name for p-value |
padj |
--gene-col |
Column name for gene IDs |
gene |
--log2fc-thresh |
Log2 FC threshold for significance |
1.0 |
--pvalue-thresh |
P-value threshold |
0.05 |
--label-genes |
File with genes to label |
None |
--top-n |
Label top N significant genes |
10 |
--color-up |
Color for upregulated genes |
#E74C3C |
--color-down |
Color for downregulated genes |
#3498DB |
--color-ns |
Color for non-significant genes |
#95A5A6 |
Technical Difficulty
Medium - Requires understanding of:
- DEG analysis concepts (fold change, p-values, FDR)
- Data visualization principles
- Matplotlib/ggplot2 plotting libraries
Python
- pandas
- matplotlib
- seaborn
- numpy
R
- ggplot2
- dplyr
- ggrepel (for label positioning)
References
- Example datasets and templates
- Best practices for volcano plot visualization
- Color schemes for accessibility
Author
Auto-generated skill for bioinformatics visualization.
Risk Assessment
| Risk Indicator |
Assessment |
Level |
| Code Execution |
Python/R scripts executed locally |
Medium |
| Network Access |
No external API calls |
Low |
| File System Access |
Read input files, write output plots |
Medium |
| Instruction Tampering |
Standard prompt guidelines |
Low |
| Data Exposure |
Output files saved to workspace |
Low |
Security Checklist
Prerequisites
# Python dependencies
pip install -r requirements.txt
# R dependencies (if using R)
install.packages(c("ggplot2", "dplyr", "ggrepel"))
Evaluation Criteria
Success Metrics
Test Cases
- Basic DEG Visualization: Input standard DESeq2 results → Valid volcano plot
- Custom Thresholds: Adjust log2FC and p-value thresholds → Correct gene classification
- Gene Labeling: Specify genes to label → Labels appear correctly
- Large Dataset: Input 20,000+ genes → Performance remains acceptable
- Malformed Data: Input with missing values → Graceful error handling
Lifecycle Status
- Current Stage: Draft
- Next Review Date: 2026-03-06
- Known Issues: None
- Planned Improvements:
- Add interactive plot option (Plotly)
- Support for multiple comparison groups
- Integration with pathway enrichment tools
Output Requirements
Every final response should make these items explicit when they are relevant:
- Objective or requested deliverable
- Inputs used and assumptions introduced
- Workflow or decision path
- Core result, recommendation, or artifact
- Constraints, risks, caveats, or validation needs
- Unresolved items and next-step checks
Error Handling
- If required inputs are missing, state exactly which fields are missing and request only the minimum additional information.
- If the task goes outside the documented scope, stop instead of guessing or silently widening the assignment.
- If
scripts/main.py fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback.
- Do not fabricate files, citations, data, search results, or execution outcomes.
Input Validation
This skill accepts requests that match the documented purpose of volcano-plot-script and include enough context to complete the workflow safely.
Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:
volcano-plot-script only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.
Response Template
Use the following fixed structure for non-trivial requests:
- Objective
- Inputs Received
- Assumptions
- Workflow
- Deliverable
- Risks and Limits
- Next Checks
If the request is simple, you may compress the structure, but still keep assumptions and limits explicit when they affect correctness.
1---2name: volcano-plot-script3description: Generate R/Python code for volcano plots from DEG (Differentially Expressed Genes) analysis results. Triggered when user needs visualization of gene expression data, p-value vs fold-change scatter plots, publication-ready figures for bioinformatics analysis.4license: MIT5---6> **Source**: [https://github.com/aipoch/medical-research-skills](https://github.com/aipoch/medical-research-skills)
7
8# Volcano Plot Script Generator
9
10A skill for generating publication-ready volcano plots from differential gene expression analysis results.
11
12## When to Use
13
14- Use this skill when the task is to Generate R/Python code for volcano plots from DEG (Differentially Expressed Genes) analysis results. Triggered when user needs visualization of gene expression data, p-value vs fold-change scatter plots, publication-ready figures for bioinformatics analysis.
15- Use this skill for data analysis tasks that require explicit assumptions, bounded scope, and a reproducible output format.
16- Use this skill when you need a documented fallback path for missing inputs, execution errors, or partial evidence.
17
18## Key Features
19
20- Scope-focused workflow aligned to: Generate R/Python code for volcano plots from DEG (Differentially Expressed Genes) analysis results. Triggered when user needs visualization of gene expression data, p-value vs fold-change scatter plots, publication-ready figures for bioinformatics analysis.
21- Packaged executable path(s): `scripts/main.py`.
22- Reference material available in `references/` for task-specific guidance.
23- Reusable packaged asset(s), including `assets/example_volcano.R`.
24- Structured execution path designed to keep outputs consistent and reviewable.
25
26## Dependencies
27
28## Example Usage
29
30See `## Usage` above for related details.
31
32```bash
33cd "20260318/scientific-skills/Data Analytics/volcano-plot-script"
34python -m py_compile scripts/main.py
35python scripts/main.py --help
36```
37
38Example run plan:
391. Confirm the user input, output path, and any required config values.
402. Edit the in-file `CONFIG` block or documented parameters if the script uses fixed settings.
413. Run `python scripts/main.py` with the validated inputs.
424. Review the generated output and return the final artifact with any assumptions called out.
43
44## Implementation Details
45
46See `## Workflow` above for related details.
47
48- Execution model: validate the request, choose the packaged workflow, and produce a bounded deliverable.
49- Input controls: confirm the source files, scope limits, output format, and acceptance criteria before running any script.
50- Primary implementation surface: `scripts/main.py`.
51- Reference guidance: `references/` contains supporting rules, prompts, or checklists.
52- Packaged assets: reusable files are available under `assets/`.
53- Parameters to clarify first: input path, output path, scope filters, thresholds, and any domain-specific constraints.
54- Output discipline: keep results reproducible, identify assumptions explicitly, and avoid undocumented side effects.
55
56## Quick Check
57
58Use this command to verify that the packaged script entry point can be parsed before deeper execution.
59
60```bash
61python -m py_compile scripts/main.py
62```
63
64## Audit-Ready Commands
65
66Use these concrete commands for validation. They are intentionally self-contained and avoid placeholder paths.
67
68```bash
69python -m py_compile scripts/main.py
70python scripts/main.py --help
71python scripts/main.py --input "Audit validation sample with explicit symptoms, history, assessment, and next-step plan."
72```
73
74## Workflow
75
761. Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.
772. Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.
783. Use the packaged script path or the documented reasoning path with only the inputs that are actually available.
794. Return a structured result that separates assumptions, deliverables, risks, and unresolved items.
805. If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.
81
82## Overview
83
84Volcano plots visualize the relationship between statistical significance (p-values) and magnitude of change (fold changes) in gene expression data. This skill generates customizable R or Python scripts for creating high-quality figures suitable for publications.
85
86## Use Cases
87
88- Visualize RNA-seq DEG analysis results
89- Identify significantly upregulated and downregulated genes
90- Highlight genes of interest (markers, pathways)
91- Generate publication-quality figures for manuscripts
92- Compare multiple experimental conditions
93
94## Input Requirements
95
96Required input data format:
97- Gene identifier (gene symbol or ENSEMBL ID)
98- Log2 fold change values
99- Adjusted or raw p-values
100- Optional: gene annotations, pathways
101
102## Output
103
104- Publication-ready volcano plot (PNG/PDF/SVG)
105- Customizable R or Python script
106- Optional: labeled significant gene lists
107
108## Usage
109
110```python
111
112# Example: Run the volcano plot generator
113python scripts/main.py --input deg_results.csv --output volcano_plot.png
114```
115
116## Parameters
117
118| Parameter | Description | Default |
119|-----------|-------------|---------|
120| `--input` | Path to DEG results CSV/TSV | required |
121| `--output` | Output plot file path | volcano_plot.png |
122| `--log2fc-col` | Column name for log2 fold change | log2FoldChange |
123| `--pvalue-col` | Column name for p-value | padj |
124| `--gene-col` | Column name for gene IDs | gene |
125| `--log2fc-thresh` | Log2 FC threshold for significance | 1.0 |
126| `--pvalue-thresh` | P-value threshold | 0.05 |
127| `--label-genes` | File with genes to label | None |
128| `--top-n` | Label top N significant genes | 10 |
129| `--color-up` | Color for upregulated genes | #E74C3C |
130| `--color-down` | Color for downregulated genes | #3498DB |
131| `--color-ns` | Color for non-significant genes | #95A5A6 |
132
133## Technical Difficulty
134
135**Medium** - Requires understanding of:
136- DEG analysis concepts (fold change, p-values, FDR)
137- Data visualization principles
138- Matplotlib/ggplot2 plotting libraries
139
140### Python
141- pandas
142- matplotlib
143- seaborn
144- numpy
145
146### R
147- ggplot2
148- dplyr
149- ggrepel (for label positioning)
150
151## References
152
153- [Example datasets and templates](references/)
154- Best practices for volcano plot visualization
155- Color schemes for accessibility
156
157## Author
158
159Auto-generated skill for bioinformatics visualization.
160
161## Risk Assessment
162
163| Risk Indicator | Assessment | Level |
164|----------------|------------|-------|
165| Code Execution | Python/R scripts executed locally | Medium |
166| Network Access | No external API calls | Low |
167| File System Access | Read input files, write output plots | Medium |
168| Instruction Tampering | Standard prompt guidelines | Low |
169| Data Exposure | Output files saved to workspace | Low |
170
171## Security Checklist
172
173- [ ] No hardcoded credentials or API keys
174- [ ] Input file paths validated (no ../ traversal)
175- [ ] Output directory restricted to workspace
176- [ ] Script execution in sandboxed environment
177- [ ] Error messages sanitized (no stack traces exposed)
178- [ ] Dependencies audited (pandas, matplotlib, seaborn, numpy)
179
180## Prerequisites
181
182```text
183
184# Python dependencies
185pip install -r requirements.txt
186
187# R dependencies (if using R)
188install.packages(c("ggplot2", "dplyr", "ggrepel"))
189```
190
191## Evaluation Criteria
192
193### Success Metrics
194- [ ] Successfully generates executable Python/R script
195- [ ] Output plot is publication-ready quality
196- [ ] Correctly identifies significant genes based on thresholds
197- [ ] Handles missing or malformed data gracefully
198- [ ] Color scheme is accessible (colorblind-friendly)
199
200### Test Cases
2011. **Basic DEG Visualization**: Input standard DESeq2 results → Valid volcano plot
2022. **Custom Thresholds**: Adjust log2FC and p-value thresholds → Correct gene classification
2033. **Gene Labeling**: Specify genes to label → Labels appear correctly
2044. **Large Dataset**: Input 20,000+ genes → Performance remains acceptable
2055. **Malformed Data**: Input with missing values → Graceful error handling
206
207## Lifecycle Status
208
209- **Current Stage**: Draft
210- **Next Review Date**: 2026-03-06
211- **Known Issues**: None
212- **Planned Improvements**:
213 - Add interactive plot option (Plotly)
214 - Support for multiple comparison groups
215 - Integration with pathway enrichment tools
216
217## Output Requirements
218
219Every final response should make these items explicit when they are relevant:
220
221- Objective or requested deliverable
222- Inputs used and assumptions introduced
223- Workflow or decision path
224- Core result, recommendation, or artifact
225- Constraints, risks, caveats, or validation needs
226- Unresolved items and next-step checks
227
228## Error Handling
229
230- If required inputs are missing, state exactly which fields are missing and request only the minimum additional information.
231- If the task goes outside the documented scope, stop instead of guessing or silently widening the assignment.
232- If `scripts/main.py` fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback.
233- Do not fabricate files, citations, data, search results, or execution outcomes.
234
235## Input Validation
236
237This skill accepts requests that match the documented purpose of `volcano-plot-script` and include enough context to complete the workflow safely.
238
239Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:
240
241> `volcano-plot-script` only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.
242
243## Response Template
244
245Use the following fixed structure for non-trivial requests:
246
2471. Objective
2482. Inputs Received
2493. Assumptions
2504. Workflow
2515. Deliverable
2526. Risks and Limits
2537. Next Checks
254
255If the request is simple, you may compress the structure, but still keep assumptions and limits explicit when they affect correctness.