use of org.biojava.nbio.structure.geometry.MomentsOfInertia in project mm-dev by sbl-sdsc.
the class ShapeTypeDemo method calcShape.
private static String calcShape(Structure structure) {
// calculate moments of inertia for C-alpha atoms
MomentsOfInertia moi = new MomentsOfInertia();
for (Atom a : StructureTools.getAtomCAArray(structure)) {
moi.addPoint(a.getCoordsAsPoint3d(), 1.0);
}
// calculate symmetry based on the moments of inertia
String s1 = moi.getSymmetryClass(0.05).toString();
if (s1.equals("SYMMETRIC")) {
return s1;
} else {
String s2 = moi.getSymmetryClass(0.2).toString();
if (s2.equals("SYMMETRIC")) {
return "EXCLUDE";
} else {
return s2;
}
}
}
Aggregations