Skip to content
Snippets Groups Projects
Commit 77f56583 authored by Studer Gabriel's avatar Studer Gabriel
Browse files

lDDT: hide deprecated C++ lDDTScorer class

Avoids collision with new pythonic lDDTScorer class
parent 96b6c97f
Branches
Tags
No related merge requests found
......@@ -444,104 +444,104 @@ lDDT (deprecated)
:type cutoffs_length: int
.. class:: lDDTScorer(reference, model, settings)
Object to compute lDDT scores using :func:`LocalDistDiffTest` as in
`Mariani et al. <https://dx.doi.org/10.1093/bioinformatics/btt473>`_.
Example usage.
.. code:: python
#! /bin/env python
"""Run lDDT from within script."""
from ost.io import LoadPDB
from ost.mol.alg import (CleanlDDTReferences,
lDDTSettings, lDDTScorer)
ent_full = LoadPDB('3ia3', remote=True)
model_view = ent_full.Select('cname=A')
references = [ent_full.Select('cname=C')]
#
# Initialize settings with default parameters and print them
settings = lDDTSettings()
settings.PrintParameters()
# Clean up references
CleanlDDTReferences(references)
#
# Calculate lDDT
scorer = lDDTScorer(references=references, model=model_view, settings=settings)
print("Global score:", scorer.global_score)
scorer.PrintPerResidueStats()
:param references: Sets :attr:`references`
:param model: Sets :attr:`model`
:param settings: Sets :attr:`settings`
.. attribute:: references
A list of reference structures.
:type: list(:class:`~ost.mol.EntityView`)
.. attribute:: model
A model structure.
:type: :class:`~ost.mol.EntityView`
.. attribute:: settings
Settings used to calculate lDDT.
:type: :class:`~ost.mol.alg.lDDTSettings`
.. attribute:: global_dist_list
Global map of residue properties.
:type: :class:`~ost.mol.alg.GlobalRDMap`
.. attribute:: global_score
Global lDDT score. It is calculated as :attr:`conserved_contacts` divided
by :attr:`total_contacts`.
:type: float
.. attribute:: conserved_contacts
Number of conserved distances.
:type: int
.. attribute:: total_contacts
Number of total distances.
:type:
.. attribute:: local_scores
Local scores. For each of the residue lDDT is it is calculated as residue
conserved contacts divided by residue total contacts.
:type: list(:class:`~ost.mol.alg.lDDTLocalScore`)
.. attribute:: is_valid
Is the calculated score valid?
:type: bool
.. method:: PrintPerResidueStats
Print per-residue statistics.
.. The deprecated lDDTScorer is commented out to not collide with the new
.. and shiny lDDTScorer class
..
.. .. class:: lDDTScorer(reference, model, settings)
..
.. Object to compute lDDT scores using :func:`LocalDistDiffTest` as in
.. `Mariani et al. <https://dx.doi.org/10.1093/bioinformatics/btt473>`_.
..
.. Example usage.
..
.. .. code:: python
..
.. #! /bin/env python
.. """Run lDDT from within script."""
.. from ost.io import LoadPDB
.. from ost.mol.alg import (CleanlDDTReferences,
.. lDDTSettings, lDDTScorer)
..
.. ent_full = LoadPDB('3ia3', remote=True)
.. model_view = ent_full.Select('cname=A')
.. references = [ent_full.Select('cname=C')]
..
.. #
.. # Initialize settings with default parameters and print them
.. settings = lDDTSettings()
.. settings.PrintParameters()
..
.. # Clean up references
.. CleanlDDTReferences(references)
.. #
.. # Calculate lDDT
.. scorer = lDDTScorer(references=references, model=model_view, settings=settings)
.. print("Global score:", scorer.global_score)
.. scorer.PrintPerResidueStats()
..
.. :param references: Sets :attr:`references`
.. :param model: Sets :attr:`model`
.. :param settings: Sets :attr:`settings`
..
.. .. attribute:: references
..
.. A list of reference structures.
..
.. :type: list(:class:`~ost.mol.EntityView`)
..
.. .. attribute:: model
..
.. A model structure.
..
.. :type: :class:`~ost.mol.EntityView`
..
.. .. attribute:: settings
..
.. Settings used to calculate lDDT.
..
.. :type: :class:`~ost.mol.alg.lDDTSettings`
..
.. .. attribute:: global_dist_list
..
.. Global map of residue properties.
..
.. :type: :class:`~ost.mol.alg.GlobalRDMap`
..
.. .. attribute:: global_score
..
.. Global lDDT score. It is calculated as :attr:`conserved_contacts` divided
.. by :attr:`total_contacts`.
..
.. :type: float
..
.. .. attribute:: conserved_contacts
..
.. Number of conserved distances.
..
.. :type: int
..
.. .. attribute:: total_contacts
..
.. Number of total distances.
..
.. :type:
..
.. .. attribute:: local_scores
..
.. Local scores. For each of the residue lDDT is it is calculated as residue
.. conserved contacts divided by residue total contacts.
..
.. :type: list(:class:`~ost.mol.alg.lDDTLocalScore`)
..
.. .. attribute:: is_valid
..
.. Is the calculated score valid?
..
.. :type: bool
..
.. .. method:: PrintPerResidueStats
..
.. Print per-residue statistics.
.. class:: UniqueAtomIdentifier(chain, residue_number, residue_name, atom_name)
......
......@@ -172,6 +172,9 @@ object lDDTSettingsInitWrapper(tuple args, dict kwargs){
label);
}
/*
lDDTScorer is commented out to not collide with the new lDDTScorer class
that lives in Python
object lDDTScorerInitWrapper(tuple args, dict kwargs){
object self = args[0];
......@@ -217,7 +220,7 @@ object lDDTScorerInitWrapper(tuple args, dict kwargs){
model,
settings);
}
*/
void clean_lddt_references_wrapper(const list& reference_list)
{
......@@ -265,6 +268,10 @@ list get_lddt_per_residue_stats_wrapper(mol::EntityView& model,
return local_scores_list;
}
/*
lDDTScorer is commented out to not collide with the new lDDTScorer class
that lives in Python
list get_local_scores_wrapper(mol::alg::lDDTScorer& scorer) {
std::vector<mol::alg::lDDTLocalScore> scores = scorer.GetLocalScores();
list local_scores_list;
......@@ -282,7 +289,7 @@ list get_references_wrapper(mol::alg::lDDTScorer& scorer) {
}
return local_references_list;
}
*/
void print_lddt_per_residue_stats_wrapper(list& scores, bool structural_checks, int cutoffs_size){
int scores_length = boost::python::extract<int>(scores.attr("__len__")());
......@@ -395,6 +402,9 @@ BOOST_PYTHON_MODULE(_ost_mol_alg)
.def_readwrite("conserved_dist", &mol::alg::lDDTLocalScore::conserved_dist)
.def_readwrite("total_dist", &mol::alg::lDDTLocalScore::total_dist);
/*
lDDTScorer is commented out to not collide with the new lDDTScorer class
that lives in Python
class_<mol::alg::lDDTScorer>("lDDTScorer", no_init)
.def("__init__", raw_function(lDDTScorerInitWrapper))
.def(init<std::vector<mol::EntityView>&, mol::EntityView&, mol::alg::lDDTSettings&>())
......@@ -406,6 +416,7 @@ BOOST_PYTHON_MODULE(_ost_mol_alg)
.def_readonly("model", &mol::alg::lDDTScorer::model_view)
.add_property("references", &get_references_wrapper)
.add_property("is_valid", &mol::alg::lDDTScorer::IsValid);
*/
class_<mol::alg::StereoChemicalProps>("StereoChemicalProps",
init<mol::alg::StereoChemicalParams&,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment