Skip to content

Commit

Permalink
fix: empty results against PDB
Browse files Browse the repository at this point in the history
  • Loading branch information
valentynbez committed Jun 5, 2024
1 parent a8ec4b3 commit 09e3c75
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
11 changes: 8 additions & 3 deletions mDeepFRI/mmseqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,14 @@ def from_best_matches(cls, filepath: str):
delimiter="\t",
encoding="utf-8",
names=True)

query_file = np.unique(result_arr["query_file"])[0]
database = np.unique(result_arr["database_file"])[0]
try:
query_file = np.unique(result_arr["query_file"])[0]
except IndexError:
query_file = None
try:
database = np.unique(result_arr["database_file"])[0]
except IndexError:
database = None

return cls(result_arr, query_file, database)

Expand Down
9 changes: 7 additions & 2 deletions mDeepFRI/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,13 @@ def hierarchical_database_search(query_file: str,
# store the location of the result for the next step
db.mmseqs_result = mmseqs_results_path

# logging
unique_hits = np.unique(best_matches["query"])
# catch error if no matches to database
# a case from phage proteins
try:
unique_hits = np.unique(best_matches["query"])
except IndexError:
unique_hits = np.array([])

if "pdb100" in db.name:
pdb_hits = unique_hits
else:
Expand Down

0 comments on commit 09e3c75

Please sign in to comment.