Пример #1
0
 def add_log(self):
     # Temporarily (for the duration of the 'with' block) set the
     # log level and context.
     # these are done by the IMP_OBJECT_LOG macro in C++
     with IMP.SetLogState(self.get_log_level()):
         with IMP.CreateLogContext(self.get_name() + "::add_log"):
             self.set_was_used(True)
             IMP.add_to_log(IMP.VERBOSE,
                            "A verbose message in the object\n")
Пример #2
0
 def create_from_pdb(file):
     sls = IMP.SetLogState(IMP.NONE)
     #datadir = '/home/elina/IMP/kernel/examples/CL/'
     #datadir = '/Users/apolitis/imp-projects/imp-work/'
     #datadir = '/u/cvr/apolitis/docs-imp/package-python/'
     #file =sys.argv[0]
     datadir = os.getcwd()
     print datadir
     t = IMP.atom.read_pdb(datadir + '/' + file, m,
                           IMP.atom.ATOMPDBSelector())
     del sls
     #IMP.atom.show_molecular_hierarchy(t)
     c = IMP.atom.Chain(IMP.atom.get_by_type(t, IMP.atom.CHAIN_TYPE)[0])
     if c.get_number_of_children() == 0:
         IMP.atom.show_molecular_hierarchy(t)
     # there is no reason to use all atoms, just approximate the pdb shape instead
     s = IMP.atom.create_simplified_along_backbone(
         c, resolution / 300.0)
     IMP.atom.destroy(t)
     # make the simplified structure rigid
     rb = IMP.atom.create_rigid_body(s)
     #            rb=IMP.atom.create_rigid_body(c)
     rb.set_coordinates_are_optimized(True)
     return s