use of org.biojava.bio.structure.Atom in project ffx by mjschnie.
the class PDBFileMatcher method getMatchingAtom.
/**
* Searches for atom1's match in atoms2; first checks for an equivalent
* atom, then performs a search over all atoms in atoms2.
*
* @param atom1 An Atom.
* @param atoms2 An Atom[] to search.
* @return atom1's match in atom2.
* @throws IllegalArgumentException If no match could be found.
*/
private Atom getMatchingAtom(Atom atom1, Atom[] atoms2) throws IllegalArgumentException {
Atom atom2 = atoms2[0];
Structure structure2 = atom2.getGroup().getChain().getParent();
try {
atom2 = getMatchingAtom(atom1, structure2, false);
return atom2;
} catch (IllegalArgumentException ex) {
for (Atom atom : atoms2) {
if (compareAtoms(atom1, atom)) {
return atom;
}
}
}
throw new IllegalArgumentException(String.format("No matching atom for %s found", atom1.toString()));
}
Aggregations