%pythoncode %{
import _representation
import _restraint
import _xml_parser
import _display
import _optimization
import _main
class Representation(_representation.Representation):
"""Store Representation."""
def __init__(self):
_representation.Representation.__init__(self)
def get_imp_hierarchy_by_id(self, id):
"""Return an IMP::atom::Hierarchy by particle id.
@param id Particle id.
@return An IMP::atom::Hierarchy hierarchy."""
return _representation.Representation.get_imp_hierarchy_by_id(self,id)
def get_root_imp_hierarchy(self):
"""Return the root of the IMP::atom::Hierarchy"""
return _representation.Representation.get_root_imp_hierarchy(self)
def find_all_by_id(self, id): # assuming there are many obj with the same id
"""Return a list of all nodes that have the id given by the parameter"""
return _representation.Representation.gind_all_by_id(self, id)
def find_by_id(self, id): # assuming there is just one obj with the same id
"""Return a node that have the id given by the parameter"""
return _representation.Representation.find_by_id(self,id)
def to_model(self, model=None):
"""Return an IMP::Model that contains the representation"""
return _representation.Representation.to_model(self, model)
class Restraint(_restraint.Restraint):
"""Store Restraint"""
def __init__(self):
""""""
_restraint.Restraint.__init__(self)
def add_to_representation(self, repr):
""" Place restraint into IMP Model."""
return _restraint.Restraint.add_to_representation(self, repr)
def print_all_restraints(self):
"""Print restraint name, initial weight, and score for the current state of the model"""
return _restraint.Restraint.print_all_restraints(self)
def get_all_restraints_by_name(self, name):
"""Assuming there are many restraint objects with the same name.
@param[in] name The name to search for"""
return _restraint.Restraint.get_all_restraints_by_name(self,name)
def get_restraint_by_name(self, name):
"""Assuming there is just one restraint object with the same name."""
return restraint.Restraint.get_restraint_by_name(self,name)
def get_rigid_body_by_id(self, id):
"""Get rigid body by particle id."""
return _restraint.Restraint.get_rigid_body_by_id(self,id)
def get_all_rigid_bodies(self):
"""Get all rigid bodies."""
return _restraint.Restraint.get_all_rigid_bodies(self)
class XMLRepresentation(_xml_parser.XMLRepresentation):
"""Construct Representation from XML file"""
def __init__(self, filename):
_xml_parser.XMLRepresentation.__init__(self, filename)
def run(self):
"""Return IMP.restrainer.Representation
object such that each node in the representation
corresponds to the node in the XML nodes"""
return _xml_parser.XMLRepresentation.run(self)
class XMLDisplay(_xml_parser.XMLDisplay):
"""Construct Display from XML file"""
def __init__(self, filename):
_xml_parser.XMLDisplay.__init__(self, filename)
def run(self):
"""Return display object such that each node in the display
corresponds to the node in the XML nodes"""
return _xml_parser.XMLDisplay.run(self)
class XMLRestraint(_xml_parser.XMLRestraint):
"""Construct Restraint from XML file"""
def __init__(self, filename):
""" @param[in] filename the name of the file to read """
_xml_parser.XMLRestraint.__init__(self, filename)
def run(self):
"""Return
Restraint
object such that each node in the restraint
corresponds to the node in the XML nodes"""
return _xml_parser.XMLRestraint.run(self)
class XMLOptimization(_xml_parser.XMLOptimization):
def __init__(self, filename):
_xml_parser.XMLOptimization.__init__(self, filename)
def run(self):
return _xml_parser.XMLOptimization.run(self)
class Display(_display.Display):
"""A class to display the configuration"""
def __init__(self):
_display.Display.__init__(self)
def create_log(self, repr, log_name):
"""Create Chimera log.
@param repr
Representation object.
@param log_name Log name
@return IMP::dispay::WriteOptimizerState"""
return _display.Display.create_log(self, repr, log_name)
class Main(_main.Main):
def __init__(self):
_main.Main.__init__(self)
def add_representation(self, fname):
return _main.Main.add_representation(self, fname)
def add_restraint(self, fname):
return _main.Main.add_restraint(self, fname)
def add_optimization(self, fname):
return _main.Main.add_optimization(self, fname)
def add_display(self, fname, logname=None):
return _main.Main.add_display(self, fname, logname)
def optimize(self):
_main.Main.optimize(self)
def model(self):
return _main.Main.model(self)
%}