Пример #1
0
  private static Atom calcSimple_H(Atom c, Atom o, Atom n) throws StructureException {

    Atom h = Calc.substract(c, o);
    double dist = Calc.getDistance(o, c);
    // System.out.println(dist);
    double x = n.getX() + h.getX() / dist;
    double y = n.getY() + h.getY() / dist;
    double z = n.getZ() + h.getZ() / dist;

    h.setX(x);
    h.setY(y);
    h.setZ(z);

    h.setName("H");
    h.setFullName(" H  ");
    return h;
  }
Пример #2
0
  /**
   * Use unit vectors NC and NCalpha Add them. Calc unit vector and substract it from N. C
   * coordinates are from amino acid i-1 N, CA atoms from amino acid i
   *
   * <p>see also:
   *
   * @link
   *     {http://openbioinformatics.blogspot.com/2009/08/how-to-calculate-h-atoms-for-nitrogens.html}
   */
  private static Atom calc_H(Atom C, Atom N, Atom CA) throws StructureException {

    Atom nc = Calc.substract(N, C);
    Atom nca = Calc.substract(N, CA);

    Atom u_nc = Calc.unitVector(nc);
    Atom u_nca = Calc.unitVector(nca);

    Atom added = Calc.add(u_nc, u_nca);

    Atom U = Calc.unitVector(added);

    // according to Creighton distance N-H is 1.03 +/- 0.02A
    Atom H = Calc.add(N, U);

    H.setName("H");
    H.setFullName(" H  ");
    // this atom does not have a pdbserial number ...
    return H;
  }
Пример #3
0
  /** calculate the HBonds between different groups ... see Creighton page 147 f */
  private void calculateHBonds() throws StructureException {
    System.out.println("groups length: " + groups.length);

    // skip the first residue , unable to calc H for it ...
    for (int i = 1; i < groups.length; i++) {

      SecStrucGroup one = groups[i];

      if (!one.hasAtom("H")) {
        System.out.println(" no H at " + i);
        continue;
      }

      for (int j = i + 1; j < groups.length; j++) {

        SecStrucGroup two = groups[j];

        // check if distance is  too large.
        // if too big - for sure no HBonds ...
        double dist = Calc.getDistance(one.getCA(), two.getCA());

        // speed up...
        if (dist >= CA_MIN_DIST) continue;
        // System.out.println("calc " + i + " " + j + " "+  dist);

        checkAddHBond(i, j);

        // "backwards" hbonds are not allowed
        if (j != (i + 1)) {

          checkAddHBond(j, i);
        }
        // System.out.println(" ");
      }
    }
  }
Пример #4
0
  /**
   * calculate HBond energy of two groups in cal/mol ... see Creighton page 147 f
   *
   * <p>Jeffrey, George A., An introduction to hydrogen bonding, Oxford University Press, 1997.
   * categorizes hbonds with donor-acceptor distances of 2.2-2.5 &aring; as "strong, mostly
   * covalent", 2.5-3.2 &aring; as "moderate, mostly electrostatic", 3.2-4.0 &aring; as "weak,
   * electrostatic". Energies are given as 40-14, 15-4, and <4 kcal/mol respectively.
   */
  public double calculateHBondEnergy(SecStrucGroup one, SecStrucGroup two)
      throws StructureException {

    // System.out.println("calcHBondEnergy" + one + "|" + two);

    Atom N = one.getN();
    Atom H = one.getH();

    Atom O = two.getO();
    Atom C = two.getC();

    double dno = Calc.getDistance(O, N);
    double dhc = Calc.getDistance(C, H);
    double dho = Calc.getDistance(O, H);
    double dnc = Calc.getDistance(C, N);

    if (debug) {

      System.out.println(
          "     cccc: "
              + one.getPDBCode()
              + " "
              + one.getPDBName()
              + " "
              + two.getPDBCode()
              + " "
              + two.getPDBName()
              + String.format(
                  " O ("
                      + O.getPDBserial()
                      + ")..N ("
                      + N.getPDBserial()
                      + "):%4.1f  |  ho:%4.1f - hc:%4.1f + nc:%4.1f - no:%4.1f ",
                  dno,
                  dho,
                  dhc,
                  dnc,
                  dno));
    }
    // System.out.println( cn > ch && oh < 3.0f);

    double contact = MINDIST;

    //		 there seems to be a contact!
    if ((dno < contact) || (dhc < contact) || (dnc < contact) || (dno < contact)) {
      // System.out.println("!!! contact " + one + " " + two);
      return HBONDLOWENERGY;
    }

    double e1 = Q / dho - Q / dhc;
    double e2 = Q / dnc - Q / dno;

    double energy = e1 + e2;

    if (debug)
      System.out.println(
          String.format(
              "      N (%d) O(%d): %4.1f : %4.2f ",
              N.getPDBserial(), O.getPDBserial(), (float) dno, energy));

    // bond too weak
    if (energy > HBONDHIGHENERGY) return 0;

    // test to avoid bond too strong
    if (energy > HBONDLOWENERGY) return energy;

    return HBONDLOWENERGY;
  }