public static double getPhi(AminoAcid a, AminoAcid b) { if (!isConnected(a, b)) { //System.out.println("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) { }// System.out.println("Can not calculate Phi, CA atom is missing"); return torsionAngle(a_C, b_N, b_CA, b_C); }
/** * Test if two amino acids are connected, i.e. * if the distance from C to N < 2.5 Angstrom. * * If one of the AminoAcids has an atom missing, returns false. * * @param a an AminoAcid object * @param b an AminoAcid object * @return true if ... */ public static Boolean isConnected(AminoAcid a, AminoAcid b) { Atom C = null; Atom N = null; C = a.getC(); N = b.getN(); if (C == null || N == null) { return(false); } // one could also check if the CA atoms are < 4 A... //double distance = getDistance(C,N); //return distance < 2.5; return(true); }
/** * 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 double getPsi(AminoAcid a, AminoAcid b) { if (!isConnected(a, b)) { //System.out.println("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) { } // System.out.println("Can not calculate Psi, CA atom is missing"); return(torsionAngle(a_N, a_CA, a_C, b_N)); }
/** * Test if two amino acids are connected, i.e. * if the distance from C to N < 2.5 Angstrom. * * If one of the AminoAcids has an atom missing, returns false. * * @param a an AminoAcid object * @param b an AminoAcid object * @return true if ... */ public static Boolean isConnected(AminoAcid a, AminoAcid b) { Atom C = null; Atom N = null; C = a.getC(); N = b.getN(); if (C == null || N == null) return false; // one could also check if the CA atoms are < 4 A... //double distance = getDistance(C,N); //return distance < 2.5; return true; }