Ejemplo n.º 1
0
  /**
   * Gets the van der Waals radius of the given atom following the values defined by Chothia (1976)
   * J.Mol.Biol.105,1-14 NOTE: the vdw values defined by the paper assume no Hydrogens and thus
   * "inflates" slightly the heavy atoms to account for Hydrogens. Thus this method cannot be used
   * in a structure that contains Hydrogens!
   *
   * <p>If atom is neither part of a nucleotide nor of a standard aminoacid, the default vdw radius
   * for the element is returned. If atom is of unknown type (element) the vdw radius of {@link
   * #Element().N} is returned
   *
   * @param atom
   * @return
   */
  public static double getRadius(Atom atom) {

    if (atom.getElement() == null) {
      System.err.println(
          "Warning: unrecognised atom "
              + atom.getName()
              + " with serial "
              + atom.getPDBserial()
              + ", assigning the default vdw radius (Nitrogen vdw radius).");
      return Element.N.getVDWRadius();
    }

    Group res = atom.getGroup();

    if (res == null) {
      System.err.println(
          "Warning: unknown parent residue for atom "
              + atom.getName()
              + " with serial "
              + atom.getPDBserial()
              + ", assigning its default vdw radius");
      return atom.getElement().getVDWRadius();
    }

    String type = res.getType();

    if (type.equals(GroupType.AMINOACID)) return getRadiusForAmino(((AminoAcid) res), atom);

    if (type.equals(GroupType.NUCLEOTIDE)) return getRadiusForNucl((NucleotideImpl) res, atom);

    return atom.getElement().getVDWRadius();
  }