Beispiel #1
0
def pperp_outliers(hierarchy, chain):
    kin_out = "@vectorlist {ext} color= magenta master= {base-P perp}\n"
    rv = rna_validate.rna_puckers(pdb_hierarchy=hierarchy)
    outliers = rv.results
    params = rna_sugar_pucker_analysis.master_phil.extract()
    outlier_key_list = []
    for outlier in outliers:
        outlier_key_list.append(outlier.id_str())
    for conformer in chain.conformers():
        for residue in conformer.residues():
            if common_residue_names_get_class(
                    residue.resname) != "common_rna_dna":
                continue
            ra1 = residue_analysis(
                residue_atoms=residue.atoms(),
                distance_tolerance=params.bond_detection_distance_tolerance)
            if (ra1.problems is not None): continue
            if (not ra1.is_rna): continue
            try:
                key = residue.find_atom_by(name=" C1'").pdb_label_columns()[4:]
            except Exception:
                continue
            if key in outlier_key_list:
                if rv.pucker_perp_xyz[key][0] is not None:
                    perp_xyz = rv.pucker_perp_xyz[key][0]  #p_perp_xyz
                else:
                    perp_xyz = rv.pucker_perp_xyz[key][1]  #o3p_perp_xyz
                if rv.pucker_dist[key][0] is not None:
                    perp_dist = rv.pucker_dist[key][0]
                    if perp_dist < 2.9:
                        pucker_text = " 2'?"
                    else:
                        pucker_text = " 3'?"
                else:
                    perp_dist = rv.pucker_dist[key][1]
                    if perp_dist < 2.4:
                        pucker_text = " 2'?"
                    else:
                        pucker_text = " 3'?"
                key = key[0:4].lower() + key[4:]
                key += pucker_text
                kin_out += kin_vec(key, perp_xyz[0], key, perp_xyz[1])
                a = matrix.col(perp_xyz[1])
                b = matrix.col(residue.find_atom_by(name=" C1'").xyz)
                c = (a - b).normalize()
                new = a - (c * .8)
                kin_out += kin_vec(key, perp_xyz[1], key, tuple(new), 4)
                new = a + (c * .4)
                kin_out += kin_vec(key, perp_xyz[1], key, tuple(new), 4)
                r_vec = matrix.col(perp_xyz[1]) - matrix.col(perp_xyz[0])
                r = r_vec.axis_and_angle_as_r3_rotation_matrix(angle=90,
                                                               deg=True)
                new = r * (new - a) + a
                kin_out += kin_vec(key, perp_xyz[1], key, tuple(new), 4)
                r = r_vec.axis_and_angle_as_r3_rotation_matrix(angle=180,
                                                               deg=True)
                new = r * (new - a) + a
                kin_out += kin_vec(key, perp_xyz[1], key, tuple(new), 4)
    return kin_out
Beispiel #2
0
def pperp_outliers(hierarchy, chain):
  kin_out = "@vectorlist {ext} color= magenta master= {base-P perp}\n"
  rv = rna_validate.rna_puckers(pdb_hierarchy=hierarchy)
  outliers = rv.results
  params = rna_sugar_pucker_analysis.master_phil.extract()
  outlier_key_list = []
  for outlier in outliers:
    outlier_key_list.append(outlier.id_str())
  for conformer in chain.conformers():
    for residue in conformer.residues():
      if common_residue_names_get_class(residue.resname) != "common_rna_dna":
        continue
      ra1 = residue_analysis(
        residue_atoms=residue.atoms(),
        distance_tolerance=params.bond_detection_distance_tolerance)
      if (ra1.problems is not None): continue
      if (not ra1.is_rna): continue
      try:
        key = residue.find_atom_by(name=" C1'").pdb_label_columns()[4:]
      except Exception:
        continue
      if key in outlier_key_list:
        if rv.pucker_perp_xyz[key][0] is not None:
          perp_xyz = rv.pucker_perp_xyz[key][0] #p_perp_xyz
        else:
          perp_xyz = rv.pucker_perp_xyz[key][1] #o3p_perp_xyz
        if rv.pucker_dist[key][0] is not None:
          perp_dist = rv.pucker_dist[key][0]
          if perp_dist < 2.9:
            pucker_text = " 2'?"
          else:
            pucker_text = " 3'?"
        else:
          perp_dist = rv.pucker_dist[key][1]
          if perp_dist < 2.4:
            pucker_text = " 2'?"
          else:
            pucker_text = " 3'?"
        key = key[0:4].lower()+key[4:]
        key += pucker_text
        kin_out += kin_vec(key, perp_xyz[0], key, perp_xyz[1])
        a = matrix.col(perp_xyz[1])
        b = matrix.col(residue.find_atom_by(name=" C1'").xyz)
        c = (a-b).normalize()
        new = a-(c*.8)
        kin_out += kin_vec(key, perp_xyz[1], key, tuple(new), 4)
        new = a+(c*.4)
        kin_out += kin_vec(key, perp_xyz[1], key, tuple(new), 4)
        r_vec = matrix.col(perp_xyz[1]) - matrix.col(perp_xyz[0])
        r = r_vec.axis_and_angle_as_r3_rotation_matrix(angle=90, deg=True)
        new = r*(new-a)+a
        kin_out += kin_vec(key, perp_xyz[1], key, tuple(new), 4)
        r = r_vec.axis_and_angle_as_r3_rotation_matrix(angle=180, deg=True)
        new = r*(new-a)+a
        kin_out += kin_vec(key, perp_xyz[1], key, tuple(new), 4)
  return kin_out