use of org.biojava.nbio.structure.Group in project mm-dev by sbl-sdsc.
the class BiojavaAligner method getCAAtoms.
/**
* Converts an array of points representing C-alpha position to a minimal BioJava data structure.
*
* @param points coordinates of C-alpha atoms
* @return BioJava atom array
*/
private static Atom[] getCAAtoms(Point3d[] points) {
Chain c = new ChainImpl();
c.setId("A");
// create dummy BioJava atoms for each C-alpha coordinate
Atom[] atoms = new Atom[points.length];
for (int i = 0; i < points.length; i++) {
atoms[i] = new AtomImpl();
atoms[i].setName(CA_NAME);
Group g = new AminoAcidImpl();
g.setPDBName(GROUP_NAME);
g.setResidueNumber("A", i, ' ');
g.addAtom(atoms[i]);
c.addGroup(g);
atoms[i].setX(points[i].x);
atoms[i].setY(points[i].y);
atoms[i].setZ(points[i].z);
}
return atoms;
}
Aggregations