Skip to content
Snippets Groups Projects
Commit 011f7a63 authored by Gerardo Tauriello's avatar Gerardo Tauriello
Browse files

Cleaned up Processor doc and exports.

parent f779c422
No related branches found
No related tags found
No related merge requests found
...@@ -40,76 +40,112 @@ Processors ...@@ -40,76 +40,112 @@ Processors
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
The exact behaviour for a processor is implementation-specific. So far, two The exact behaviour for a processor is implementation-specific. So far, two
classes implement the processor interface: A heuristic and a rule-based processor. classes implement the processor interface: A heuristic and a rule-based
The processor mainly differ in the source of their connectivity information. The processor. The processor mainly differ in the source of their connectivity
Heuristicprocessor uses a hard-coded heuristic connectivity table for the 20 information. The Heuristicprocessor uses a hard-coded heuristic connectivity
standard amino acids as well as nucleotides.For other compounds such as ligands table for the 20 standard amino acids as well as nucleotides.For other
the HeuristicProcessor runs a distance-based connectivity algorithm that connects compounds such as ligands the HeuristicProcessor runs a distance-based
two atoms if they are closer than a certain threshold. The RuleBasedProcessor connectivity algorithm that connects two atoms if they are closer than a certain
uses a connectivity library containing all molecular components present in the threshold. The RuleBasedProcessor uses a connectivity library containing all
PDB files on PDB.org. The library can easily be extended with custom molecular components present in the PDB files on PDB.org. The library can easily
connectivity information, if required. If a :doc:`compound library <compoundlib>` is be extended with custom connectivity information, if required. If a
present, the :class:`RuleBasedProcessor` is enabled by default, otherwise the :doc:`compound library <compoundlib>` is present, the
:class:`RuleBasedProcessor` is enabled by default, otherwise the
:class:`HeuristicProcessor` is used as a fallback. :class:`HeuristicProcessor` is used as a fallback.
The Processor base class
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. class:: Processor .. class:: Processor
.. attribute:: connect .. attribute:: check_bond_feasibility
Whether to connect atoms by bonds. Enabled by default. This also sets the Whether an additional bond feasibility check is performed. Disabled by
:attr:`~ost.mol.ResidueHandle.is_protein` property of residues when peptide default. If turned on, atoms are only connected by bonds if they are within
bonds are created. Turn this off if you would like to speed up the loading a reasonable distance (as defined by :func:`IsBondFeasible`).
process and do not require connectivity information to be present in your
structures.
:type: :class:`bool` :type: :class:`bool`
.. attribute:: zero_occ_treatment .. attribute:: assign_torsions
Controls the behaviour of importing atoms with zero occupancy. By default, this Whether backbone torsions should be added to the backbone. Enabled by
is set to silent. default. If turned on, PHI, PSI and OMEGA torsions are assigned to the
peptide residues. See also :func:`AssignBackboneTorsions`.
:type: :class:`str` :type: :class:`bool`
.. attribute:: check_bond_feasibility .. attribute:: connect
Whether an additional bond feasibility check is performed. Disabled by default. Whether to connect atoms by bonds. Enabled by default. Turn this off if you
Turn this on, if you would like to connect atoms by bonds only if they are would like to speed up the loading process and do not require connectivity
within a reasonable distance. information to be present in your structures. Note though that
See also :func:`IsBondFeasible`. :attr:`peptide_bonds` may be ignored if this is turned off.
:type: :class:`bool` :type: :class:`bool`
.. attribute:: assign_torsions .. attribute:: peptide_bonds
Whether backbone torsions should be added to the backbone. Disabled by default. Whether to connect residues by peptide bonds. Enabled by default. This also
Set to true, to assign PHI, PSI and OMEGA torsions to the peptide residues. sets the :attr:`~ost.mol.ResidueHandle.is_protein` property of residues when
See also :func:`AssignBackboneTorsions`. peptide bonds are created. Turn this off if you would like to create your
own peptide bonds.
:type: :class:`bool` :type: :class:`bool`
.. attribute:: zero_occ_treatment
Controls the behaviour of importing atoms with zero occupancy. By default,
this is set to warn.
:type: :class:`ConopAction`
.. method:: Process(ent) .. method:: Process(ent)
Processess the entity *ent* according to the current options. Processess the entity *ent* according to the current options.
The RuleBasedProcessor class .. class:: HeuristicProcessor(check_bond_feasibility=False, \
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assign_torsions=True, connect=True, \
peptide_bonds=True, zero_occ_treatment=CONOP_WARN)
The :class:`HeuristicProcessor` implements the :class:`Processor` interface.
Refer to its documentation for methods and accessors common to all processor.
:param check_bond_feasibility: Sets :attr:`~Processor.check_bond_feasibility`
:param assign_torsions: Sets :attr:`~Processor.assign_torsions`
:param connect: Sets :attr:`~Processor.connect`
:param peptide_bonds: Sets :attr:`~Processor.peptide_bonds`
:param zero_occ_treatment: Sets :attr:`~Processor.zero_occ_treatment`
.. class:: RuleBasedProcessor(compound_lib, fix_elements=True, \
strict_hydrogens=False, \
unknown_res_treatment=CONOP_WARN, \
unknown_atom_treatment=CONOP_WARN, \
check_bond_feasibility=False, \
assign_torsions=True, connect=True, \
peptide_bonds=True, zero_occ_treatment=CONOP_WARN)
The :class:`RuleBasedProcessor` implements the :class:`Processor` interface.
Refer to its documentation for methods and accessors common to all processor.
:param compound_lib: The compound library to use
:type compound_lib: :class:`CompoundLib`
:param fix_elements: Sets :attr:`fix_elements`
:param strict_hydrogens: Sets :attr:`strict_hydrogens`
:param unknown_res_treatment: Sets :attr:`unk_atom_treatment`
:param unknown_atom_treatment: Sets :attr:`unk_res_treatment`
:param check_bond_feasibility: Sets :attr:`~Processor.check_bond_feasibility`
:param assign_torsions: Sets :attr:`~Processor.assign_torsions`
:param connect: Sets :attr:`~Processor.connect`
:param peptide_bonds: Sets :attr:`~Processor.peptide_bonds`
:param zero_occ_treatment: Sets :attr:`~Processor.zero_occ_treatment`
.. class:: RuleBasedProcessor(compound_lib) .. attribute:: fix_elements
:param compound_lib: The compound library Whether the element of the atom should be changed to the atom defined in the
:type compound_lib: :class:`CompoundLib` compound library. Enabled by default.
The :class:`RuleBasedProcessor` implements the :class:`Processor` interface. :type: :class:`bool`
Refer to its documentation for methods and accessors common to all processor.
.. attribute:: strict_hydrogens .. attribute:: strict_hydrogens
Whether to use strict hydrogen naming rules outlined in the compound library. Whether to use strict hydrogen naming rules outlined in the compound library.
...@@ -119,22 +155,21 @@ The RuleBasedProcessor class ...@@ -119,22 +155,21 @@ The RuleBasedProcessor class
.. attribute:: unk_atom_treatment .. attribute:: unk_atom_treatment
Treatment upon encountering an unknown atom. Default: 'warn'. Treatment upon encountering an unknown atom. Warn by default.
:type: :class:`str` :type: :class:`ConopAction`
.. attribute:: unk_res_treatment .. attribute:: unk_res_treatment
Treatment upon encountering an unknown residue Treatment upon encountering an unknown residue. Warn by default.
:type: :class:`str`
.. attribute:: fix_elements :type: :class:`ConopAction`
Whether the element of the atom should be changed to the atom defined in the
compound library. Enabled by default.
:type: :class:`bool` .. class:: ConopAction
Defines actions to take when certain events happen during processing. Possible
values:
``CONOP_WARN``, ``CONOP_SILENT``, ``CONOP_REMOVE``, ``CONOP_REMOVE_ATOM``,
``CONOP_REMOVE_RESIDUE``, ``CONOP_FATAL``
...@@ -80,10 +80,14 @@ void export_processor() { ...@@ -80,10 +80,14 @@ void export_processor() {
.add_property("check_bond_feasibility", .add_property("check_bond_feasibility",
&Processor::GetCheckBondFeasibility, &Processor::GetCheckBondFeasibility,
&Processor::SetCheckBondFeasibility) &Processor::SetCheckBondFeasibility)
.add_property("connect", &Processor::GetConnect,
&Processor::SetConnect)
.add_property("assign_torsions", &Processor::GetAssignTorsions, .add_property("assign_torsions", &Processor::GetAssignTorsions,
&Processor::SetAssignTorsions) &Processor::SetAssignTorsions)
.add_property("connect", &Processor::GetConnect,
&Processor::SetConnect)
.add_property("peptide_bonds", &Processor::GetConnectAminoAcids,
&Processor::SetConnectAminoAcids)
.add_property("zero_occ_treatment", &Processor::GetZeroOccTreatment,
&Processor::SetZeroOccTreatment)
.def("Process", &Processor::Process, .def("Process", &Processor::Process,
(arg("ent"), arg("log_diags")=true)) (arg("ent"), arg("log_diags")=true))
; ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment