Beispiel #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;
  }
Beispiel #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;
  }