Search in sources :

Example 1 with CoordinationGeometry

use of edu.sdsc.mmtf.spark.utils.CoordinationGeometry in project mmtf-spark by sbl-sdsc.

the class CoordinationGeometryTest method test.

@Test
public void test() {
    StructureDataInterface structure = pdb.values().first();
    ColumnarStructure cs = new ColumnarStructure(structure, true);
    // ZN A.101.ZN
    Point3d center = getCoords(cs, 459);
    Point3d[] neighbors = new Point3d[6];
    // CYS A.7.SG
    neighbors[0] = getCoords(cs, 28);
    // CYS A.10.SG
    neighbors[1] = getCoords(cs, 44);
    // HIS A.31.ND1
    neighbors[2] = getCoords(cs, 223);
    // CYS A.34.SG
    neighbors[3] = getCoords(cs, 245);
    // CYS A.10.N
    neighbors[4] = getCoords(cs, 45);
    // HIS A.31.O
    neighbors[5] = getCoords(cs, 220);
    CoordinationGeometry geom = new CoordinationGeometry(center, neighbors);
    double q3Expected = 0.9730115379131878;
    assertEquals(q3Expected, geom.q3(), 0.0001);
    double q4Expected = 0.9691494056145086;
    assertEquals(q4Expected, geom.q4(), 0.0001);
    double q5Expected = 0.5126001729084566;
    assertEquals(q5Expected, geom.q5(), 0.0001);
    double q6Expected = 0.2723305441457363;
    assertEquals(q6Expected, geom.q6(), 0.0001);
}
Also used : ColumnarStructure(edu.sdsc.mmtf.spark.utils.ColumnarStructure) Point3d(javax.vecmath.Point3d) CoordinationGeometry(edu.sdsc.mmtf.spark.utils.CoordinationGeometry) StructureDataInterface(org.rcsb.mmtf.api.StructureDataInterface) Test(org.junit.Test)

Aggregations

ColumnarStructure (edu.sdsc.mmtf.spark.utils.ColumnarStructure)1 CoordinationGeometry (edu.sdsc.mmtf.spark.utils.CoordinationGeometry)1 Point3d (javax.vecmath.Point3d)1 Test (org.junit.Test)1 StructureDataInterface (org.rcsb.mmtf.api.StructureDataInterface)1