Skip to content

Commit

Permalink
fix models() crash when no structures found
Browse files Browse the repository at this point in the history
  • Loading branch information
thomashopf committed Mar 2, 2025
1 parent 75bfc96 commit 8f221e4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions evcouplings/compare/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,16 @@ def _map_alphafold_hits(modeldb_list_file, relevant_ids):
"uniprot_end": end,
})

return pd.DataFrame(_table)

if len(_table) > 0:
return pd.DataFrame(_table)
else:
# reindex so empty dataframe has all columns; use fill_value = "" to force column types to object
return pd.DataFrame().reindex([
"uniprot_ac", "pdb_id", "pdb_chain",
"resseq_start", "resseq_end",
"coord_start", "coord_end",
"uniprot_start", "uniprot_end"
], axis=1, fill_value="")

def _identify_predicted_structures(**kwargs):
"""
Expand Down

0 comments on commit 8f221e4

Please sign in to comment.