Beispiel #1
0
 def find_base_pairs(self, log=sys.stdout, use_segid=False, segids=None):
     if not use_segid:
         base_pairs = ""
         stacking_pairs = ""
         if self.pdb_hierarchy.contains_nucleic_acid():
             stacking_pairs = nucleic_acids.get_phil_stacking_pairs(
                 pdb_hierarchy=self.pdb_hierarchy,
                 prefix="secondary_structure.nucleic_acid",
                 params=self.params.secondary_structure.nucleic_acid,
                 log=log)
             if self.grm is not None:
                 base_pairs = nucleic_acids.get_phil_base_pairs(
                   pdb_hierarchy=self.pdb_hierarchy,
                   nonbonded_proxies=self.grm.pair_proxies(
                       sites_cart=self.pdb_hierarchy.atoms().extract_xyz()).\
                           nonbonded_proxies,
                   prefix="secondary_structure.nucleic_acid",
                   params=self.params.secondary_structure.nucleic_acid,
                   log=log,
                   verbose = self.verbose)
         return "\n".join([base_pairs, stacking_pairs])
     else:
         assert len(segids) > 1
         annotations = []
         for segid in segids:
             base_pairs = ""
             stacking_pairs = ""
             isel = self.selection_cache.selection("segid '%s'" %
                                                   segid).iselection()
             selected_pdb_h = self.pdb_hierarchy.select(isel)
             if selected_pdb_h.contains_nucleic_acid():
                 stacking_pairs = nucleic_acids.get_phil_stacking_pairs(
                     pdb_hierarchy=selected_pdb_h,
                     prefix="secondary_structure.nucleic_acid",
                     log=log,
                     add_segid=segid)
                 if self.grm is not None:
                     selected_grm = self.grm.select(iselection=isel)
                     base_pairs = nucleic_acids.get_phil_base_pairs(
                       pdb_hierarchy=selected_pdb_h,
                       nonbonded_proxies=selected_grm.pair_proxies(
                           sites_cart=selected_pdb_h.atoms().extract_xyz()).\
                               nonbonded_proxies,
                       prefix="secondary_structure.nucleic_acid",
                       log=log,
                       add_segid=segid,
                       verbose = self.verbose)
                 if (base_pairs is not None):
                     annotations.append(base_pairs)
                 if (stacking_pairs is not None):
                     annotations.append(stacking_pairs)
         return "\n".join(annotations)
 def find_base_pairs (self, log=sys.stdout, use_segid=False, segids=None):
   if not use_segid:
     base_pairs = ""
     stacking_pairs = ""
     if self.pdb_hierarchy.contains_nucleic_acid():
       stacking_pairs = nucleic_acids.get_phil_stacking_pairs(
         pdb_hierarchy=self.pdb_hierarchy,
         prefix="secondary_structure.nucleic_acid",
         params=self.params.secondary_structure.nucleic_acid,
         log=log)
       if self.grm is not None:
         base_pairs = nucleic_acids.get_phil_base_pairs(
           pdb_hierarchy=self.pdb_hierarchy,
           nonbonded_proxies=self.grm.pair_proxies().nonbonded_proxies,
           prefix="secondary_structure.nucleic_acid",
           params=self.params.secondary_structure.nucleic_acid,
           log=log,
           verbose = self.verbose)
     return "\n".join([base_pairs, stacking_pairs])
   else:
     assert len(segids) > 1
     annotations = []
     for segid in segids:
       base_pairs = ""
       stacking_pairs = ""
       isel = self.selection_cache.selection("segid '%s'" % segid).iselection()
       selected_pdb_h = self.pdb_hierarchy.select(isel)
       if selected_pdb_h.contains_nucleic_acid():
         stacking_pairs = nucleic_acids.get_phil_stacking_pairs(
           pdb_hierarchy=selected_pdb_h,
           prefix="secondary_structure.nucleic_acid",
           log=log,
           add_segid=segid)
         if self.grm is not None:
           selected_grm = self.grm.select(iselection=isel)
           base_pairs = nucleic_acids.get_phil_base_pairs(
             pdb_hierarchy=selected_pdb_h,
             nonbonded_proxies=selected_grm.pair_proxies(
                 sites_cart=selected_pdb_h.atoms().extract_xyz()).\
                     nonbonded_proxies,
             prefix="secondary_structure.nucleic_acid",
             log=log,
             add_segid=segid,
             verbose = self.verbose)
         if (base_pairs is not None) :
           annotations.append(base_pairs)
         if (stacking_pairs is not None) :
           annotations.append(stacking_pairs)
     return "\n".join(annotations)