com.actelion.research.chem.phesa.pharmacophore.pp.AliphaticPoint 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.pp;
import com.actelion.research.chem.Coordinates;
import com.actelion.research.chem.StereoMolecule;
import com.actelion.research.chem.conf.Conformer;
import com.actelion.research.chem.phesa.pharmacophore.PharmacophoreCalculator;
import java.util.ArrayList;
import java.util.List;
public class AliphaticPoint implements IPharmacophorePoint {
private int referenceAtom;
private List atoms;
private Coordinates center;
private static final Coordinates directionality = new Coordinates(1.0,0.0,0.0);
public AliphaticPoint(StereoMolecule mol, int a, List atoms) {
referenceAtom = a;
this.atoms = atoms;
updateCoordinates(mol.getAtomCoordinates());
}
public AliphaticPoint(AliphaticPoint aP) {
referenceAtom = aP.referenceAtom;
center = new Coordinates(aP.center);
atoms = new ArrayList();
for(int ringAtom : aP.atoms) {
atoms.add(ringAtom);
}
}
@Override
public Coordinates getCenter() {
return center;
}
@Override
public void updateCoordinates(Coordinates[] coords) {
Coordinates com = new Coordinates(0,0,0);
for(int atom : atoms) {
com.add(coords[atom]);
}
com.scale(1.0/( atoms.size()));
center = com;
}
@Override
public Coordinates getDirectionality() {
return directionality;
}
@Override
public Coordinates getRotatedDirectionality(double[][] m,double scaleFactor) {
return null;
}
private AliphaticPoint(String ppString, StereoMolecule mol) {
decode(ppString,mol);
}
public static AliphaticPoint fromString(String ppString, StereoMolecule mol) {
return new AliphaticPoint(ppString,mol);
}
private void decode(String ppString, StereoMolecule mol) {
String[] strings = ppString.split(" ");
referenceAtom = Integer.decode(strings[1]);
atoms = new ArrayList();
for(int i=2;i getAtoms() {
return atoms;
}
}