com.actelion.research.chem.phesa.pharmacophore.PPTriangleMatcher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openchemlib Show documentation
Show all versions of openchemlib Show documentation
Open Source Chemistry Library
package com.actelion.research.chem.phesa.pharmacophore;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class PPTriangleMatcher {
private static final double CUTOFF = 2.0; //if lengths of edges of two triangles differ by more than 2.5A, it is
// not considered as a match
private PPTriangleMatcher() {}
public static List getMatchingTransforms(Map> triangleSetRef,
Map> triangleSetFit, int refConformerId, int conformerId) {
List results = new ArrayList();
for(int tHash : triangleSetRef.keySet()) {
if(!triangleSetFit.containsKey(tHash))
continue;
List fitTriangles = triangleSetFit.get(tHash);
List refTriangles = triangleSetRef.get(tHash);
for(PPTriangle refTriangle : refTriangles) {
for(PPTriangle fitTriangle : fitTriangles) {
if(doEdgeLengthsMatch(refTriangle,fitTriangle)) {
double[][] transform = new double[5][3];
double score = refTriangle.getMatchingTransform(fitTriangle, transform);
results.add(new AlignmentResult(score, transform,refConformerId,conformerId));
}
}
}
}
return results;
}
private static boolean doEdgeLengthsMatch(PPTriangle triangle1, PPTriangle triangle2) {
double[] d1 = triangle1.getEdgeLengths();
double[] d2 = triangle2.getEdgeLengths();
if(Math.abs(d1[0]-d2[0])
© 2015 - 2025 Weber Informatics LLC | Privacy Policy