skills/tooluniverse-comparative-genomics/SKILL.md
Cross-species gene comparison and ortholog analysis. Integrates Ensembl Compara orthologs, NCBI Gene, UniProt, OLS, Monarch, and OpenTargets to identify orthologs, paralogs, sequence conservation, functional conservation across species, and lineage-specific gene gains/losses. Use for phylogenetic gene tracing, model-organism mapping, and evolutionary-genomics queries.
npx skillsauth add mims-harvard/tooluniverse tooluniverse-comparative-genomicsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Cross-species gene comparison, ortholog identification, sequence retrieval, and functional conservation analysis integrating Ensembl Compara, NCBI, UniProt, OLS, Monarch, and OpenTargets.
When uncertain about any scientific fact, SEARCH databases first (PubMed, UniProt, ChEMBL, ClinVar, etc.) rather than reasoning from memory. A database-verified answer is always more reliable than a guess.
When analysis requires computation (statistics, data processing, scoring, enrichment), write and run Python code via Bash. Don't describe what you would do — execute it and report actual results. Use ToolUniverse tools to retrieve data, then Python (pandas, scipy, statsmodels, matplotlib) to analyze it.
Triggers:
Use Cases:
Understanding conservation requires distinguishing between types of evolutionary patterns and what they imply about function.
High conservation signals functional constraint. When a gene is maintained as a 1:1 ortholog from yeast to humans, purifying selection has prevented sequence divergence — the gene's function is essential and cannot be easily altered. Highly conserved positions within a protein sequence (high PhastCons scores > 0.8, or GERP RS > 4) are under strong constraint; mutations at these positions are disproportionately pathogenic. For non-coding regions, conservation in mammals at PhastCons > 0.5 suggests a candidate regulatory element.
Low conservation in one lineage has two possible explanations: relaxed selection or positive selection. Use the dN/dS ratio (nonsynonymous to synonymous substitution rate) to distinguish them. A dN/dS ratio near 1 suggests neutral evolution — the gene is no longer under purifying selection (relaxed constraint, possibly reflecting loss of function in that lineage). A dN/dS ratio > 1 indicates positive selection — the gene is diverging faster than neutral expectation, often because it is adapting to a new environment or function. A dN/dS ratio << 1 is the signature of purifying selection (functional constraint). When a vertebrate gene shows high divergence in a specific branch of the tree, ask which explanation applies before concluding that function is lost.
Computing dN/dS (no TU tool does this — use the bundled script). The data path: ensembl_get_homology(...) → the 1:1 ortholog IDs → EnsemblSeq_get_id_sequence(id=..., type="cds") for each → codon-align the two CDS (orthologous CDS are usually directly alignable; for divergent pairs align the protein and back-translate) → run scripts/dnds.py:
python scripts/dnds.py human_CDS.fasta mouse_CDS.fasta # or --seq1 ATG... --seq2 ATG...
It implements the Nei-Gojobori estimator with Jukes-Cantor correction (dN validated against Biopython NG86) and returns dN, dS, dN/dS, and an interpretation (>1 positive, ~1 neutral/relaxed, <<1 purifying). dN/dS is null when dS is 0 or uncorrectable (too few/too many substitutions) — do not over-interpret a single high-divergence pair without enough synonymous sites.
Ortholog relationship type shapes interpretation. A 1:1 ortholog (one gene in human, one in mouse) is the highest-confidence functional equivalent — it has not been duplicated in either lineage, so it most likely performs the same ancestral role. A 1:many relationship (one gene in human, multiple in mouse) means the target species has duplicated the gene; the copies may have subfunctionalized (each copy performs a subset of the original roles) or neofunctionalized (one copy gained a new role). Do not assume both copies retain full ancestral function. A many:many relationship reflects complex duplication history in both species and requires analyzing each paralog pair individually.
Conservation depth predicts essentiality. A gene conserved across all vertebrates suggests a fundamental cellular process. A gene conserved only in mammals suggests a more specialized vertebrate innovation. A gene present only in primates or only in humans is likely a recent evolutionary acquisition, possibly involved in human-specific biology but often lacking the depth of functional characterization available for deeply conserved genes.
Absence of an ortholog is a finding, not an error. Lineage-specific genes exist and are biologically meaningful. Before concluding a gene is lineage-specific, check: (1) whether BLAST with relaxed thresholds finds distant homologs, (2) whether a highly divergent ortholog exists that Ensembl Compara missed, and (3) whether the gene belongs to a rapidly evolving family (immune genes, olfactory receptors, reproductive proteins) where turnover is expected.
Input (gene symbol/ID + reference species)
|
v
Phase 1: Gene Identification & Validation
|
v
Phase 2: Ortholog Discovery (Ensembl Compara + OpenTargets)
|
v
Phase 3: Sequence Retrieval (NCBI + Ensembl)
|
v
Phase 4: Functional Annotation Comparison (UniProt + OLS GO terms)
|
v
Phase 5: Cross-Species Phenotype Bridging (Monarch)
|
v
Phase 6: Gene Tree & Evolutionary Context (Ensembl Compara)
|
v
Report: Conservation summary, ortholog evidence, functional comparison, phenotype bridging
ensembl_lookup_gene takes gene_id (symbol or Ensembl ID). The species parameter is REQUIRED when using gene symbols (e.g., species="homo_sapiens"); omitting it causes errors. Extract the Ensembl gene ID, description, biotype, and chromosomal coordinates for downstream queries. For non-human references, adjust species accordingly (e.g., "mus_musculus", "danio_rerio").
EnsemblCompara_get_orthologues is the primary tool. It takes gene (symbol or Ensembl ID), species (source species, default "human"), and optionally target_species (e.g., "mouse", "zebrafish") or target_taxon (NCBI taxon ID). Omit target_species to get all orthologs across the tree; filter client-side for specific species. It returns homology type (one2one, one2many, many2many) and the taxonomy divergence level for each ortholog.
ensembl_get_homology is the alternative when you need sequence-level data alongside the ortholog mapping. Use sequence="protein" and aligned=true for aligned sequence comparison across species.
OpenTargets_get_target_homologues_by_ensemblID (takes ensemblId) provides supplementary ortholog data from OpenTargets, which can add druggability context and cross-reference with model organism phenotype data.
Reasoning: Prioritize 1:1 orthologs as high-confidence functional equivalents. For 1:many cases, report all copies and flag the need for paralog-specific functional analysis. If no Ensembl Compara entry exists, try BLAST as a last resort (note: BLAST protein search against swissprot is slow, 5-30 minutes; against nr may take longer).
Key model organisms to check: mouse (taxon 10090), rat (10116), zebrafish (7955), fruit fly (7227), C. elegans (6239), S. cerevisiae (4932).
Use NCBI_search_nucleotide (takes organism as full name, e.g., "Homo sapiens"; gene; seq_type = "mRNA") to find sequence records, then NCBI_fetch_accessions to convert UIDs to accession numbers, then NCBI_get_sequence to retrieve FASTA data. Prefer RefSeq (NM_* for mRNA, NP_* for protein) over other accessions for canonical sequence.
When aligned sequences are needed directly, ensembl_get_homology with sequence="cdna" or sequence="protein" is faster than running BLAST. Use BLAST only when Ensembl Compara does not find orthologs.
UniProt_search takes a query in UniProt syntax (e.g., "gene:TP53 AND organism_id:9606 AND reviewed:true") and fields to retrieve specific annotation columns including GO terms. Use reviewed:true to restrict to Swiss-Prot curated entries.
UniProt_get_function_by_accession takes a UniProt accession and returns a list of function description strings (not a dict).
For each species being compared, retrieve GO terms and group them by Biological Process (BP), Molecular Function (MF), and Cellular Component (CC). Shared GO terms indicate conserved function; terms present in human but absent in the ortholog may reflect annotation bias (less-studied organisms have fewer GO annotations) rather than true functional divergence. Focus conservation claims on shared terms.
Reasoning about annotation gaps: If a mouse ortholog lacks a GO term present in the human protein, consider that this may reflect incomplete annotation of the mouse gene rather than functional divergence. The inverse — a GO term in mouse that is absent in human — is less common but can indicate diverged or acquired function.
Monarch_search_gene (takes query as gene symbol) returns gene CURIEs needed for Monarch queries. Monarch_get_gene_phenotypes and Monarch_get_gene_diseases take a gene CURIE (e.g., "HGNC:11998") and return phenotype/disease associations spanning multiple species.
Phenotype ontologies by species: Human = HP (HPO), Mouse = MP (Mammalian Phenotype), Zebrafish = ZP, Fly = FBcv. Monarch integrates across species; compare phenotype themes (e.g., "tumor susceptibility" in human and "increased tumor incidence" in mouse) rather than requiring exact term matches.
Reasoning for model organism selection: A mouse ortholog that has a 1:1 relationship AND shows phenotypes in Monarch that recapitulate the human disease is a strong disease model candidate. If the mouse phenotype diverges significantly from the human disease phenotype, this is worth flagging — it could indicate species-specific function or a limitation of the model.
EnsemblCompara_get_gene_tree (takes gene, species) returns the gene tree members, species distribution, and speciation vs. duplication events. EnsemblCompara_get_paralogues returns all paralogs in the source species.
From the gene tree, assess: (1) how many species contain a member of this gene family; (2) when gene duplication events occurred (ancient vs. recent); (3) whether the gene family expanded in particular lineages. A gene present in a single copy across all vertebrates (deep conservation, no duplication) is likely under strong selective constraint.
Genome-assembly context for a comparison species: When a species' ortholog calls look incomplete or you need the underlying reference assembly, use NCBIDatasets_list_genomes_by_taxon (params taxon as tax_id, limit, reference_only) to find the reference genome, NCBIDatasets_get_genome_assembly (param accession) for assembly metrics (contiguity/N50/completeness — a fragmented assembly can cause spurious "missing ortholog" calls), and NCBIDatasets_get_sequence_reports (param accession) for the chromosome/scaffold replicon map. For a full assembly-QC workflow on microbial genomes, see the tooluniverse-microbial-genome-characterization skill.
When interpreting the assembled evidence, work through these questions:
ensembl_get_homology, then OpenTargets_get_target_homologues_by_ensemblID, then BLAST as last resort. If a species is absent from Compara, confirm a reference assembly exists via NCBIDatasets_list_genomes_by_taxon and check its contiguity with NCBIDatasets_get_genome_assembly before concluding the gene is truly absentensembl_get_homology with sequence="cdna" as alternative to NCBIMonarchV3_get_associations with category="biolink:GeneToPhenotypicFeatureAssociation" as alternativetools
Post-market safety surveillance and recall/adverse-event RETRIEVAL across the full spectrum of FDA-regulated products that are NOT covered by the drug-AE signal skills: medical devices, food / dietary supplements / cosmetics, veterinary drugs, and drug supply (shortages). Orchestrates openFDA endpoints (MAUDE device adverse events + device recalls + 510(k), CAERS food/supplement/ cosmetic adverse events, veterinary adverse events, drug shortages, and cross-product enforcement/recall reports). USE WHEN the user asks: "are there adverse events for [device / pacemaker / infusion pump / insulin pump]", "device recalls for [firm/product]", "supplement / vitamin / cosmetic adverse reactions", "is [drug] in shortage", "what injectables are on shortage", "veterinary / animal adverse events for [drug] in [dog/cat/horse]", "food recall for listeria", "MAUDE report for [device]", "CAERS reactions for [brand]". DO NOT USE for drug adverse-event SIGNAL detection or disproportionality (PRR / ROR / IC) or drug-AE association scoring — that is `tooluniverse-pharmacovigilance` / `tooluniverse-adverse-event-detection`. This skill is multi-product surveillance and retrieval, not drug-AE statistical signal mining.
tools
--- name: tooluniverse-phewas description: Cross-ancestry / cross-biobank phenome-wide association (PheWAS) and replication. Given ONE variant (rsID) or ONE gene, look up every phenotype it associates with across European/UK (UKB-TOPMed), Finnish (FinnGen), Japanese (BioBank Japan), and Taiwanese (TPMI) biobanks, plus exome-wide gene-burden PheWAS (Genebass), then judge whether an association replicates across ancestries or is population-specific. Use whenever the user asks "what else is this va
tools
Dereplicate a putative natural product and assign its chemical taxonomy. Use to answer "is [compound] a known natural product", "what microbe/organism produces [compound]", "what chemical class is [compound]", "dereplicate this metabolite (by formula/exact mass/InChIKey/SMILES)", or "classify this molecule into ChemOnt". Searches NPAtlas for known microbial natural products (producing organism + literature reference), assigns the ChemOnt kingdom→superclass→class→subclass hierarchy via ClassyFire, resolves systematic IUPAC names to structure via OPSIN, and cross-references identity in PubChem. NOT for general drug/compound identity or ADMET (use tooluniverse-chemical-compound-retrieval / tooluniverse-small-molecule-discovery) and NOT for metabolomics pathway/enrichment analysis (use tooluniverse-metabolomics skills).
tools
Genome-ASSEMBLY discovery, QC, and replicon mapping for any organism (bacteria, archaea, fungi, and beyond) using NCBI Datasets. Resolves an organism name or taxid to assemblies, picks the reference/representative or best-quality assembly, pulls assembly QC metrics (total length, contig/scaffold N50, contig count, GC%, assembly level, RefSeq category), enumerates chromosomes and plasmids via per-replicon sequence reports, and compares candidate assemblies on quality. Use for "what genomes are available for [organism]", "assembly stats / N50 / GC content for [GCF_/GCA_ accession]", "how many plasmids does [strain] have", "compare assemblies for [species]", "find the reference genome for [taxon]", "is this assembly Complete Genome or just contigs". NOT for gene-level orthology/synteny (use tooluniverse-comparative-genomics), plant gene structure (use tooluniverse-plant-genomics), de novo assembly from raw reads (no tool exists), or taxonomy-only name/lineage lookups.