Agent Skills
Phylogenetic tree

Phylogenetic Tree Styler

AIPOCH

Beautify phylogenetic trees with taxonomy color blocks, bootstrap values, and timeline annotations. Supports Newick format with customizable styling options.

28
0
FILES
phylogenetic-tree-styler/
skill.md
scripts
main.py

SKILL.md

Phylogenetic Tree Styler

Features

Beautify phylogenetic trees, add taxonomy color blocks, Bootstrap values, and timelines.

Usage

python3 scripts/main.py --input <input_tree.nwk> --output <output.png> [options]

Parameters

ParameterDescriptionDefault
-i, --inputInput Newick format phylogenetic tree fileRequired
-o, --outputOutput image file pathtree_styled.png
-f, --formatOutput format: png, pdf, svgpng
-w, --widthImage width (pixels)1200
-h, --heightImage height (pixels)800
--show-bootstrapShow Bootstrap valuesFalse
--bootstrap-thresholdOnly show Bootstrap values above this threshold50
--taxonomy-fileSpecies taxonomy information file (CSV format: name,domain,phylum,class,order,family,genus)None
--show-timelineShow timelineFalse
--root-ageRoot node age (million years ago)None
--branch-colorBranch colorblack
--leaf-colorLeaf node label colorblack

Examples

Basic Beautification

python3 scripts/main.py -i tree.nwk -o tree_basic.png

Show Bootstrap Values

python3 scripts/main.py -i tree.nwk -o tree_bootstrap.png --show-bootstrap --bootstrap-threshold 70

Add Taxonomy Color Blocks

python3 scripts/main.py -i tree.nwk -o tree_taxonomy.png --taxonomy-file taxonomy.csv

Add Timeline

python3 scripts/main.py -i tree.nwk -o tree_timeline.png --show-timeline --root-age 500

Comprehensive Usage

python3 scripts/main.py -i tree.nwk -o tree_full.png \
    --show-bootstrap --bootstrap-threshold 70 \
    --taxonomy-file taxonomy.csv \
    --show-timeline --root-age 500

Taxonomy Information File Format

taxonomy.csv example:

name,domain,phylum,class
Species_A,Bacteria,Proteobacteria,Gammaproteobacteria
Species_B,Bacteria,Firmicutes,Bacilli
Species_C,Archaea,Euryarchaeota,Methanobacteria

Dependencies

  • Python 3.8+
  • ete3
  • matplotlib
  • numpy
  • pandas

Install dependencies:

pip install ete3 matplotlib numpy pandas

Input Format

Supports standard Newick format (.nwk or .newick):

((A:0.1,B:0.2)95:0.3,(C:0.4,D:0.5)88:0.6);

Bootstrap values can be placed at node label positions (like the 95, 88 above).

Risk Assessment

Risk IndicatorAssessmentLevel
Code ExecutionPython/R scripts executed locallyMedium
Network AccessNo external API callsLow
File System AccessRead input files, write output filesMedium
Instruction TamperingStandard prompt guidelinesLow
Data ExposureOutput files saved to workspaceLow

Security Checklist

  • No hardcoded credentials or API keys
  • No unauthorized file system access (../)
  • Output does not expose sensitive information
  • Prompt injection protections in place
  • Input file paths validated (no ../ traversal)
  • Output directory restricted to workspace
  • Script execution in sandboxed environment
  • Error messages sanitized (no stack traces exposed)
  • Dependencies audited

Prerequisites

No additional Python packages required.

Evaluation Criteria

Success Metrics

  • Successfully executes main functionality
  • Output meets quality standards
  • Handles edge cases gracefully
  • Performance is acceptable

Test Cases

  1. Basic Functionality: Standard input → Expected output
  2. Edge Case: Invalid input → Graceful error handling
  3. Performance: Large dataset → Acceptable processing time

Lifecycle Status

  • Current Stage: Draft
  • Next Review Date: 2026-03-06
  • Known Issues: None
  • Planned Improvements:
    • Performance optimization
    • Additional feature support