Skip to content

Commit 0933424

Browse files
fix: A_rank from info sheet for hmm parse now parse properly
1 parent 64da24e commit 0933424

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

bin/hmm_parser.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def main(hmm_domtbl, hmm_info_path, ec_from_info, gene_locs, db_name, output):
123123
print(f"Error reading HMM info file: {e}\n{e2}")
124124
hmm_sheet = False
125125
if hmm_sheet and not hmm_info.empty:
126-
merge_cols = ['score_type', 'threshold', f"{db_name}_EC", "description"]
126+
merge_cols = ['score_type', 'threshold', f"{db_name}_EC", "description", "A_rank", "B_rank"]
127127
raise_on_ec = False
128128
if "description" in hmm_info.columns:
129129
pass
@@ -143,7 +143,8 @@ def main(hmm_domtbl, hmm_info_path, ec_from_info, gene_locs, db_name, output):
143143

144144
hits = hits.merge(hmm_info[merge_cols], how='left', left_on="query_name", right_index=True)
145145
hits_sig = sig_scores_row_by_row(hits, db_name=db_name)
146-
hits_sig = hits_sig.drop(columns=['score_type', 'threshold'])
146+
drop_cols = [col for col in merge_cols if col in hits_sig.columns and col not in [f"{db_name}_EC", "description",]]
147+
hits_sig = hits_sig.drop(columns=drop_cols)
147148
else:
148149
hits_sig = hits[hits["perc_cov"] >= 0.35]
149150

0 commit comments

Comments
 (0)