@Override public Object clone() { NucleotideImpl n = new NucleotideImpl(); n.setPDBFlag(has3D()); n.setResidueNumber(getResidueNumber()); n.setPDBName(getPDBName()); //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; } }
/** * Returns the O5' atom if present, otherwise null * @return O5' atom or null */ public Atom getO5Prime() { return getAtom("O5'"); }
private void formNucleotideBonds() { for (int modelInd=0; modelInd<structure.nrModels(); modelInd++){ for (Chain chain : structure.getChains(modelInd)) { List<Group> groups = chain.getSeqResGroups(); for (int i = 0; i < groups.size() - 1; i++) { if (!(groups.get(i) instanceof NucleotideImpl) || !(groups.get(i + 1) instanceof NucleotideImpl)) continue; NucleotideImpl tail = (NucleotideImpl) groups.get(i); NucleotideImpl head = (NucleotideImpl) groups.get(i + 1); // atoms with no residue number don't have atom information if (tail.getResidueNumber() == null || head.getResidueNumber() == null) { continue; } Atom phosphorous = head.getP(); Atom oThreePrime = tail.getO3Prime(); if (phosphorous == null || oThreePrime == null) { continue; } if (Calc.getDistance(phosphorous, oThreePrime) < MAX_NUCLEOTIDE_BOND_LENGTH) { new BondImpl(phosphorous, oThreePrime, 1); } } } } }
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; } } }
} else if ( g instanceof NucleotideImpl) { NucleotideImpl nuc = (NucleotideImpl) g; nuc.setId(seq_id); } else if ( g instanceof HetatomImpl) { HetatomImpl het = (HetatomImpl)g; if (StructureTools.isNucleotide(groupCode3)) { NucleotideImpl nu = new NucleotideImpl(); group = nu; nu.setId(seq_id); if (StructureTools.isNucleotide(groupCode3)) { NucleotideImpl nu = new NucleotideImpl(); group = nu; nu.setId(seq_id);
NucleotideImpl nuc = new NucleotideImpl();
private int getInternalNr(Group atomG) { if ( atomG.getType().equals(GroupType.AMINOACID)) { AminoAcidImpl aa = (AminoAcidImpl) atomG; return new Long(aa.getId()).intValue(); } else if ( atomG.getType().equals(GroupType.NUCLEOTIDE)) { NucleotideImpl nu = (NucleotideImpl) atomG; return new Long(nu.getId()).intValue(); } else { HetatomImpl he = (HetatomImpl) atomG; return new Long(he.getId()).intValue(); } }
/** * Gets the radius for given nucleotide atom * @param atom * @return */ private static double getRadiusForNucl(NucleotideImpl nuc, Atom atom) { if (atom.getElement().equals(Element.H)) return Element.H.getVDWRadius(); if (atom.getElement().equals(Element.D)) return Element.D.getVDWRadius(); if (atom.getElement()==Element.C) return NUC_CARBON_VDW; if (atom.getElement()==Element.N) return NUC_NITROGEN_VDW; if (atom.getElement()==Element.P) return PHOSPHOROUS_VDW; if (atom.getElement()==Element.O) return OXIGEN_VDW; logger.info("Unexpected atom "+atom.getName()+" for nucleotide "+nuc.getPDBName()+", assigning its standard vdw radius"); return atom.getElement().getVDWRadius(); }
/** 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 ; }
break; case 2: group = new NucleotideImpl(); break; default:
/** * Returns the O3' atom if present, otherwise null * @return O3' atom or null */ public Atom getO3Prime() { return getAtom("O3'"); }
NucleotideImpl n = new NucleotideImpl(); g = n;
/** * Returns the P atom if present, otherwise null * @return P atom or null */ public Atom getP() { return getAtom("P"); }