Skip to content

Commit

Permalink
Merge pull request #649 from marrink-lab/fix_648
Browse files Browse the repository at this point in the history
sort before dssp
  • Loading branch information
pckroon authored Jan 30, 2025
2 parents cb761ba + 527d5e1 commit f86d35d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion vermouth/dssp/dssp.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from ..pdb import pdb
from ..system import System
from ..processors.processor import Processor
from ..processors import SortMoleculeAtoms
from ..selectors import is_protein, selector_has_position, filter_minimal, select_all
from .. import utils
from ..log_helpers import StyleAdapter, get_logger
Expand Down Expand Up @@ -176,10 +177,14 @@ def run_mdtraj(system):
The secondary structure sequences of all the molecules are combined
in a single list without delimitation.
"""
sys_copy = system.copy()
# precaution for large systems; mdtraj requires all residues to be
# grouped together otherwise dssp fails
SortMoleculeAtoms(target_attr='atomid').run_system(sys_copy)
tmpfile_handle, tmpfile_name = tempfile.mkstemp(suffix='.pdb', text=True,
dir='.', prefix='dssp_in_')
tmpfile_handle = os.fdopen(tmpfile_handle, mode='w')
tmpfile_handle.write(pdb.write_pdb_string(system, conect=False))
tmpfile_handle.write(pdb.write_pdb_string(sys_copy, conect=False))
tmpfile_handle.close()

try:
Expand Down

0 comments on commit f86d35d

Please sign in to comment.