From c7046ab5544f5ca427987d7309e569213511f7f6 Mon Sep 17 00:00:00 2001 From: Oliver Schwengers Date: Tue, 24 Sep 2024 16:58:57 +0200 Subject: [PATCH] adjust ranks of user-provided proteins and HMMs Increase the rank of user-provided proteins to 101, so that they have higher ranks than user-provided HMMs, which in turn are ranked 100, thus higher than all non-user-provided annotation sources. --- bakta/expert/protein_hmms.py | 2 +- bakta/expert/protein_sequences.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bakta/expert/protein_hmms.py b/bakta/expert/protein_hmms.py index 4211d398..aeaefd40 100644 --- a/bakta/expert/protein_hmms.py +++ b/bakta/expert/protein_hmms.py @@ -58,7 +58,7 @@ def search(cdss: Sequence[dict], user_hmms): hit = { 'type': 'user_hmms', 'source': 'UserHMMs', - 'rank': 99, + 'rank': 100, 'id': hmm_id, 'length': hit_domain_lengths_sum, 'aa_cov': aa_cov, diff --git a/bakta/expert/protein_sequences.py b/bakta/expert/protein_sequences.py index fee7fa2b..41e7a65f 100644 --- a/bakta/expert/protein_sequences.py +++ b/bakta/expert/protein_sequences.py @@ -117,7 +117,7 @@ def write_user_protein_sequences(aa_fasta_path: Path): with aa_fasta_path.open('w') as fh_out: for user_protein in user_proteins: (model_id, min_id, min_query_cov, min_model_cov, gene, product, dbxrefs, seq) = user_protein - fh_out.write(f">{model_id} UserProteins~~~{100}~~~{min_id}~~~{min_query_cov}~~~{min_model_cov}~~~{gene}~~~{product}~~~{','.join(dbxrefs)}\n{seq}\n") + fh_out.write(f">{model_id} UserProteins~~~{101}~~~{min_id}~~~{min_query_cov}~~~{min_model_cov}~~~{gene}~~~{product}~~~{','.join(dbxrefs)}\n{seq}\n") log.debug( 'imported user aa: id=%s, length=%i, min-id=%f, min-query-cov=%f, min-model-cov=%f, gene=%s, product=%s, dbxrefs=%s', model_id, len(seq), min_id, min_query_cov, min_model_cov, gene, product, dbxrefs