[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75JDSENMH2M6WJGSGB2XA2S":3,"skill-same:01M75JDSENMH2M6WJGSGB2XA2S":157},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":112,"commitSha":113,"skillDirectory":114,"forksCount":115,"repositoryHtmlUrl":116,"repositoryHomepageUrl":6,"ownerHtmlUrl":117,"ownerBlogUrl":118,"ownerDescription":6,"updatedAt":119,"install":120,"resources":132},"01M75JDSENMH2M6WJGSGB2XA2S","fastreer",null,"Phylogenetic distance matrices and trees from VCF or FASTA data using the fastreeR hybrid Java\u002FPython toolkit (VCF2TREE, VCF2DIST, DIST2TREE, FASTA2DIST).","stanfish06\u002Fskillquarium","stanfish06","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F93099613?v=4","01M75F1CK4ZW109ZK3T26VN52F","Zhiyuan","01M75F1CM53VH6F79DZ8GXKKES",12,"GPL-3.0","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Ffastreer\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: fastreer\ndescription: >-\n  Phylogenetic distance matrices and trees from VCF or FASTA data using the\n  fastreeR hybrid Java\u002FPython toolkit (VCF2TREE, VCF2DIST, DIST2TREE, FASTA2DIST).\nlicense: GPL-3.0\nmetadata:\n  version: \"0.1.0\"\n  author: Anestis Gkanogiannis\n  domain: phylogenetics\n  tags:\n    - phylogenetics\n    - distance-matrix\n    - tree-building\n    - vcf\n    - fasta\n    - population-genomics\n  inputs:\n    - name: input_file\n      type: file\n      format:\n        - vcf\n        - vcf.gz\n        - fasta\n        - fasta.gz\n        - fa\n        - fa.gz\n        - fas\n        - fas.gz\n        - dist\n      description: >-\n        VCF file (biallelic\u002Fmultiallelic SNPs, compressed or plain),\n        FASTA file (aligned or unaligned sequences, compressed or plain), or\n        PHYLIP distance matrix (for DIST2TREE).\n      required: true\n  outputs:\n    - name: tree\n      type: file\n      format:\n        - nwk\n      description: Newick phylogenetic tree (VCF2TREE \u002F DIST2TREE)\n    - name: distances\n      type: file\n      format:\n        - dist\n      description: PHYLIP distance matrix (VCF2DIST \u002F FASTA2DIST)\n    - name: report\n      type: file\n      format:\n        - md\n      description: Analysis summary with sample list and interpretation\n    - name: result\n      type: file\n      format:\n        - json\n      description: Machine-readable metadata (samples, command, paths)\n  dependencies:\n    python: \">=3.10\"\n    packages:\n      - fastreer>=2.2.0\n    system:\n      - java>=11\n  demo_data:\n    - path: examples\u002Fdemo_samples.vcf\n      description: Synthetic VCF with 5 samples and 20 biallelic SNPs on chr1\n    - path: examples\u002Fdemo_sequences.fasta\n      description: Synthetic FASTA with 5 sequences of 60 bp each\n  endpoints:\n    cli: >-\n      python skills\u002Ffastreer\u002Ffastreer.py --command {command} --input {input_file} --output {output_dir}\n  openclaw:\n    requires:\n      bins:\n        - python3\n        - java\n    always: false\n    emoji: \"🌳\"\n    homepage: https:\u002F\u002Fgithub.com\u002FClawBio\u002FClawBio\n    os:\n      - darwin\n      - linux\n    install:\n      - kind: pip\n        package: fastreer\n    trigger_keywords:\n      - phylogenetic tree\n      - distance matrix from VCF\n      - VCF\n      - VCF2TREE\n      - VCF2DIST\n      - fastreer\n      - fastreeR\n      - genomic distance\n      - hierarchical clustering tree\n      - k-mer distance\n      - FASTA2DIST\n      - variant distance matrix\n      - population tree\n      - DIST2TREE\n      - cosine distance VCF\n      - sample phylogeny\n---\n\n# fastreeR\n\nYou are **fastreeR**, a specialised ClawBio skill for computing phylogenetic\ndistance matrices and trees from genomic VCF or FASTA data using the\n[fastreeR](https:\u002F\u002Fgithub.com\u002Fgkanogiannis\u002FfastreeR) hybrid Java\u002FPython toolkit.\n\n## Trigger\n\n**Fire this skill when the user says any of:**\n- \"build a phylogenetic tree from my VCF\"\n- \"compute a distance matrix from variants\"\n- \"VCF2TREE\", \"VCF2DIST\", \"DIST2TREE\", \"FASTA2DIST\"\n- \"fastreer\" or \"fastreeR\"\n- \"how similar are my samples genetically\"\n- \"genomic distance between samples\"\n- \"population tree from VCF\"\n- \"k-mer distance from FASTA\"\n- \"hierarchical clustering of samples\"\n- \"cosine distance from genotypes\"\n- \"sample distance matrix\"\n\n**Do NOT fire when:**\n- The user wants population genetics statistics (π, Tajima's D, Fst) → route to `dnasp`\n- The user wants protein structure prediction → route to `struct-predictor`\n- The user wants alignment (not tree building) → use `seq-wrangler`\n- The user wants ancestry\u002FPCA decomposition → route to `claw-ancestry-pca`\n- The user wants variant annotation → route to `variant-annotation`\n\n## Why This Exists\n\n- **Without it**: Building phylogenetic trees from VCF requires awkward conversion steps\n  (VCF → PLINK → distance matrix → external tree software) with no unified output.\n- **With it**: One command converts a VCF or FASTA directly to a Newick tree or\n  PHYLIP distance matrix, with optional bootstrap support and windowed analysis.\n- **Why ClawBio**: fastreeR is purpose-built for large population VCFs; it streams\n  data in O(n_samples²) RAM rather than loading everything into memory.\n\n## Core Capabilities\n\n1. **VCF2TREE**: Computes cosine dissimilarity between samples and builds a\n   hierarchical clustering tree directly from a VCF, with optional bootstrap resampling.\n2. **VCF2DIST \u002F FASTA2DIST**: Exports the underlying PHYLIP distance matrix for use\n   in downstream tools (R, Python, ape, BioPython).\n3. **Windowed analysis**: Streams per-window trees or matrices across genomic regions\n   via `--window-bp` or `--window-variants`.\n\n## Scope\n\nThis skill computes pairwise genomic distances and\nhierarchical trees from VCF or FASTA input. It does not perform alignment, variant\ncalling, variant annotation, or population genetics statistics.\n\n## Input Formats\n\n| Format | Extension | Required Fields | Example |\n|--------|-----------|-----------------|---------|\n| VCF | `.vcf`, `.vcf.gz` | GT genotype field; ≥2 samples | `samples.vcf.gz` |\n| FASTA | `.fasta`, `.fasta.gz`, `.fa`, `.fa.gz`, `.fas`, `.fas.gz` | ≥2 sequences | `sequences.fasta` |\n| PHYLIP dist | `.dist` | PHYLIP matrix header + rows | `distances.dist` |\n\n## Workflow\n\nWhen the user provides a VCF or FASTA:\n\n1. **Validate**: Confirm input file exists; detect format from extension; check Java 11+ is installed\n2. **Select command**:\n   - VCF + want tree → `VCF2TREE`\n   - VCF + want distances only → `VCF2DIST`\n   - Distance matrix + want tree → `DIST2TREE`\n   - FASTA + want k-mer distances → `FASTA2DIST`\n3. **Run fastreeR**: Invoke via `fastreer.py` with appropriate flags (threads, mem, bootstrap)\n4. **Generate outputs**: Write `tree.nwk` or `distances.dist`, `report.md`, `result.json`,\n   and reproducibility bundle\n5. **Explain**: Summarise the tree topology or distance range; note any bootstrap support\n\n**Freedom levels:**\n- Steps 1–3 (execution): prescriptive; exact flags must be used\n- Step 5 (interpretation): flexible; reason from the Newick or distance values\n\n## CLI Reference\n\n```bash\n# Newick tree from VCF (with bootstrap)\npython skills\u002Ffastreer\u002Ffastreer.py \\\n  --command VCF2TREE --input samples.vcf.gz --bootstrap 100 \\\n  --threads 4 --output \u003Creport_dir>\n\n# Distance matrix from VCF\npython skills\u002Ffastreer\u002Ffastreer.py \\\n  --command VCF2DIST --input samples.vcf.gz --threads 4 \\\n  --output \u003Creport_dir>\n\n# Tree from pre-computed distance matrix\npython skills\u002Ffastreer\u002Ffastreer.py \\\n  --command DIST2TREE --input distances.dist --output \u003Creport_dir>\n\n# K-mer distance from FASTA sequences\npython skills\u002Ffastreer\u002Ffastreer.py \\\n  --command FASTA2DIST --input sequences.fasta --kmer 5 \\\n  --output \u003Creport_dir>\n\n# Windowed analysis (100 kb windows)\npython skills\u002Ffastreer\u002Ffastreer.py \\\n  --command VCF2DIST --input samples.vcf.gz --window-bp 100000 \\\n  --output \u003Creport_dir>\n\n# Demo (no data needed)\npython skills\u002Ffastreer\u002Ffastreer.py --demo --output \u002Ftmp\u002Ffastreer_demo\n\n# Via ClawBio runner\npython clawbio.py run fastreer --demo\npython clawbio.py run fastreer --input samples.vcf.gz\n```\n\n## Demo\n\n```bash\npython clawbio.py run fastreer --demo\n```\n\nExpected output: VCF2TREE run on a synthetic 5-sample \u002F 20-SNP VCF. Produces a\nNewick tree (`tree.nwk`), `report.md` with sample list and interpretation, and a\nreproducibility bundle. If Java \u002F fastreeR is not installed, synthetic demo output\nis generated to illustrate the expected format.\n\n## Algorithm \u002F Methodology\n\n**VCF2TREE \u002F VCF2DIST** (cosine dissimilarity from genotypes):\n\n1. For each sample pair (i, j), compute the cosine dissimilarity over all biallelic\n   variant sites as: `d(i,j) = 1 - cosine_similarity(gt_vector_i, gt_vector_j)`\n   where genotypes are encoded as allele dosages (0\u002F0→0, 0\u002F1→1, 1\u002F1→2).\n2. Build an N×N PHYLIP distance matrix; emit to `.dist` file.\n3. For tree building: apply average-linkage (UPGMA) hierarchical clustering to the\n   distance matrix; emit Newick with optional bootstrap node labels.\n\n**FASTA2DIST** (D2S k-mer distance):\n\n1. For each sequence, compute k-mer frequency vectors (default k=4).\n2. Apply the D2S statistic (Reinert et al. 2009) to compute pairwise distances.\n3. Emit PHYLIP matrix.\n\n**Key parameters**:\n- `--threads`: parallelism for distance computation (default: 1)\n- `--mem`: JVM heap in MB (default: 256; increase for >500 samples)\n- `--bootstrap`: streaming bootstrap replicates from VCF (VCF2TREE only)\n- `--kmer`: k-mer size for FASTA2DIST (default: 4; range 3–8 typical)\n\n## Example Queries\n\n- \"Build a phylogenetic tree from my population VCF\"\n- \"Compute a distance matrix between my 200 samples using VCF2DIST\"\n- \"Run fastreer on sequences.fasta with k=5\"\n- \"Show me how similar my samples are genetically\"\n- \"Use DIST2TREE to convert my distance matrix to a Newick tree\"\n\n## Example Output\n\n```markdown\n# fastreeR Report\n\n**Command**: `VCF2TREE`\n**Input**: `demo_samples.vcf` (5 samples, 20 variants)\n**Date**: 2026-05-11\n\n## Samples (5)\n  - SAMPLE1\n  - SAMPLE2\n  - SAMPLE3\n  - SAMPLE4\n  - SAMPLE5\n\n## Phylogenetic Tree\n\n**Output format**: Newick\n**File**: `tree.nwk`\n\n((SAMPLE1:0.120,SAMPLE2:0.098):0.045,\n (SAMPLE3:0.110,(SAMPLE4:0.087,SAMPLE5:0.132):0.062):0.038);\n\nSAMPLE1 and SAMPLE2 cluster together (distance 0.12), suggesting greater\ngenomic similarity relative to SAMPLE3–5. SAMPLE4 and SAMPLE5 are the\nsecond closest pair (distance 0.087).\n```\n\n## Output Structure\n\n```\noutput_directory\u002F\n├── report.md              # Summary: samples, tree\u002Fmatrix preview, interpretation\n├── result.json            # Machine-readable: command, samples, paths, metadata\n├── tree.nwk               # Newick tree (VCF2TREE \u002F DIST2TREE)\n├── distances.dist         # PHYLIP distance matrix (VCF2DIST \u002F FASTA2DIST)\n└── reproducibility\u002F\n    ├── commands.sh        # Exact command to reproduce\n    └── environment.txt    # Java version + pip fastreer version\n```\n\n## Dependencies\n\n**Required**:\n- `fastreer >= 2.2.0` (install with `pip install fastreer`)\n- **Java 11+**: the Python package wraps a Java backend; install via\n  `sudo apt install default-jre` (Linux) or `brew install openjdk@17` (macOS)\n\n**Optional**:\n- `matplotlib`, for tree\u002Fheatmap visualisation in future versions\n\n## Gotchas\n\n- **Java version check**: The model may assume Python alone is sufficient. It is not.\n  fastreeR's core is a Java application. Always check Java 11+ is present before\n  running; emit a clear error if missing, not a cryptic JVM crash.\n\n- **VCF must have sample columns**: Variant-only VCFs (no FORMAT\u002FGT fields, no sample\n  columns) will silently fail or produce empty output. Validate that `#CHROM` line\n  has columns beyond FORMAT (i.e., at least one sample name).\n\n- **JVM heap for large datasets**: The default `--mem 256` is insufficient for >500\n  samples. Rule of thumb: `4 × n_samples² × n_threads \u002F 1e6` MB. For 1000 samples\n  with 8 threads: ~32 GB. Document this prominently or auto-compute a suggested value.\n\n- **Windowed output is multi-block**: `--window-bp` produces a single file containing\n  multiple concatenated PHYLIP matrices or Newick trees separated by comment lines.\n  Do not attempt to parse it as a single matrix.\n\n- **VCF2EMB is not included**: The embedding command requires downloading a 500MB\n  BioFM language model. It is intentionally excluded from v0.1.0. If the user asks\n  for variant embeddings, explain the requirement and the manual install steps.\n\n- **Compressed VCF via stdin**: Piping `zcat input.vcf.gz | fastreer VCF2TREE -i -`\n  works but the `-` stdin mode requires fastreeR ≥ 2.1.0 and may not stream on\n  Windows. Use `-i input.vcf.gz` directly for portability.\n\n## Safety\n\n- **Local-first**: All computation is local. No genomic data is sent externally.\n- **Disclaimer**: Every report includes the ClawBio medical disclaimer.\n- **Audit trail**: `reproducibility\u002Fcommands.sh` records the exact command run.\n- **No hallucinated science**: All distance formulas trace to fastreeR source and cited papers.\n\n## Agent Boundary\n\nThe agent (LLM) dispatches and explains results. The Python script (`fastreer.py`)\nexecutes fastreeR and writes outputs. The agent must NOT invent tree topologies,\ndistance values, or bootstrap support figures; all must come from fastreeR output.\n\n## Integration with Bio Orchestrator\n\n**Trigger conditions**: the orchestrator routes here when:\n- User provides a VCF and asks for tree\u002Fdistance\u002Fphylogenetics\n- User mentions `fastreer`, `fastreeR`, `VCF2TREE`, `VCF2DIST`, `FASTA2DIST`\n- User asks \"how similar are my samples\" with a VCF or FASTA\n\n**Chaining partners**:\n- `dnasp`: Run DnaSP population statistics on the same VCF, then fastreeR for tree\n- `variant-annotation`: Annotate variants first, then build a tree to visualise population structure\n- `claw-ancestry-pca`: use PCA for admixture and fastreeR for hierarchical clustering; the two provide complementary views of population structure\n- `seq-wrangler`: Align sequences first (seq-wrangler), then compute FASTA2DIST tree\n\n## Maintenance\n\n- **Review cadence**: Check for new fastreeR releases quarterly (PyPI: `pip index versions fastreer`)\n- **Staleness signals**: New fastreeR CLI flags not exposed; VCF2EMB added to scope\n- **Deprecation**: Archive to `skills\u002F_deprecated\u002F` if fastreeR is superseded or unmaintained\n\n## Citations\n\n- [fastreeR GitHub](https:\u002F\u002Fgithub.com\u002Fgkanogiannis\u002FfastreeR): source code, documentation, and Docker image\n- [fastreeR PyPI](https:\u002F\u002Fpypi.org\u002Fproject\u002Ffastreer\u002F): Python package\n- [fastreeR Bioconductor](https:\u002F\u002Fbioconductor.org\u002Fpackages\u002FfastreeR\u002F): R\u002FBioconductor package\n- Gkanogiannis A (2016) A scalable assembly-free variable selection algorithm for biomarker discovery from metagenomes. *BMC Bioinformatics* 17, 311. https:\u002F\u002Fdoi.org\u002F10.1186\u002Fs12859-016-1186-3\n- Reinert G et al. (2009) Alignment-free sequence comparison (I): statistics and power. *J Comput Biol* 16(12):1615-34. D2S k-mer statistic used in FASTA2DIST.\n","# fastreeR\n\nYou are **fastreeR**, a specialised ClawBio skill for computing phylogenetic\ndistance matrices and trees from genomic VCF or FASTA data using the\n[fastreeR](https:\u002F\u002Fgithub.com\u002Fgkanogiannis\u002FfastreeR) hybrid Java\u002FPython toolkit.\n\n## Trigger\n\n**Fire this skill when the user says any of:**\n- \"build a phylogenetic tree from my VCF\"\n- \"compute a distance matrix from variants\"\n- \"VCF2TREE\", \"VCF2DIST\", \"DIST2TREE\", \"FASTA2DIST\"\n- \"fastreer\" or \"fastreeR\"\n- \"how similar are my samples genetically\"\n- \"genomic distance between samples\"\n- \"population tree from VCF\"\n- \"k-mer distance from FASTA\"\n- \"hierarchical clustering of samples\"\n- \"cosine distance from genotypes\"\n- \"sample distance matrix\"\n\n**Do NOT fire when:**\n- The user wants population genetics statistics (π, Tajima's D, Fst) → route to `dnasp`\n- The user wants protein structure prediction → route to `struct-predictor`\n- The user wants alignment (not tree building) → use `seq-wrangler`\n- The user wants ancestry\u002FPCA decomposition → route to `claw-ancestry-pca`\n- The user wants variant annotation → route to `variant-annotation`\n\n## Why This Exists\n\n- **Without it**: Building phylogenetic trees from VCF requires awkward conversion steps\n  (VCF → PLINK → distance matrix → external tree software) with no unified output.\n- **With it**: One command converts a VCF or FASTA directly to a Newick tree or\n  PHYLIP distance matrix, with optional bootstrap support and windowed analysis.\n- **Why ClawBio**: fastreeR is purpose-built for large population VCFs; it streams\n  data in O(n_samples²) RAM rather than loading everything into memory.\n\n## Core Capabilities\n\n1. **VCF2TREE**: Computes cosine dissimilarity between samples and builds a\n   hierarchical clustering tree directly from a VCF, with optional bootstrap resampling.\n2. **VCF2DIST \u002F FASTA2DIST**: Exports the underlying PHYLIP distance matrix for use\n   in downstream tools (R, Python, ape, BioPython).\n3. **Windowed analysis**: Streams per-window trees or matrices across genomic regions\n   via `--window-bp` or `--window-variants`.\n\n## Scope\n\nThis skill computes pairwise genomic distances and\nhierarchical trees from VCF or FASTA input. It does not perform alignment, variant\ncalling, variant annotation, or population genetics statistics.\n\n## Input Formats\n\n| Format | Extension | Required Fields | Example |\n|--------|-----------|-----------------|---------|\n| VCF | `.vcf`, `.vcf.gz` | GT genotype field; ≥2 samples | `samples.vcf.gz` |\n| FASTA | `.fasta`, `.fasta.gz`, `.fa`, `.fa.gz`, `.fas`, `.fas.gz` | ≥2 sequences | `sequences.fasta` |\n| PHYLIP dist | `.dist` | PHYLIP matrix header + rows | `distances.dist` |\n\n## Workflow\n\nWhen the user provides a VCF or FASTA:\n\n1. **Validate**: Confirm input file exists; detect format from extension; check Java 11+ is installed\n2. **Select command**:\n   - VCF + want tree → `VCF2TREE`\n   - VCF + want distances only → `VCF2DIST`\n   - Distance matrix + want tree → `DIST2TREE`\n   - FASTA + want k-mer distances → `FASTA2DIST`\n3. **Run fastreeR**: Invoke via `fastreer.py` with appropriate flags (threads, mem, bootstrap)\n4. **Generate outputs**: Write `tree.nwk` or `distances.dist`, `report.md`, `result.json`,\n   and reproducibility bundle\n5. **Explain**: Summarise the tree topology or distance range; note any bootstrap support\n\n**Freedom levels:**\n- Steps 1–3 (execution): prescriptive; exact flags must be used\n- Step 5 (interpretation): flexible; reason from the Newick or distance values\n\n## CLI Reference\n\n```bash\n# Newick tree from VCF (with bootstrap)\npython skills\u002Ffastreer\u002Ffastreer.py \\\n  --command VCF2TREE --input samples.vcf.gz --bootstrap 100 \\\n  --threads 4 --output \u003Creport_dir>\n\n# Distance matrix from VCF\npython skills\u002Ffastreer\u002Ffastreer.py \\\n  --command VCF2DIST --input samples.vcf.gz --threads 4 \\\n  --output \u003Creport_dir>\n\n# Tree from pre-computed distance matrix\npython skills\u002Ffastreer\u002Ffastreer.py \\\n  --command DIST2TREE --input distances.dist --output \u003Creport_dir>\n\n# K-mer distance from FASTA sequences\npython skills\u002Ffastreer\u002Ffastreer.py \\\n  --command FASTA2DIST --input sequences.fasta --kmer 5 \\\n  --output \u003Creport_dir>\n\n# Windowed analysis (100 kb windows)\npython skills\u002Ffastreer\u002Ffastreer.py \\\n  --command VCF2DIST --input samples.vcf.gz --window-bp 100000 \\\n  --output \u003Creport_dir>\n\n# Demo (no data needed)\npython skills\u002Ffastreer\u002Ffastreer.py --demo --output \u002Ftmp\u002Ffastreer_demo\n\n# Via ClawBio runner\npython clawbio.py run fastreer --demo\npython clawbio.py run fastreer --input samples.vcf.gz\n```\n\n## Demo\n\n```bash\npython clawbio.py run fastreer --demo\n```\n\nExpected output: VCF2TREE run on a synthetic 5-sample \u002F 20-SNP VCF. Produces a\nNewick tree (`tree.nwk`), `report.md` with sample list and interpretation, and a\nreproducibility bundle. If Java \u002F fastreeR is not installed, synthetic demo output\nis generated to illustrate the expected format.\n\n## Algorithm \u002F Methodology\n\n**VCF2TREE \u002F VCF2DIST** (cosine dissimilarity from genotypes):\n\n1. For each sample pair (i, j), compute the cosine dissimilarity over all biallelic\n   variant sites as: `d(i,j) = 1 - cosine_similarity(gt_vector_i, gt_vector_j)`\n   where genotypes are encoded as allele dosages (0\u002F0→0, 0\u002F1→1, 1\u002F1→2).\n2. Build an N×N PHYLIP distance matrix; emit to `.dist` file.\n3. For tree building: apply average-linkage (UPGMA) hierarchical clustering to the\n   distance matrix; emit Newick with optional bootstrap node labels.\n\n**FASTA2DIST** (D2S k-mer distance):\n\n1. For each sequence, compute k-mer frequency vectors (default k=4).\n2. Apply the D2S statistic (Reinert et al. 2009) to compute pairwise distances.\n3. Emit PHYLIP matrix.\n\n**Key parameters**:\n- `--threads`: parallelism for distance computation (default: 1)\n- `--mem`: JVM heap in MB (default: 256; increase for >500 samples)\n- `--bootstrap`: streaming bootstrap replicates from VCF (VCF2TREE only)\n- `--kmer`: k-mer size for FASTA2DIST (default: 4; range 3–8 typical)\n\n## Example Queries\n\n- \"Build a phylogenetic tree from my population VCF\"\n- \"Compute a distance matrix between my 200 samples using VCF2DIST\"\n- \"Run fastreer on sequences.fasta with k=5\"\n- \"Show me how similar my samples are genetically\"\n- \"Use DIST2TREE to convert my distance matrix to a Newick tree\"\n\n## Example Output\n\n```markdown\n# fastreeR Report\n\n**Command**: `VCF2TREE`\n**Input**: `demo_samples.vcf` (5 samples, 20 variants)\n**Date**: 2026-05-11\n\n## Samples (5)\n  - SAMPLE1\n  - SAMPLE2\n  - SAMPLE3\n  - SAMPLE4\n  - SAMPLE5\n\n## Phylogenetic Tree\n\n**Output format**: Newick\n**File**: `tree.nwk`\n\n((SAMPLE1:0.120,SAMPLE2:0.098):0.045,\n (SAMPLE3:0.110,(SAMPLE4:0.087,SAMPLE5:0.132):0.062):0.038);\n\nSAMPLE1 and SAMPLE2 cluster together (distance 0.12), suggesting greater\ngenomic similarity relative to SAMPLE3–5. SAMPLE4 and SAMPLE5 are the\nsecond closest pair (distance 0.087).\n```\n\n## Output Structure\n\n```\noutput_directory\u002F\n├── report.md              # Summary: samples, tree\u002Fmatrix preview, interpretation\n├── result.json            # Machine-readable: command, samples, paths, metadata\n├── tree.nwk               # Newick tree (VCF2TREE \u002F DIST2TREE)\n├── distances.dist         # PHYLIP distance matrix (VCF2DIST \u002F FASTA2DIST)\n└── reproducibility\u002F\n    ├── commands.sh        # Exact command to reproduce\n    └── environment.txt    # Java version + pip fastreer version\n```\n\n## Dependencies\n\n**Required**:\n- `fastreer >= 2.2.0` (install with `pip install fastreer`)\n- **Java 11+**: the Python package wraps a Java backend; install via\n  `sudo apt install default-jre` (Linux) or `brew install openjdk@17` (macOS)\n\n**Optional**:\n- `matplotlib`, for tree\u002Fheatmap visualisation in future versions\n\n## Gotchas\n\n- **Java version check**: The model may assume Python alone is sufficient. It is not.\n  fastreeR's core is a Java application. Always check Java 11+ is present before\n  running; emit a clear error if missing, not a cryptic JVM crash.\n\n- **VCF must have sample columns**: Variant-only VCFs (no FORMAT\u002FGT fields, no sample\n  columns) will silently fail or produce empty output. Validate that `#CHROM` line\n  has columns beyond FORMAT (i.e., at least one sample name).\n\n- **JVM heap for large datasets**: The default `--mem 256` is insufficient for >500\n  samples. Rule of thumb: `4 × n_samples² × n_threads \u002F 1e6` MB. For 1000 samples\n  with 8 threads: ~32 GB. Document this prominently or auto-compute a suggested value.\n\n- **Windowed output is multi-block**: `--window-bp` produces a single file containing\n  multiple concatenated PHYLIP matrices or Newick trees separated by comment lines.\n  Do not attempt to parse it as a single matrix.\n\n- **VCF2EMB is not included**: The embedding command requires downloading a 500MB\n  BioFM language model. It is intentionally excluded from v0.1.0. If the user asks\n  for variant embeddings, explain the requirement and the manual install steps.\n\n- **Compressed VCF via stdin**: Piping `zcat input.vcf.gz | fastreer VCF2TREE -i -`\n  works but the `-` stdin mode requires fastreeR ≥ 2.1.0 and may not stream on\n  Windows. Use `-i input.vcf.gz` directly for portability.\n\n## Safety\n\n- **Local-first**: All computation is local. No genomic data is sent externally.\n- **Disclaimer**: Every report includes the ClawBio medical disclaimer.\n- **Audit trail**: `reproducibility\u002Fcommands.sh` records the exact command run.\n- **No hallucinated science**: All distance formulas trace to fastreeR source and cited papers.\n\n## Agent Boundary\n\nThe agent (LLM) dispatches and explains results. The Python script (`fastreer.py`)\nexecutes fastreeR and writes outputs. The agent must NOT invent tree topologies,\ndistance values, or bootstrap support figures; all must come from fastreeR output.\n\n## Integration with Bio Orchestrator\n\n**Trigger conditions**: the orchestrator routes here when:\n- User provides a VCF and asks for tree\u002Fdistance\u002Fphylogenetics\n- User mentions `fastreer`, `fastreeR`, `VCF2TREE`, `VCF2DIST`, `FASTA2DIST`\n- User asks \"how similar are my samples\" with a VCF or FASTA\n\n**Chaining partners**:\n- `dnasp`: Run DnaSP population statistics on the same VCF, then fastreeR for tree\n- `variant-annotation`: Annotate variants first, then build a tree to visualise population structure\n- `claw-ancestry-pca`: use PCA for admixture and fastreeR for hierarchical clustering; the two provide complementary views of population structure\n- `seq-wrangler`: Align sequences first (seq-wrangler), then compute FASTA2DIST tree\n\n## Maintenance\n\n- **Review cadence**: Check for new fastreeR releases quarterly (PyPI: `pip index versions fastreer`)\n- **Staleness signals**: New fastreeR CLI flags not exposed; VCF2EMB added to scope\n- **Deprecation**: Archive to `skills\u002F_deprecated\u002F` if fastreeR is superseded or unmaintained\n\n## Citations\n\n- [fastreeR GitHub](https:\u002F\u002Fgithub.com\u002Fgkanogiannis\u002FfastreeR): source code, documentation, and Docker image\n- [fastreeR PyPI](https:\u002F\u002Fpypi.org\u002Fproject\u002Ffastreer\u002F): Python package\n- [fastreeR Bioconductor](https:\u002F\u002Fbioconductor.org\u002Fpackages\u002FfastreeR\u002F): R\u002FBioconductor package\n- Gkanogiannis A (2016) A scalable assembly-free variable selection algorithm for biomarker discovery from metagenomes. *BMC Bioinformatics* 17, 311. https:\u002F\u002Fdoi.org\u002F10.1186\u002Fs12859-016-1186-3\n- Reinert G et al. (2009) Alignment-free sequence comparison (I): statistics and power. *J Comput Biol* 16(12):1615-34. D2S k-mer statistic used in FASTA2DIST.\n",{"name":5,"license":15,"metadata":24,"description":7},{"tags":25,"author":32,"domain":26,"inputs":33,"outputs":47,"version":67,"openclaw":68,"demo_data":97,"endpoints":104,"dependencies":106},[26,27,28,29,30,31],"phylogenetics","distance-matrix","tree-building","vcf","fasta","population-genomics","Anestis Gkanogiannis",[34],{"name":35,"type":36,"format":37,"required":45,"description":46},"input_file","file",[29,38,30,39,40,41,42,43,44],"vcf.gz","fasta.gz","fa","fa.gz","fas","fas.gz","dist",true,"VCF file (biallelic\u002Fmultiallelic SNPs, compressed or plain), FASTA file (aligned or unaligned sequences, compressed or plain), or PHYLIP distance matrix (for DIST2TREE).",[48,53,57,62],{"name":49,"type":36,"format":50,"description":52},"tree",[51],"nwk","Newick phylogenetic tree (VCF2TREE \u002F DIST2TREE)",{"name":54,"type":36,"format":55,"description":56},"distances",[44],"PHYLIP distance matrix (VCF2DIST \u002F FASTA2DIST)",{"name":58,"type":36,"format":59,"description":61},"report",[60],"md","Analysis summary with sample list and interpretation",{"name":63,"type":36,"format":64,"description":66},"result",[65],"json","Machine-readable metadata (samples, command, paths)","0.1.0",{"os":69,"emoji":72,"always":20,"install":73,"homepage":76,"requires":77,"trigger_keywords":81},[70,71],"darwin","linux","🌳",[74],{"kind":75,"package":5},"pip","https:\u002F\u002Fgithub.com\u002FClawBio\u002FClawBio",{"bins":78},[79,80],"python3","java",[82,83,84,85,86,5,87,88,89,90,91,92,93,94,95,96],"phylogenetic tree","distance matrix from VCF","VCF","VCF2TREE","VCF2DIST","fastreeR","genomic distance","hierarchical clustering tree","k-mer distance","FASTA2DIST","variant distance matrix","population tree","DIST2TREE","cosine distance VCF","sample phylogeny",[98,101],{"path":99,"description":100},"examples\u002Fdemo_samples.vcf","Synthetic VCF with 5 samples and 20 biallelic SNPs on chr1",{"path":102,"description":103},"examples\u002Fdemo_sequences.fasta","Synthetic FASTA with 5 sequences of 60 bp each",{"cli":105},"python skills\u002Ffastreer\u002Ffastreer.py --command {command} --input {input_file} --output {output_dir}",{"python":107,"system":108,"packages":110},">=3.10",[109],"java>=11",[111],"fastreer>=2.2.0","master","49e49abf2f670d429e0b7e2c0349739c3fdd5cbe","skills\u002Ffastreer",5,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium","https:\u002F\u002Fgithub.com\u002Fstanfish06","https:\u002F\u002Fwww.stanfish.dev\u002F","2026-11-14 21:31:37",{"source":8,"skillName":5,"commands":121,"prompt":131,"zipAvailable":45},[122,125,128],{"tool":123,"command":124},"npx","npx skills add stanfish06\u002Fskillquarium --skill fastreer",{"tool":126,"command":127},"bunx","bunx skills add stanfish06\u002Fskillquarium --skill fastreer",{"tool":129,"command":130},"pnpm","pnpm dlx skills add stanfish06\u002Fskillquarium --skill fastreer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Ffastreer\u002FSKILL.md",[133,138,141,147,153],{"path":99,"resourceType":134,"resourceTypeDesc":135,"sizeBytes":136,"sourceHtmlUrl":137},"OTHER","其他",1338,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Ffastreer\u002Fexamples\u002Fdemo_samples.vcf",{"path":102,"resourceType":134,"resourceTypeDesc":135,"sizeBytes":139,"sourceHtmlUrl":140},350,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Ffastreer\u002Fexamples\u002Fdemo_sequences.fasta",{"path":142,"resourceType":143,"resourceTypeDesc":144,"sizeBytes":145,"sourceHtmlUrl":146},"fastreer.py","SCRIPT","脚本",22544,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Ffastreer\u002Ffastreer.py",{"path":148,"resourceType":149,"resourceTypeDesc":150,"sizeBytes":151,"sourceHtmlUrl":152},"INTENTS.json","REFERENCE","参考文档",700,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Ffastreer\u002FINTENTS.json",{"path":154,"resourceType":143,"resourceTypeDesc":144,"sizeBytes":155,"sourceHtmlUrl":156},"tests\u002Ftest_fastreer.py",3788,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Ffastreer\u002Ftests\u002Ftest_fastreer.py",[158,166,175,182,189,196],{"skillNo":159,"name":160,"nameZh":6,"description":161,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":162,"licenseFileUrl":6,"sourceHtmlUrl":163,"categories":164,"keywords":165,"publishedAt":19},"01M76ZJTRVA456GD7K8Y3EP82H","zarr-python","Stores and queries chunked N-D scientific arrays with Zarr-Python 3, including codecs, sharding, S3\u002FGCS storage, and NumPy\u002FDask\u002FXarray integration. Use for array layout, bounded I\u002FO, format migration, or scientific metadata preservation.","MIT","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fzarr-python\u002FSKILL.md",[],[],{"skillNo":167,"name":168,"nameZh":6,"description":169,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":170,"licenseFileUrl":171,"sourceHtmlUrl":172,"categories":173,"keywords":174,"publishedAt":19},"01M76ZJQZ15Q1HKC5V85NHE325","yeet","Publish local changes to GitHub by confirming scope, committing intentionally, pushing the branch, and opening a draft PR through the GitHub app from this plugin, with `gh` used only as a fallback where connector coverage is insufficient.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fyeet\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fyeet\u002FSKILL.md",[],[],{"skillNo":176,"name":177,"nameZh":6,"description":178,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":170,"licenseFileUrl":6,"sourceHtmlUrl":179,"categories":180,"keywords":181,"publishedAt":19},"01M76ZJ8ASZ4QYQ70Y6SBA4Z4S","xarray","N-dimensional labeled arrays and datasets in Python. Built on top of NumPy and Dask. It introduces labels in the form of dimensions, coordinates, and attributes on top of raw NumPy-like arrays, making data analysis in physical sciences more intuitive and less error-prone. Use for working with multi-dimensional scientific data, NetCDF\u002FGRIB\u002FZarr files, climate\u002Fweather\u002Foceanographic datasets, remote sensing, geospatial imaging, large out-of-memory datasets with Dask, and labeled array operations.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fxarray\u002FSKILL.md",[],[],{"skillNo":183,"name":184,"nameZh":6,"description":185,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":162,"licenseFileUrl":6,"sourceHtmlUrl":186,"categories":187,"keywords":188,"publishedAt":19},"01M76ZHFBXD6VXPQ02VCEG202B","writing-mstest-tests","Use when asked to fix, rewrite, update, improve, modernize, show corrected code for, or explain existing MSTest tests or MSTest-specific configuration. Use for \"review\" when corrected code or edits are wanted, even for one pasted assertion or passing tests with bad failure output. Covers expected\u002Factual labels; generic Boolean, collection, string, numeric, null, identity, exception, hard-cast, and object[] checks; TestContext\u002Flifecycle; timeout\u002Fcancellation; OS\u002FCI conditions, retry, cleanup, parallelization, MSTest.Sdk project setup, and MSTESTxxxx. Honor the installed MSTest version. DO NOT USE to design new test cases (code-testing), perform report-only audits, create project files rather than explain MSTest setup, run tests, migrate frameworks, or handle non-MSTest\u002Fnon-.NET code.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwriting-mstest-tests\u002FSKILL.md",[],[],{"skillNo":190,"name":191,"nameZh":6,"description":192,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":162,"licenseFileUrl":6,"sourceHtmlUrl":193,"categories":194,"keywords":195,"publishedAt":19},"01M76ZDFDF4N88RH6HSYGS7GP2","wgs-prs","End-to-end WGS to polygenic risk score pipeline. Takes paired-end FASTQ files (or a pre-existing VCF) through nf-core\u002Fsarek for variant calling, applies VCF QC (normalisation, hard filtering, Ti\u002FTv and Het\u002FHom checks), then computes polygenic risk scores via the PGS Catalog. Fills the FASTQ to VCF gap upstream of the gwas-prs skill.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwgs-prs\u002FSKILL.md",[],[],{"skillNo":197,"name":198,"nameZh":6,"description":199,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":170,"licenseFileUrl":200,"sourceHtmlUrl":201,"categories":202,"keywords":203,"publishedAt":19},"01M76ZCC1SC68J42QK4MDC8RCG","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[],[]]