Ejemplo n.º 1
0
 def get_rna_pucker_ref(self, test_pucker=False):
     flags = geometry_restraints.flags.flags(default=True)
     mon_lib_srv = monomer_library.server.server()
     ener_lib = monomer_library.server.ener_lib()
     self.bond_dict = {}
     self.angle_dict = {}
     self.processed_pdb_file = pdb_interpretation.process(
         mon_lib_srv=mon_lib_srv,
         ener_lib=ener_lib,
         file_name=None,
         raw_records=self.sample_bases)
     self.geometry = self.processed_pdb_file.geometry_restraints_manager()
     #confirm puckers are correct
     if test_pucker:
         r = rna_validate()
         r.pucker_evaluate(hierarchy=self.processed_pdb_file.
                           all_chain_proxies.pdb_hierarchy)
         assert not r.pucker_states[0].is_2p
         assert r.pucker_states[1].is_2p
     i_seq_name_hash = utils.build_name_hash(
         pdb_hierarchy=self.processed_pdb_file.all_chain_proxies.
         pdb_hierarchy)
     pair_proxies = self.geometry.pair_proxies(
         flags=flags,
         sites_cart=self.processed_pdb_file.all_chain_proxies.sites_cart)
     bond_proxies = pair_proxies.bond_proxies
     for bond in bond_proxies.simple:
         atom1 = i_seq_name_hash[bond.i_seqs[0]][0:4]
         atom2 = i_seq_name_hash[bond.i_seqs[1]][0:4]
         if (atom1.strip() not in self.rna_backbone_atoms
                 and atom2.strip() not in self.rna_backbone_atoms):
             continue
         key = atom1 + atom2
         sigma = (1 / bond.weight)**(.5)
         try:
             self.bond_dict[key].append((bond.distance_ideal, sigma))
         except Exception:
             self.bond_dict[key] = []
             self.bond_dict[key].append((bond.distance_ideal, sigma))
     for angle in self.geometry.angle_proxies:
         atom1 = i_seq_name_hash[angle.i_seqs[0]][0:4]
         atom2 = i_seq_name_hash[angle.i_seqs[1]][0:4]
         atom3 = i_seq_name_hash[angle.i_seqs[2]][0:4]
         if (atom1.strip() not in self.rna_backbone_atoms
                 and atom2.strip() not in self.rna_backbone_atoms
                 and atom3.strip() not in self.rna_backbone_atoms):
             continue
         key = atom1 + atom2 + atom3
         sigma = (1 / angle.weight)**(.5)
         try:
             self.angle_dict[key].append((angle.angle_ideal, sigma))
         except Exception:
             self.angle_dict[key] = []
             self.angle_dict[key].append((angle.angle_ideal, sigma))
Ejemplo n.º 2
0
 def get_rna_pucker_ref(self, test_pucker=False):
   flags = geometry_restraints.flags.flags(default=True)
   mon_lib_srv = monomer_library.server.server()
   ener_lib = monomer_library.server.ener_lib()
   self.bond_dict = {}
   self.angle_dict = {}
   self.processed_pdb_file = pdb_interpretation.process(
     mon_lib_srv=mon_lib_srv,
     ener_lib=ener_lib,
     file_name=None,
     raw_records=self.sample_bases)
   self.geometry = self.processed_pdb_file.geometry_restraints_manager()
   #confirm puckers are correct
   if test_pucker:
     r = rna_validate()
     r.pucker_evaluate(
       hierarchy=self.processed_pdb_file.all_chain_proxies.pdb_hierarchy)
     assert not r.pucker_states[0].is_2p
     assert r.pucker_states[1].is_2p
   i_seq_name_hash = utils.build_name_hash(
     pdb_hierarchy=self.processed_pdb_file.all_chain_proxies.pdb_hierarchy)
   pair_proxies = self.geometry.pair_proxies(
     flags=flags,
     sites_cart=self.processed_pdb_file.all_chain_proxies.sites_cart)
   bond_proxies = pair_proxies.bond_proxies
   for bond in bond_proxies.simple:
     atom1 = i_seq_name_hash[bond.i_seqs[0]][0:4]
     atom2 = i_seq_name_hash[bond.i_seqs[1]][0:4]
     if (atom1.strip() not in self.rna_backbone_atoms and
         atom2.strip() not in self.rna_backbone_atoms):
       continue
     key = atom1+atom2
     sigma = (1/bond.weight)**(.5)
     try:
       self.bond_dict[key].append((bond.distance_ideal, sigma))
     except Exception:
       self.bond_dict[key] = []
       self.bond_dict[key].append((bond.distance_ideal, sigma))
   for angle in self.geometry.angle_proxies:
     atom1 = i_seq_name_hash[angle.i_seqs[0]][0:4]
     atom2 = i_seq_name_hash[angle.i_seqs[1]][0:4]
     atom3 = i_seq_name_hash[angle.i_seqs[2]][0:4]
     if (atom1.strip() not in self.rna_backbone_atoms and
         atom2.strip() not in self.rna_backbone_atoms and
         atom3.strip() not in self.rna_backbone_atoms):
       continue
     key = atom1+atom2+atom3
     sigma = (1/angle.weight)**(.5)
     try:
       self.angle_dict[key].append((angle.angle_ideal, sigma))
     except Exception:
       self.angle_dict[key] = []
       self.angle_dict[key].append((angle.angle_ideal, sigma))
Ejemplo n.º 3
0
 def __init__(self,
              pdb_hierarchy,
              pdb_atoms,
              geometry_restraints_manager,
              outliers_only=True):
     rna_geometry.__init__(self)
     cutoff = 4
     sites_cart = pdb_atoms.extract_xyz()
     flags = geometry_restraints.flags.flags(default=True)
     i_seq_name_hash = utils.build_name_hash(pdb_hierarchy=pdb_hierarchy)
     for proxy in geometry_restraints_manager.angle_proxies:
         restraint = geometry_restraints.angle(sites_cart=sites_cart,
                                               proxy=proxy)
         atom1 = pdb_atoms[proxy.i_seqs[0]].name
         atom2 = pdb_atoms[proxy.i_seqs[1]].name
         atom3 = pdb_atoms[proxy.i_seqs[2]].name
         labels = pdb_atoms[proxy.i_seqs[0]].fetch_labels()
         if (atom1.strip() not in rna_backbone_atoms
                 or atom2.strip() not in rna_backbone_atoms
                 or atom3.strip() not in rna_backbone_atoms):
             continue
         self.n_total += 1
         sigma = sqrt(1 / restraint.weight)
         num_sigmas = restraint.delta / sigma
         is_outlier = (abs(num_sigmas) >= cutoff)
         if (is_outlier or not outliers_only):
             self.n_outliers += 1
             self.results.append(
                 rna_angle(chain_id=labels.chain_id,
                           resseq=labels.resseq,
                           icode=labels.icode,
                           altloc=labels.altloc,
                           resname=labels.resname,
                           atoms_info=validation.get_atoms_info(
                               pdb_atoms, proxy.i_seqs),
                           sigma=sigma,
                           score=num_sigmas,
                           delta=restraint.delta,
                           outlier=is_outlier))
Ejemplo n.º 4
0
 def __init__ (self, pdb_hierarchy, pdb_atoms, geometry_restraints_manager,
               outliers_only=True) :
   rna_geometry.__init__(self)
   cutoff = 4
   sites_cart = pdb_atoms.extract_xyz()
   flags = geometry_restraints.flags.flags(default=True)
   i_seq_name_hash = utils.build_name_hash(pdb_hierarchy=pdb_hierarchy)
   for proxy in geometry_restraints_manager.angle_proxies:
     restraint = geometry_restraints.angle(
       sites_cart=sites_cart,
       proxy=proxy)
     atom1 = pdb_atoms[proxy.i_seqs[0]].name
     atom2 = pdb_atoms[proxy.i_seqs[1]].name
     atom3 = pdb_atoms[proxy.i_seqs[2]].name
     labels = pdb_atoms[proxy.i_seqs[0]].fetch_labels()
     if (atom1.strip() not in rna_backbone_atoms or
         atom2.strip() not in rna_backbone_atoms or
         atom3.strip() not in rna_backbone_atoms):
       continue
     self.n_total += 1
     sigma = sqrt(1 / restraint.weight)
     num_sigmas = restraint.delta / sigma
     is_outlier = (abs(num_sigmas) >= cutoff)
     if (is_outlier or not outliers_only):
       self.n_outliers += 1
       self.results.append(rna_angle(
         chain_id=labels.chain_id,
         resseq=labels.resseq,
         icode=labels.icode,
         altloc=labels.altloc,
         resname=labels.resname,
         atoms_info=validation.get_atoms_info(pdb_atoms, proxy.i_seqs),
         sigma=sigma,
         score=num_sigmas,
         delta=restraint.delta,
         outlier=is_outlier))