-
Notifications
You must be signed in to change notification settings - Fork 0
extending_the_library
- Place
.hmmfiles inhmm_library/<category>/ - Add
<stem><TAB><bitscore>tohmm_library/HMM-bitcutoffs.txt(use0for zero-cutoff fallback) - Add
<stem><TAB><gene_name>tohmm_library/FeGenie-map.txt - Add a row to
hmm_library/hmm_registry.tsv-
stemmust exactly match the HMM filename without.hmm -
status=active
-
- Optionally add or update a rule in
operon_rules.json - Run
python scripts/curate_hmm_library.py --verify hmm_library/to check consistency
Registry rule:
stemmust exactly match the HMMNAMEfield AND the filename without.hmm. Mismatches silently break cutoff and gene-name lookup.
Models built with HMMER < 3.1 must be converted to HMMER3/f format:
efesto --normalize_hmms --faa_dir orfs/ --hmm_dir hmm_library/ --out results/Or manually:
python scripts/normalize_hmm_versions.py hmm_library/Safe to run repeatedly (already-current files are skipped).
python scripts/curate_hmm_library.py \
--fegenie_dir /path/to/FeGenie/hmms/iron/ \
--flat_dir /path/to/new_iron_hmms iron_acquisition tabuteau \
--methmmdb_json /path/to/MetHMMDB/metadata.json \
--methmmdb_dir /path/to/MetHMMDB/ \
--out_dir hmm_library/ \
--log curation_report.tsv
# Verify after rebuild
python scripts/curate_hmm_library.py --verify hmm_library/--annotate restricts the run to a subset of functional categories without
modifying the library itself:
# Annotate only iron metabolism
efesto --annotate Fe-metabolism --faa_dir orfs/ --hmm_dir hmm_library/ --out results/
# Multiple tokens
efesto --annotate Fe-metabolism Cu Zn --faa_dir orfs/ --hmm_dir hmm_library/ --out results/
# All categories (default)
efesto --annotate all --faa_dir orfs/ --hmm_dir hmm_library/ --out results/Accepted tokens: element-level (Fe, Cu, Zn, Mn, Ni, Co, Mo, As, Hg,
Cd, Cr, Ag, Te, Mg, multimetal) or process-level
(Fe-metabolism, Fe-resistance, Fe-acquisition), or all.
To run sequence-level deduplication after adding new models:
python scripts/layer_b_dedup_all.py \
--hmm_dir hmm_library/ \
--registry hmm_library/hmm_registry.tsv \
--out hmm_library/_dedup_work/This runs MMseqs2 easy-cluster at 70% identity / 80% coverage on hmmemit
consensus sequences across all active models. Review the cluster TSV before
deprecating — low-nseq consensus sequences are degenerate and can cluster
spuriously (see Library curation log for details).
When an existing broad model cross-hits multiple subfamilies (as FeGenie MtrA/MtoA did), build subfamily HMMs from curated seeds:
# Build HMMs from seed alignment file
python scripts/build_mtr_mto_subfamily_hmms.py \
--seeds data/seeds/mtr_mto_seeds.tsv \
--out hmm_library/
# Calibrate against a representative universe
python scripts/calibrate_mtr_mto_cutoffs.py \
--hmm_dir hmm_library/ \
--universe hmm_library/_calibration/mtr_mto/calibration_universe.faa \
--out hmm_library/_calibration/mtr_mto/Calibration reports are stored in hmm_library/_calibration/<name>/:
-
calibration_report.tsv— per-sequence scores -
calibration_summary.txt— TC/GA/NC derivation
See Library curation log — MtrA/MtoA for the full calibration rationale.
- Create
hmm_library/<new_category>/and place HMMs there - Add models to registry, bitcutoffs, and gene map (as above)
- Decide whether the category should bypass rules:
- Single-gene hits informative (e.g.
iron_stress,iron_sulfur_assembly) → add toreport_all_categoriesinoperon_rules.json - Co-occurrence required (e.g. new transport system) → add a new rule object
- Single-gene hits informative (e.g.
- If co-occurrence is required, define
canonical_sizefor confidence scoring - Run
pytest tests/— add a test if the new category has custom logic
Getting started
HMM library
Pipeline logic
Outputs and integration
Development