From 94ba93d67496b95056d87dfb943ffc65350e3a3f Mon Sep 17 00:00:00 2001 From: Xavier Robin <xavier.robin@unibas.ch> Date: Tue, 30 May 2023 14:02:52 +0200 Subject: [PATCH] doc: SEQRES no longer needed. Following fixes in cd701347, setting seqres=True is no longer required for these things to work. --- actions/ost-compare-ligand-structures | 3 +-- modules/io/doc/mmcif.rst | 17 +++-------------- modules/mol/alg/pymod/ligand_scoring.py | 2 +- modules/mol/alg/tests/test_ligand_scoring.py | 2 +- modules/mol/base/doc/entity.rst | 5 ----- 5 files changed, 6 insertions(+), 23 deletions(-) diff --git a/actions/ost-compare-ligand-structures b/actions/ost-compare-ligand-structures index bfa6b5913..2af7694d8 100644 --- a/actions/ost-compare-ligand-structures +++ b/actions/ost-compare-ligand-structures @@ -250,8 +250,7 @@ def _LoadStructure(structure_path, format="auto", fault_tolerant=False): # Load the structure if format in ["mmcif", "cif"]: - entity, seqres = io.LoadMMCIF(structure_path, seqres=True, - fault_tolerant=fault_tolerant) + entity = io.LoadMMCIF(structure_path, fault_tolerant=fault_tolerant) if len(entity.residues) == 0: raise Exception(f"No residues found in file: {structure_path}") elif format == "pdb": diff --git a/modules/io/doc/mmcif.rst b/modules/io/doc/mmcif.rst index 203bb2961..20a816d2d 100644 --- a/modules/io/doc/mmcif.rst +++ b/modules/io/doc/mmcif.rst @@ -64,9 +64,8 @@ Notes: It is added as string property named "pdb_auth_chain_name" to the :class:`~ost.mol.ChainHandle`. The mapping is also stored in :class:`MMCifInfo` as :meth:`~MMCifInfo.GetMMCifPDBChainTr` and - :meth:`~MMCifInfo.GetPDBMMCifChainTr` if SEQRES records are read in - :func:`~ost.io.LoadMMCIF` and a non-empty SEQRES record exists for that chain - (this should exclude ligands and water). + :meth:`~MMCifInfo.GetPDBMMCifChainTr` if a non-empty SEQRES record exists for + that chain (this should exclude ligands and water). * Molecular entities in mmCIF are identified by an ``entity.id``, which is extracted from ``atom_site.label_entity_id`` for the first atom of the chain. It is added as string property named "entity_id" to the @@ -99,12 +98,6 @@ Information from mmCIF files that goes beyond structural data, is kept in a special container, the :class:`MMCifInfo` class. Here is a detailed description of the annotation available. -.. note:: - - Some fields of the ``MMCifInfo`` container are only populated if SEQRES - records are read in :func:`~ost.io.LoadMMCIF` and a compound library is - available (see :func:`~ost.conop.GetDefaultLib`) - .. class:: MMCifInfo This is the container for all bits of non-molecular data pulled from a mmCIF @@ -278,9 +271,7 @@ of the annotation available. .. method:: GetMMCifPDBChainTr(cif_chain_id) Get the translation of a certain mmCIF chain name to the traditional PDB - chain name. Only works if SEQRES records are read in - :func:`~ost.io.LoadMMCIF` and a compound library is available (see - :func:`~ost.conop.GetDefaultLib`). + chain name. :param cif_chain_id: atom_site.label_asym_id :type cif_chain_id: :class:`str` @@ -298,8 +289,6 @@ of the annotation available. .. method:: GetPDBMMCifChainTr(pdb_chain_id) Get the translation of a certain PDB chain name to the mmCIF chain name. - Only works if SEQRES records are read in :func:`~ost.io.LoadMMCIF` and a - compound library is available (see :func:`~ost.conop.GetDefaultLib`). :param pdb_chain_id: atom_site.auth_asym_id :type pdb_chain_id: :class:`str` diff --git a/modules/mol/alg/pymod/ligand_scoring.py b/modules/mol/alg/pymod/ligand_scoring.py index 00d2365db..bd305432f 100644 --- a/modules/mol/alg/pymod/ligand_scoring.py +++ b/modules/mol/alg/pymod/ligand_scoring.py @@ -111,7 +111,7 @@ class LigandScorer: # Ligand model as SDF file model_ligand = io.LoadEntity("path_to_ligand.sdf", format="sdf") # Target loaded from mmCIF, containing the ligand - target, _ = io.LoadMMCIF("path_to_target.cif", seqres=True) + target = io.LoadMMCIF("path_to_target.cif") # Cleanup a copy of the structures cleaned_model = model.Copy() diff --git a/modules/mol/alg/tests/test_ligand_scoring.py b/modules/mol/alg/tests/test_ligand_scoring.py index 61f70d8b4..3adeaf5f9 100644 --- a/modules/mol/alg/tests/test_ligand_scoring.py +++ b/modules/mol/alg/tests/test_ligand_scoring.py @@ -22,7 +22,7 @@ def _GetTestfilePath(filename): @lru_cache(maxsize=None) def _LoadMMCIF(filename): path = _GetTestfilePath(filename) - ent, seqres = io.LoadMMCIF(path, seqres=True) + ent = io.LoadMMCIF(path) return ent diff --git a/modules/mol/base/doc/entity.rst b/modules/mol/base/doc/entity.rst index 657125a2f..795c9b7c2 100644 --- a/modules/mol/base/doc/entity.rst +++ b/modules/mol/base/doc/entity.rst @@ -741,11 +741,6 @@ The Handle Classes .. attribute:: is_ligand - .. warning:: - This property is meaningless on mmCIF files loaded with - :func:`ost.io.LoadMMCIF` with `seqres=False` (the default), or if no - default compound library is set. - Whether the residue is a ligand. When loading PDB structures, this property is set based on the HET records. This also means, that this property will most likely not be set properly for all except PDB files coming from -- GitLab