bio-phylo-species-trees
Estimate species trees using coalescent methods including ASTRAL-III, wASTRAL, ASTRAL-Pro, SVDQuartets, and BPP. Use when multi-locus data shows gene tree discordance from incomplete lineage sorting, when in the anomaly zone where concatenation is misleading, or when computing concordance factors to assess topological support.
What this skill does
## Version Compatibility
Reference examples tested with: ASTER 1.15+ (ASTRAL-III/wASTRAL/ASTRAL-Pro), IQ-TREE 2.2+ (concordance factors), PAUP* 4.0a168+ (SVDQuartets)
Before using code patterns, verify installed versions match. If versions differ:
- CLI: `astral --version` then `astral --help` to confirm flags
- CLI: `iqtree2 --version` then `iqtree2 --help` to confirm flags
- CLI: PAUP* version displayed at startup
If commands fail, introspect the installed version and adapt flags rather than retrying.
# Coalescent-Based Species Tree Estimation
**"Estimate a species tree from multi-locus data"** -> Infer the species-level phylogeny accounting for gene tree discordance caused by incomplete lineage sorting (ILS), using summary coalescent or full-likelihood methods.
- CLI: `astral -i gene_trees.tre -o species_tree.tre` (ASTER/ASTRAL-III)
- CLI: `iqtree2 -t species.tre --gcf gene_trees.tre -s concat.fasta --scfl 100` (concordance factors)
- CLI: `svdquartets nquartets=all bootstrap=standard nreps=100` (PAUP*)
## When Concatenation Fails
The multispecies coalescent (MSC) models gene tree discordance arising from incomplete lineage sorting. Concatenation assumes all genes share the same tree, an assumption violated in three key scenarios:
1. **Short internal branches relative to population size**: When internodes are short (in coalescent units), lineages fail to coalesce within species boundaries, producing ILS. The shorter the internode and the larger the effective population size, the more discordance.
2. **The anomaly zone**: A region of tree space where the most common gene tree topology does NOT match the species tree. Concatenation becomes statistically inconsistent in the anomaly zone; more data makes the wrong answer more confident. This occurs when successive internal branches are both very short.
3. **Rapid radiations**: Short successive speciation events maximize the proportion of tree space in the anomaly zone. Phylogenomic datasets spanning rapid radiations routinely show >50% of gene trees conflicting with the species tree.
**Practical signal**: If gene concordance factor (gCF) values frequently fall below 50% across backbone nodes, coalescent methods should be considered. Concordance factors below 33% at a node indicate that a different resolution has more support than the species tree at that branch.
## Concatenation vs Coalescent Decision
| Condition | Recommended Approach |
|-----------|---------------------|
| All gCF > 70% | Concatenation is reliable; coalescent and concatenation will agree |
| Some gCF 30-70% | Run both; compare topologies and report concordance factors |
| Many gCF < 30% | Coalescent methods required; concatenation is unreliable |
| Known hybridization/introgression | Neither pure method works; use network approaches |
When gCF and species tree disagree at a node, the coalescent analysis should be given priority, as it is statistically consistent under the MSC while concatenation is not.
## Method Comparison
| Tool | Input | Speed | Key Features |
|------|-------|-------|--------------|
| ASTRAL-III | Single-copy gene tree topologies | Fast | Most widely used; handles hundreds of genes |
| wASTRAL | Gene trees with branch lengths/support | Fast | Uses gene tree uncertainty for improved accuracy |
| ASTRAL-Pro 2/3 | Multi-copy gene family trees | Fast | Handles gene duplication and loss |
| CASTER | Multiple sequence alignments | Fast | Bypasses gene tree estimation entirely |
| SVDQuartets | Concatenated alignment (site patterns) | Fast | In PAUP*; works from site patterns without gene trees |
| BPP | Multi-locus alignments | Very slow | Most accurate; jointly estimates species tree + divergences; species delimitation |
| StarBEAST3 | Multi-locus alignments | Very slow | Integrates with BEAST2 for dating |
**ASTER package (2025)**: Consolidates ASTRAL-III, wASTRAL, ASTRAL-Pro 2/3, CASTER, and WASTER into a single C++ package. Much faster and more memory-efficient than the original Java ASTRAL implementations. Install from https://github.com/chaoszhang/ASTER.
## ASTRAL Species Tree Pipeline
### Infer Gene Trees and Estimate Species Tree
**Goal:** Estimate a species tree from multi-locus sequence data by first inferring per-locus ML gene trees, then summarizing them under the coalescent model.
**Approach:** Run IQ-TREE2 independently on each locus alignment with model selection and bootstrap, collect all gene trees, then run ASTRAL to find the species tree that agrees with the largest number of quartet topologies from the gene trees.
```bash
# 1. Infer gene trees (one per locus, single-threaded for parallelism across loci)
for f in loci/*.fasta; do
iqtree2 -s "$f" -m MFP -B 1000 -bnni -T 1 --prefix "${f%.fasta}"
done
# 2. Collect gene trees into a single file
cat loci/*.treefile > gene_trees.tre
# 3. Run ASTRAL species tree estimation (via ASTER)
# Local posterior probability (pp) replaces bootstrap for branch support
astral -i gene_trees.tre -o species_tree.tre
# 4. wASTRAL for datasets with noisy gene trees (uses branch length information)
wastral -i gene_trees.tre -o species_tree_wastral.tre
```
### Compute Concordance Factors
**Goal:** Quantify how much gene-level and site-level data supports each branch in the species tree.
**Approach:** Map each gene tree and each informative site onto the species tree, counting concordant vs discordant quartets at every internal branch.
```bash
# Gene concordance factors (gCF) + likelihood-based site concordance factors (sCF)
iqtree2 -t species_tree.tre --gcf gene_trees.tre -s concat.fasta --scfl 100
# Output: species_tree.tre.cf.tree (tree with gCF/sCF annotations)
# species_tree.tre.cf.stat (per-branch statistics)
```
## Interpreting Concordance Factors
| Metric | Range | Meaning |
|--------|-------|---------|
| gCF | 0-100% | Percentage of decisive gene trees containing this branch |
| sCF | ~33-100% | Percentage of decisive sites supporting this branch (three possible resolutions) |
### Interpretation Guide
- **gCF = 100%, sCF = 100%**: Complete concordance across all loci and sites (rare in practice).
- **gCF > 50%, sCF > 50%**: Majority support; branch is well-supported under the coalescent.
- **gCF ~ 33%, sCF ~ 33%**: Completely equivocal; three possible resolutions are equally likely. No topological information at this node.
- **gCF ~ 0%**: No gene tree contains this branch. Could indicate severe ILS, introgression, or systematic gene tree estimation error.
- **gCF much lower than sCF**: Gene tree estimation error is inflating discordance. Individual locus alignments lack sufficient signal to resolve gene trees correctly. Consider wASTRAL, which accounts for gene tree uncertainty.
- **sCF < 33%**: A different resolution is better supported than the current species tree at this node. The species tree topology may be incorrect here.
### Distinguishing Quartet Asymmetry
For any internal branch, gene trees partition into three quartet topologies (q1, q2, q3). Under ILS alone, the two minor quartets should be approximately equal (q2 ~ q3). A significant excess of one minor quartet over the other suggests introgression or hybridization rather than ILS.
## Gene Tree Estimation Error vs Biological Discordance
Short alignments produce noisy gene trees, and low gCF may reflect estimation error rather than genuine ILS. Strategies to distinguish:
- **Compare gCF and sCF**: If gCF is much lower than sCF, gene tree estimation error is the primary driver. Sites contain signal that gene tree inference failed to capture.
- **Filter gene trees**: Remove gene trees inferred from very short alignments (<200 informative sites) or with very low bootstrap support.
- **Use wASTRAL**: Weights gene tree quartets by branch support, down-weighting poorly resolved splits.
- **Use CASTER**: Bypasses gene tree estimation entirely, working directly from alignments.
## SVDQuartets (Site-Pattern Method)
When individual locus alignments are too shoRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.