void addLigandBond(CMLBond bond, CMLAtom otherAtom) { getLigandAtoms(); if (ligandAtoms.contains(otherAtom)) { throw new RuntimeException("Duplicate ligand: "+otherAtom.getId()); } getLigandBonds(); if (ligandBonds.contains(bond)) { throw new RuntimeException("Duplicate bond: "+bond.getAtomRefs2()); } ligandAtoms.add(otherAtom); ligandBonds.add(bond); }
/** gets all explict hydrogen ligand atoms. * ignore hydrogen count * @return list of atoms */ public List<CMLAtom> getLigandHydrogenAtoms() { List<CMLAtom> hydrogenAtoms = new ArrayList<CMLAtom>(); List<CMLAtom> ligandAtoms = this.getLigandAtoms(); for (CMLAtom ligand : ligandAtoms) { if (AS.H.equals(ligand.getElementType())) { hydrogenAtoms.add(ligand); } } return hydrogenAtoms; }
/** * * @return map where each entry corresponds to 2 atoms involved in a close contact. */ public Map<CMLAtom, CMLAtom> getCloseContacts() { Map<CMLAtom, CMLAtom> contactMap = new HashMap<CMLAtom, CMLAtom>(); for (CMLAtom atom : this.getAtoms()) { for (CMLAtom ligand : atom.getLigandAtoms()) { if (!contactMap.containsKey(ligand)) { double valenceDist = atom.getChemicalElement().getCovalentRadius()+ligand.getChemicalElement().getCovalentRadius(); double dist = atom.getDistanceTo(ligand); if ((valenceDist/2) > dist) { contactMap.put(atom, ligand); } } } } return contactMap; }
void debugLigands() { List<CMLAtom> atomList = this.getAtoms(); for (CMLAtom atom : atomList) { Util.println("ATOM: "+atom.getString()); for (CMLAtom ligand : atom.getLigandAtoms()) { Util.println(" LIG: "+ligand.getString()); } } }
List<CMLAtom> oatoms = atom.getLigandAtoms(); boolean countit = true; for (CMLAtom chk : oatoms) {