Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sort before dssp #649

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading