Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
011f7a63
Commit
011f7a63
authored
7 years ago
by
Gerardo Tauriello
Browse files
Options
Downloads
Patches
Plain Diff
Cleaned up Processor doc and exports.
parent
f779c422
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/conop/doc/connectivity.rst
+86
-51
86 additions, 51 deletions
modules/conop/doc/connectivity.rst
modules/conop/pymod/export_processor.cc
+7
-3
7 additions, 3 deletions
modules/conop/pymod/export_processor.cc
with
93 additions
and
54 deletions
modules/conop/doc/connectivity.rst
+
86
−
51
View file @
011f7a63
...
...
@@ -40,76 +40,112 @@ Processors
--------------------------------------------------------------------------------
The exact behaviour for a processor is implementation-specific. So far, two
classes implement the processor interface: A heuristic and a rule-based processor.
The processor mainly differ in the source of their connectivity information. The
Heuristicprocessor uses a hard-coded heuristic connectivity table for the 20
standard amino acids as well as nucleotides.For other compounds such as ligands
the HeuristicProcessor runs a distance-based connectivity algorithm that connects
two atoms if they are closer than a certain threshold. The RuleBasedProcessor
uses a connectivity library containing all molecular components present in the
PDB files on PDB.org. The library can easily be extended with custom
connectivity information, if required. If a :doc:`compound library <compoundlib>` is
present, the :class:`RuleBasedProcessor` is enabled by default, otherwise the
classes implement the processor interface: A heuristic and a rule-based
processor. The processor mainly differ in the source of their connectivity
information. The Heuristicprocessor uses a hard-coded heuristic connectivity
table for the 20 standard amino acids as well as nucleotides.For other
compounds such as ligands the HeuristicProcessor runs a distance-based
connectivity algorithm that connects two atoms if they are closer than a certain
threshold. The RuleBasedProcessor uses a connectivity library containing all
molecular components present in the PDB files on PDB.org. The library can easily
be extended with custom connectivity information, if required. If a
:doc:`compound library <compoundlib>` is present, the
:class:`RuleBasedProcessor` is enabled by default, otherwise the
:class:`HeuristicProcessor` is used as a fallback.
The Processor base class
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. class:: Processor
.. attribute:: c
onnect
.. attribute:: c
heck_bond_feasibility
Whether to connect atoms by bonds. Enabled by default. This also sets the
:attr:`~ost.mol.ResidueHandle.is_protein` property of residues when peptide
bonds are created. Turn this off if you would like to speed up the loading
process and do not require connectivity information to be present in your
structures.
Whether an additional bond feasibility check is performed. Disabled by
default. If turned on, atoms are only connected by bonds if they are within
a reasonable distance (as defined by :func:`IsBondFeasible`).
:type: :class:`bool`
.. attribute::
zero_occ_treatment
.. attribute::
assign_torsions
Controls the behaviour of importing atoms with zero occupancy. By default, this
is set to silent.
Whether backbone torsions should be added to the backbone. Enabled by
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:: c
heck_bond_feasibility
.. attribute:: c
onnect
Whether
an additional bond feasibility check is performed. Disabled by default.
Turn this on, if you would like to connect atoms by bonds only if they are
within a reasonable distance.
See also :func:`IsBondFeasible`
.
Whether
to connect atoms by bonds. Enabled by default. Turn this off if you
would like to speed up the loading process and do not require connectivity
information to be present in your structures. Note though that
:attr:`peptide_bonds` may be ignored if this is turned off
.
:type: :class:`bool`
.. attribute::
assign_torsi
ons
.. attribute::
peptide_b
on
d
s
Whether backbone torsions should be added to the backbone. Disabled by default.
Set to true, to assign PHI, PSI and OMEGA torsions to the peptide residues.
See also :func:`AssignBackboneTorsions`.
Whether to connect residues by peptide bonds. Enabled by default. This also
sets the :attr:`~ost.mol.ResidueHandle.is_protein` property of residues when
peptide bonds are created. Turn this off if you would like to create your
own peptide bonds.
: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)
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
:type compound_lib: :class:`CompoundLib`
The :class:`RuleBasedProcessor` implements the :class:`Processor` interface.
Refer to its documentation for methods and accessors common to all processor.
Whether the element of the atom should be changed to the atom defined in the
compound library. Enabled by default.
:type: :class:`bool`
.. attribute:: strict_hydrogens
Whether to use strict hydrogen naming rules outlined in the compound library.
...
...
@@ -119,22 +155,21 @@ The RuleBasedProcessor class
.. 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
Treatment upon encountering an unknown residue
:type: :class:`str`
Treatment upon encountering an unknown residue. Warn by default.
.. 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``
This diff is collapsed.
Click to expand it.
modules/conop/pymod/export_processor.cc
+
7
−
3
View file @
011f7a63
...
...
@@ -80,10 +80,14 @@ void export_processor() {
.
add_property
(
"check_bond_feasibility"
,
&
Processor
::
GetCheckBondFeasibility
,
&
Processor
::
SetCheckBondFeasibility
)
.
add_property
(
"connect"
,
&
Processor
::
GetConnect
,
&
Processor
::
SetConnect
)
.
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
,
(
arg
(
"ent"
),
arg
(
"log_diags"
)
=
true
))
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment