com.actelion.research.chem.potentialenergy.EmpiricalLigandStrain 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.potentialenergy;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.AbstractMap.SimpleEntry;
import com.actelion.research.chem.StereoMolecule;
import com.actelion.research.chem.conf.BondRotationHelper;
import com.actelion.research.chem.conf.Conformer;
import com.actelion.research.chem.conf.torsionstrain.StatisticalTorsionPotential;
import com.actelion.research.chem.conf.torsionstrain.StatisticalTorsionTerm;
import com.actelion.research.chem.docking.scoring.idoscore.InteractionTerm;
import com.actelion.research.chem.interactionstatistics.InteractionAtomTypeCalculator;
import com.actelion.research.chem.interactionstatistics.InteractionDistanceStatistics;
public class EmpiricalLigandStrain implements PotentialEnergyTerm {
private Conformer conf;
private List strain;
private BondRotationHelper torsionHelper;
private List ligAtomPairs;
private int[] atomTypes;
public EmpiricalLigandStrain(Conformer conf, int[] atomTypes, BondRotationHelper torsionHelper) {
this.conf = conf;
this.atomTypes = atomTypes;
this.torsionHelper = torsionHelper;
init();
}
private void init() {
StereoMolecule mol = conf.getMolecule();
strain = new ArrayList();
ligAtomPairs = new ArrayList();
List ligAtomTypesList = new ArrayList<>();
for(int a=0;a> invalidPairs = new HashSet>();
StereoMolecule mol = conf.getMolecule();
for(int a=0;a entry = a(a,aa) : new SimpleEntry<>(a,aa);
invalidPairs.add(entry);
for(int j=0;j(a,aaa) : new SimpleEntry<>(a,aaa);
invalidPairs.add(entry);
for(int k=0;k(a,aaaa) : new SimpleEntry<>(a,aaaa);
invalidPairs.add(entry);
}
}
}
}
for(int i=0;i entry =new SimpleEntry<>(i,j);
if(invalidPairs.contains(entry))
continue;
else
ligAtomPairs.add(new int[] {i,j});
}
}
}
@Override
public double getFGValue(double[] grad) {
double energy = 0.0;
for(PotentialEnergyTerm term : strain) {
energy+=term.getFGValue(grad);
}
return energy;
}
}