AminoAcid aa = new AminoAcidImpl();
/** 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; }
public static void main(String[] args){ Chain c = new ChainImpl(); c.setId("X"); Group g = new AminoAcidImpl(); g.setResidueNumber(ResidueNumber.fromString("1A")); try { g.setPDBName("ALA"); } catch (Exception e){} Atom a = new AtomImpl(); a.setName("CA"); g.addAtom(a); c.addGroup(g); System.out.println(getPdbInfo(a)); }
/** initiate new resNum, either Hetatom, Nucleotide, or AminoAcid */ private Group getNewGroup(String recordName,Character aminoCode1, String aminoCode3) { Group g = ChemCompGroupFactory.getGroupFromChemCompDictionary(aminoCode3); if ( g != null && !g.getChemComp().isEmpty()) return g; Group group; if (aminoCode1 == null || StructureTools.UNKNOWN_GROUP_LABEL == aminoCode1 ){ group = new HetatomImpl(); } else if(StructureTools.isNucleotide(aminoCode3)) { // it is a nucleotide NucleotideImpl nu = new NucleotideImpl(); group = nu; } else { AminoAcidImpl aa = new AminoAcidImpl() ; aa.setAminoType(aminoCode1); group = aa ; } // System.out.println("new resNum type: "+ resNum.getType() ); return group ; }
switch (polymerType) { case 1: AminoAcid aa = new AminoAcidImpl();
private static Group getSeqResGroup(Chain modelChain, char singleLetterCode, GroupType type) { if(type==GroupType.AMINOACID){ AminoAcidImpl a = new AminoAcidImpl(); a.setRecordType(AminoAcid.SEQRESRECORD); a.setAminoType(singleLetterCode); ChemComp chemComp = new ChemComp(); chemComp.setOne_letter_code(""+singleLetterCode); a.setChemComp(chemComp); return a; } else if (type==GroupType.NUCLEOTIDE) { NucleotideImpl n = new NucleotideImpl(); ChemComp chemComp = new ChemComp(); chemComp.setOne_letter_code(""+singleLetterCode); n.setChemComp(chemComp); return n; } else{ return null; } } }
AminoAcidImpl a = new AminoAcidImpl(); a.setRecordType(AminoAcid.SEQRESRECORD); Character code1 = StructureTools.get1LetterCodeAmino(epolseq.getMon_id());
AminoAcidImpl aa = new AminoAcidImpl() ; aa.setAminoType(aminoCode1); aa.setId(seq_id); AminoAcidImpl aa = new AminoAcidImpl() ; aa.setAminoType(aminoCode1); aa.setId(seq_id);
/** returns and identical copy of this Group object . * @return and identical copy of this Group object */ @Override public Object clone() { AminoAcidImpl n = new AminoAcidImpl(); n.setPDBFlag(has3D()); n.setResidueNumber(getResidueNumber()); n.setPDBName(getPDBName()); n.setAminoType(getAminoType()); n.setRecordType(recordType); //clone atoms and bonds. cloneAtomsAndBonds(n); // copying the alt loc groups if present, otherwise they stay null if (getAltLocs()!=null && !getAltLocs().isEmpty()) { for (Group altLocGroup:this.getAltLocs()) { Group nAltLocGroup = (Group)altLocGroup.clone(); n.addAltLoc(nAltLocGroup); } } if (chemComp!=null) n.setChemComp(chemComp); return n; }
AminoAcid n = new AminoAcidImpl(); n.setPDBName(g.getPDBName()); n.setResidueNumber(g.getResidueNumber());