All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.actelion.research.chem.phesa.pharmacophore.pp.AliphaticPoint Maven / Gradle / Ivy

There is a newer version: 2024.11.2
Show newest version
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;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy