/** * Calculate the phi angle. * * @param a * an AminoAcid object * @param b * an AminoAcid object * @return a double * @throws StructureException * if aminoacids not connected or if any of the 4 needed atoms * missing */ public static final double getPhi(AminoAcid a, AminoAcid b) throws StructureException { if ( ! isConnected(a,b)){ throw new StructureException( "can not calc Phi - AminoAcids are not connected!"); } Atom a_C = a.getC(); Atom b_N = b.getN(); Atom b_CA = b.getCA(); Atom b_C = b.getC(); // C and N were checked in isConnected already if (b_CA == null) throw new StructureException( "Can not calculate Phi, CA atom is missing"); return torsionAngle(a_C,b_N,b_CA,b_C); }
/** * Calculate the psi angle. * * @param a * an AminoAcid object * @param b * an AminoAcid object * @return a double * @throws StructureException * if aminoacids not connected or if any of the 4 needed atoms * missing */ public static final double getPsi(AminoAcid a, AminoAcid b) throws StructureException { if ( ! isConnected(a,b)) { throw new StructureException( "can not calc Psi - AminoAcids are not connected!"); } Atom a_N = a.getN(); Atom a_CA = a.getCA(); Atom a_C = a.getC(); Atom b_N = b.getN(); // C and N were checked in isConnected already if (a_CA == null) throw new StructureException( "Can not calculate Psi, CA atom is missing"); return torsionAngle(a_N,a_CA,a_C,b_N); }