Query the KEGG KO HMMs in a single hmmsearch over a concatenated library#630
Merged
Conversation
…search Replace the per-KO hmmsearch loop in getKEGGModelForOrganism with a single hmmsearch of the whole query proteome against the concatenated kegg116_<domain> HMM library, downloaded as a gzip-compressed flatfile and gunzipped on demand. The profile library is the query and the proteome the target sequence database, so the reported per-hit E-values match RAVEN's historical per-KO hmmsearch (same search direction, same effective database size). The cut-off, minScoreRatioKO/minScoreRatioG filters and model assembly are therefore unchanged - thousands of hmmsearch invocations simply collapse into one, with no hmmpress/hmmscan and no new bundled binary (hmmsearch already ships). A legacy directory of per-KO HMMs is still honoured when already extracted, and per-organism phylogenetic-distance subsampling is skipped for the fixed prebuilt prok90/euk90 libraries.
Added timeout to function tests to prevent hanging.
Function test results0 tests 0 ✅ 0s ⏱️ Results for commit a86e78a. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getKEGGModelForOrganismpreviously ran onehmmsearchper KO (thousands ofinvocations) against a directory of individual KO HMM files unpacked from
prok90_kegg116.zip/euk90_kegg116.zip. This PR replaces that loop with asingle
hmmsearchof the whole query proteome against the concatenatedkegg116_<domain>HMM library, shipped as one gzip-compressed flatfile andgunzipped on demand.
The profile library is the query and the proteome is the target sequence
database — the same fast search direction as before — so the reported per-hit
full-sequence E-values are identical to the historical per-KO search (same
profiles, same target db, same effective db size). The cut-off, the
minScoreRatioKO/minScoreRatioGfilters and the downstream model assemblyare therefore unchanged; the thousands of
hmmsearchcalls simply collapseinto one.
Highlights:
hmmpress/hmmscanand no new bundled binary —hmmsearchalready ships with RAVEN.getPhylDist) is skipped for the prebuilt prok90/euk90 libraries, whose sequence set is already fixed — so the search path no longer needs a localkeggdb/taxonomy.<dataDir>/hmms/K00844.hmm), so existing setups keep working.What changed
reconstruction/kegg/getKEGGModelForOrganism.m:<dataDir>.hmm(theconcatenated library); gunzip
<dataDir>.hmm.gzif present, otherwisedownload
kegg116_<domain>.hmm.gz. Falls back to the legacy.zip/per-KOdirectory when that is what the user has.
hmmsearch --tbloutand parse the table directly intokoGeneMat(target col 1 = gene, query col 3 = KO, col 5 = full-sequence E-value),
reusing the existing scoring/assembly downstream.
Validation
checkcodeclean (no syntax errors; no new messages introduced).prok90_kegg116) searched against a 300-sequence proteome, the per-KOhmmsearchloop and the single-libraryhmmsearchproduce identical(gene, KO, E-value)hits (34 vs 34, zero differences).Follow-up (release management)
The download URL points at
…/releases/download/v2.11.0/kegg116_<domain>.hmm.gz. The two library assets(
kegg116_prokaryotes.hmm.gz,kegg116_eukaryotes.hmm.gz) need to be attachedto the release before the download path is live. They are the same artefacts
published for raven-python.