/** * Get AA sequence */ String aaSequence(Chain chain) { // AA sequence List<AminoAcid> aas = aminoAcids(chain); StringBuilder sb = new StringBuilder(); for (AminoAcid aa1 : aas) sb.append(aa1.getAminoType()); return sb.toString(); }
public void setAa1(AminoAcid aa) { setPdbId(aa.getChain().getStructure().getPDBCode()); pdbChainId1 = aa.getChainId(); aaPos1 = aa.getResidueNumber().getSeqNum() - 1; aa1 = aa.getChemComp().getOne_letter_code().charAt(0); }
/** create a new residue which is of the new type. * Only the atoms N, Ca, C, O, Cb will be considered. * @param oldAmino * @param newType * @return a new, mutated, residue * @throws PDBParseException */ public AminoAcid mutateResidue(AminoAcid oldAmino, String newType) throws PDBParseException { AminoAcid newgroup = new AminoAcidImpl(); newgroup.setResidueNumber(oldAmino.getResidueNumber()); newgroup.setPDBName(newType); AtomIterator aiter =new AtomIterator(oldAmino); while (aiter.hasNext()){ Atom a = aiter.next(); if ( supportedAtoms.contains(a.getName())){ newgroup.addAtom(a); } } return newgroup; }
/** * 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 final 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; }
/** * 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); }
public synchronized void setChain(Chain c){ List<Group> a = c.getAtomGroups(GroupType.AMINOACID); seqArr = new Character[a.size()]; chain = new ChainImpl(); Iterator<Group> iter = a.iterator(); int i = 0; while (iter.hasNext()){ AminoAcid aa = (AminoAcid) iter.next(); // preserver original hierarchy ... for highlighting in Jmol Chain old = aa.getChain(); chain.addGroup(aa); aa.setChain(old); seqArr[i] = aa.getAminoType(); i++; } chainLength = i; coordManager.setLength(chainLength); setPrefSize(); this.repaint(); }
char aa = amino.getAminoType(); logger.info("Unexpected atom "+atomCode+" for aminoacid "+aa+ " ("+amino.getPDBName()+"), assigning its standard vdw radius");
if (group instanceof AminoAcid) { AminoAcid aa = (AminoAcid) group; int aaPos = aa.getResidueNumber().getSeqNum() - 1; if (aaPos < 0) continue; // I don't know why some PDB coordinates are negative... char aaLetter = aa.getChemComp().getOne_letter_code().charAt(0); if (prot.length() > aaPos) { char trAaLetter = prot.charAt(aaPos); } else countMismatch++; sb.append(aa.getChemComp().getOne_letter_code());
n.setPDBName(g.getPDBName()); n.setResidueNumber(g.getResidueNumber()); n.addAtom(a); newChain.addGroup(n); continue grouploop;
/** * Minimum distance between all atoms in two amino acids */ double distanceMin(AminoAcid aa1, AminoAcid aa2) { double distMin = Double.POSITIVE_INFINITY; for (Atom atom1 : aa1.getAtoms()) for (Atom atom2 : aa2.getAtoms()) { double dist = Calc.getDistance(atom1, atom2); distMin = Math.min(distMin, dist); } return distMin; }
/** * 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); }
public void setAa2(AminoAcid aa) { setPdbId(aa.getChain().getStructure().getPDBCode()); pdbChainId2 = aa.getChainId(); aaPos2 = aa.getResidueNumber().getSeqNum() - 1; aa2 = aa.getChemComp().getOne_letter_code().charAt(0); }
/** * Returns the relative (uncomplexed) ASA, i.e. the ASA of the residue * with respect to its ASA in an extended tri-peptide conformation (GLY-x-GLY) * @return */ public double getRelativeAsaU() { if (!g.getType().equals(GroupType.AMINOACID)) throw new IllegalArgumentException("Can not calculate relative ASA for non amino-acid"); char aa = ((AminoAcid)g).getAminoType(); return (asaU/tripeptAsa.get(aa)); }
/** * Returns the relative (complexed) ASA, i.e. the ASA of the residue * with respect to its ASA in an extended tri-peptide conformation (GLY-x-GLY) * @return */ public double getRelativeAsaC() { if (!g.getType().equals(GroupType.AMINOACID)) throw new IllegalArgumentException("Can not calculate relative ASA for non amino-acid"); char aa = ((AminoAcid)g).getAminoType(); return (asaC/tripeptAsa.get(aa)); }
char oneLetter =a.getAminoType(); if ( oneLetter == '?') oneLetter = 'X';