Search in sources :

Example 1 with Group

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;
}
Also used : Chain(org.biojava.nbio.structure.Chain) AFPChain(org.biojava.nbio.structure.align.model.AFPChain) Group(org.biojava.nbio.structure.Group) ChainImpl(org.biojava.nbio.structure.ChainImpl) AtomImpl(org.biojava.nbio.structure.AtomImpl) AminoAcidImpl(org.biojava.nbio.structure.AminoAcidImpl) Atom(org.biojava.nbio.structure.Atom)

Aggregations

AminoAcidImpl (org.biojava.nbio.structure.AminoAcidImpl)1 Atom (org.biojava.nbio.structure.Atom)1 AtomImpl (org.biojava.nbio.structure.AtomImpl)1 Chain (org.biojava.nbio.structure.Chain)1 ChainImpl (org.biojava.nbio.structure.ChainImpl)1 Group (org.biojava.nbio.structure.Group)1 AFPChain (org.biojava.nbio.structure.align.model.AFPChain)1