Skip to content

Commit

Permalink
[nomenclature.GPCRLabeler.aligntop] sort the problematic set of resid…
Browse files Browse the repository at this point in the history
…ues, mention method's name in the Exception
  • Loading branch information
gph82 committed Nov 20, 2024
1 parent 247cb4e commit ce3fbc1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mdciao/nomenclature/nomenclature.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,8 @@ def aligntop(self, top,
confragidxs]
if not set(self.fragments[confraglab]).issuperset(confragAAs):
confrags_compatible_with_frags = False
only_in_top = set(confragAAs).difference(self.fragments[confraglab])
only_in_top = list(set(confragAAs).difference(self.fragments[confraglab]))
only_in_top = [only_in_top[idx] for idx in _np.argsort([_mdcu.residue_and_atom.int_from_AA_code(key) for key in only_in_top])]
current_clashing_confrag = f"=> {confraglab} is not compatible with alignment '{ii}'. "
current_clashing_residues = f"The following residues of your input `top` seem to be the problem: {only_in_top}. "
istr = current_clashing_confrag+current_clashing_residues
Expand All @@ -818,7 +819,7 @@ def aligntop(self, top,
elif ii==len(df)-1:
istr += f"This was the last available alignment."
if not verbose:
istr += f" Re-rerun with `verbose=True` to show the problematic part of this alignment here."
istr += f" Re-rerun 'mdciao.nomenclature.{type(self).__name__}.aligntop' with `verbose=True` to show the problematic part of this alignment here."

_mdcu.str_and_dict.print_wrap(istr)
break
Expand Down

0 comments on commit ce3fbc1

Please sign in to comment.