com.actelion.research.chem.docking.ScoringTask 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.docking;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import com.actelion.research.chem.Coordinates;
import com.actelion.research.chem.Molecule3D;
import com.actelion.research.chem.StereoMolecule;
import com.actelion.research.chem.conf.Conformer;
import com.actelion.research.chem.docking.scoring.idoscore.InteractionTerm;
import com.actelion.research.chem.interactionstatistics.InteractionDistanceStatistics;
import com.actelion.research.chem.interactionstatistics.SplineFunction;
import com.actelion.research.chem.io.pdb.converter.MoleculeGrid;
import com.actelion.research.chem.potentialenergy.PotentialEnergyTerm;
public class ScoringTask {
/**
*
* @param receptor
* @param ligand
* @param receptorAtomTypes
* @param ligandAtomTypes
* @return
*/
public static double calcScore(StereoMolecule receptor, StereoMolecule ligand, int[] receptorAtomTypes, int[] ligandAtomTypes) {
Set receptorAtoms = new HashSet();
List terms = new ArrayList();
MoleculeGrid molGrid = new MoleculeGrid(receptor);
for(int l=0;l receptorAtoms = new HashSet();
MoleculeGrid grid = new MoleculeGrid(receptor);
receptorAtoms.addAll(grid.getNeighbours(c, InteractionDistanceStatistics.CUTOFF_RADIUS));
for(int p : receptorAtoms) {
SplineFunction f = InteractionDistanceStatistics.getInstance().getFunction(receptorAtomTypes[p], probeAtomType);
double dist = c.distance(receptor.getCoordinates(p));
score+=f.getFGValue(dist)[0];
}
return score;
}
};