GeometryPlugin plugin = new GeometryPlugin();
plugin.setCalculateForLEConformer("always");
plugin.setCalculateEnergy(true);
int start = stereoisomers.size() - 1;
System.out.println("specifyUnspecifiedConfigs: before energy check, "
+ "stereoisomers are " + Utils.printMolArrayList(stereoisomers));
for (int isomerNum = start; isomerNum >= 0; isomerNum--) {
try {
plugin.setMolecule(stereoisomers.get(isomerNum));
plugin.run();
double energy = plugin.getDreidingEnergy();
if (energy > MAX_DREIDING_ENERGY)
System.out.println("specifyUnspecifiedConfigs: removing "
+ stereoisomers.remove(isomerNum).toFormat("smiles")
+ " from list of stereoisomers due to strain of "
+ energy + ".");
else System.out.println("specifyUnspecifiedConfigs: "
+ stereoisomers.get(isomerNum).toFormat("smiles")
+ " has insufficient strain energy, " + energy
+ ", to be removed.");
} catch (PluginException e) {
System.out.println("MolFunctions.specifyUnspecifiedConfigs: "
+ "caught PluginException calculating energy of "
+ stereoisomers.get(isomerNum).toFormat("smiles")
+ "; continuing.");
} // try
} // for each stereoisomer
The output:
Code:
specifyUnspecifiedConfigs: [H]C1C[C@@H]2C[C@H]1c3ccccc3C2 has insufficient strain energy, 42.62, to be removed.
specifyUnspecifiedConfigs: [H]C1C[C@@H]2C[C@@H]1c3ccccc3C2 has insufficient strain energy, 42.62, to be removed.
specifyUnspecifiedConfigs: Cl[H] has insufficient strain energy, 0.0, to be removed.
I am concerned that [H]C1C[C@@H]2C[C@H]1c3ccccc3C2 and [H]C1C[C@@H]2C[C@@H]1c3ccccc3C2 are calculated to have the same Dreiding energy.
Zsolt
Joined: 11 Jan 2006
Posts: 525
ChemAxon personnel
Hi,
you could use the conformer API option to distinguish between them. However I wonder why the nonexistent (?) (R,S) has the lower energy in this example and the (S,S) with the more favorable strain energy has the high energy. I suspect an artefact. How could the (S,S) molecule not flip into the favorable position? I think the pure 2D view is misleading and if you view the molecule in Marvin as 3D view its better to understand, but I don't have time to include these right now.
Now the interesting part, if you change in MArvin view to 3D view it and calculate the name it will generate a different name (because it switched to the more favorable position (bug or feature, actually the tool should inform the user that the conformation changed). So actually on can use the stereoisomer generator to generate all 4 possible positions (R/S,R/R,S/S,S/R).
R/R switches to S/R - 134 kcal/mol ( different to last)
R/S switches to R/S - 40 kcal/mol
S/R switches to S/R - 40 kcal/mol
S/S switches to S/R - 140 kcal/mol (different to first)
The Dreiding and conformer energies for the lowest energy conformers in Marvin always(?) give different results. So its obvious that the Dreiding model can not handle that.
Hi,
you could use the conformer API option to distinguish between them.
According to Zsolt, the hasValidConformer() method uses dreidingEnergy. So your suggestion won't work.
Quote:
However I wonder why the nonexistent (?) (R,S) has the lower energy in this example and the (S,S) with the more favorable strain energy has the high energy. I suspect an artefact.
I suspect a bug. Configurations should not change when calculating conformational energies.
Quote:
How could the (S,S) molecule not flip into the favorable position? I think the pure 2D view is misleading and if you view the molecule in Marvin as 3D view its better to understand, but I don't have time to include these right now.
I have generated these diastereomers in a Java method, not in Marvin. I am trying to rule out the ones that are unreasonably strained. The method that calculates their energy in their lowest energy conformation should not be changing the configurations to make a more reasonable, unstrained compound. If it cannot arrive at a minimum-energy conformation without changing configurations, it should return the largest value for energy allowed.
public class createAllStereoIsomerLowEnergyConformers {
public static void main(String[] args) {
try {
// read input molecule - example [H]C1C[C@@H]2C[C@H]1c3ccccc3C2
String filename = "z:strain-energy-mol.smi";
MolImporter mi = new MolImporter(filename);
Molecule mol = mi.read();
mi.close();
//**** !!! important remove this if you read from a file
MolHandler mh = new MolHandler("[H]C1C[C@@H]2C[C@H]1c3ccccc3C2");
mol = mh.getMolecule();
//**** !!! end
// create plugin
StereoisomerPlugin plugin = new StereoisomerPlugin();
// set target molecule
plugin.setMolecule(mol);
//who knows ??
plugin.standardize(mol);
// set parameters for calculation
/* Sets which type of stereoiseomers should be generated. Available values:
* TETRAHEDRAL : tetrahedral stereoisomers are generated
* DOUBLE_BOND : double bond stereoisomers are generated
* BOTH : tetrahedral and double bond stereoisomers are generated (in fact tetrahedral stereoisomers of double bond stereoisomers are generated)
you need to create your own const as the parameter expects int
*/
plugin.setStereoisomerismType(1);
// if not set all stereoisomers are generated
plugin.setMaxNumberOfStereoisomers(2048);
//filter invalid stereos
plugin.setCheck3DStereo(true); // default: false
// Sets to display the molecule in 3D. false is default (if true currently wrong results)
plugin.setIn3D(false); // default: false
// run the calculation
plugin.run();
// get results
Molecule[] stereoisomers = plugin.getStereoisomers();
Molecule m;
int stereoisomerCount = plugin.getStereoisomerCount();
System.out.println(stereoisomerCount+" stereoisomers found from SMILES: "+mol.toFormat("smiles"));
// print all names first for comparison
for (int i = 0; i < stereoisomerCount; ++i)
{
m = stereoisomers[i];
System.out.println(m.toFormat("name")+"\t"+m.toFormat("cxsmiles"));
}
// do something with all the stereoisomers
for (int i = 0; i < stereoisomerCount; ++i)
{
// same as m = plugin.getStereoisomer(i);
m = stereoisomers[i];
String myName = m.toFormat("name");
// ***************** now start our big monolithic FORTRESS style conformer block
Molecule[] confs = null;
ConformerPlugin CPlugin = new ConformerPlugin();
CPlugin.setMolecule(m);
//number of conformers to be calculated
final int MAX_CONFORMERS = 1;
CPlugin.setMaxNumberOfConformers(MAX_CONFORMERS);
CPlugin.setPrehydrogenize(true);
CPlugin.setHyperfine(true);
//CPlugin.setOptimization(ConformerPlugin.OPTIMIZATION_STRICT);
CPlugin.setOptimization(ConformerPlugin.OPTIMIZATION_VERY_STRICT);
// we want the low energy conformers (set false if you want more)
CPlugin.setLowestEnergyConformerCalculation(true);
CPlugin.setTimelimit(3600);
for ( int j = 1; j < MAX_CONFORMERS+1;j++) {
CPlugin.setDiversity(0.1*j);
long startT = System.nanoTime();
CPlugin.run();
confs = CPlugin.getConformers();
long endT = System.nanoTime();
System.out.println("Diversity: "+0.1*j+" Time: "+(endT-startT)/1E9+" sec. *******************");
for (int k = 0; k < CPlugin.getConformerCount() ; k++) {
System.out.println(myName);
System.out.println("Lowest energy of stereoisomer " + i + ": " + confs[k].getProperty("Energy")+" kcal/mol");
// to check the SDfile property fields comment out the line below
// System.err.println(confs[k].toFormat("sdf"));
System.out.println(confs[k].toFormat("smiles"));
}
// ***************** END of our big monolithic FORTRESS style conformer block
}
}
} catch (MolFormatException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (PluginException e) {
e.printStackTrace();
}
}
}
Hi,
I think the conformer generation works pretty well,
here are some results with PM6 from Mopac2007 (this link also contains datasets for comparisons) other
stuff can be downloaded from the CCCBDB from NIST:
which is in accordance with the energies from the lowest conformer.
I attached the source an outputs were the last file had problems with PM6 (bond broken) so I had to do an PM3 computation first. Actually the PM6 computation
is quite fast, so it would be easy to do a quick Marvin conformer calculation and send then everything to PM6 (at least for small molecules)
This seems to be a bug, thank you for reporting. We are going to fix it ASAP. The reason is that the second structure is invalid but the buildup process does not detect that correctly.
Best wishes,
Ödön
bobgr wrote:
Hello,
The code:
Code:
GeometryPlugin plugin = new GeometryPlugin();
plugin.setCalculateForLEConformer("always");
plugin.setCalculateEnergy(true);
int start = stereoisomers.size() - 1;
System.out.println("specifyUnspecifiedConfigs: before energy check, "
+ "stereoisomers are " + Utils.printMolArrayList(stereoisomers));
for (int isomerNum = start; isomerNum >= 0; isomerNum--) {
try {
plugin.setMolecule(stereoisomers.get(isomerNum));
plugin.run();
double energy = plugin.getDreidingEnergy();
if (energy > MAX_DREIDING_ENERGY)
System.out.println("specifyUnspecifiedConfigs: removing "
+ stereoisomers.remove(isomerNum).toFormat("smiles")
+ " from list of stereoisomers due to strain of "
+ energy + ".");
else System.out.println("specifyUnspecifiedConfigs: "
+ stereoisomers.get(isomerNum).toFormat("smiles")
+ " has insufficient strain energy, " + energy
+ ", to be removed.");
} catch (PluginException e) {
System.out.println("MolFunctions.specifyUnspecifiedConfigs: "
+ "caught PluginException calculating energy of "
+ stereoisomers.get(isomerNum).toFormat("smiles")
+ "; continuing.");
} // try
} // for each stereoisomer
The output:
Code:
specifyUnspecifiedConfigs: [H]C1C[C@@H]2C[C@H]1c3ccccc3C2 has insufficient strain energy, 42.62, to be removed.
specifyUnspecifiedConfigs: [H]C1C[C@@H]2C[C@@H]1c3ccccc3C2 has insufficient strain energy, 42.62, to be removed.
specifyUnspecifiedConfigs: Cl[H] has insufficient strain energy, 0.0, to be removed.
I am concerned that [H]C1C[C@@H]2C[C@H]1c3ccccc3C2 and [H]C1C[C@@H]2C[C@@H]1c3ccccc3C2 are calculated to have the same Dreiding energy.
Hi,
you could use the conformer API option to distinguish between them.
According to Zsolt, the hasValidConformer() method uses dreidingEnergy. So your suggestion won't work.
Hi,
why not? You compared the (S,R) and (R,R).
So they show a different energy.
Ah, I see you are using the StereoisomerPlugin, and you are using setCheck3DStereo to rule out impossibly strained isomers. But I don't want to use the StereoisomerPlugin in my method, because I only want to operate on stereocenters with unspecified configurations.
I tried using the ConformerPlugin.hasValidConformer(), and I got this result:
Quote:
specifyUnspecifiedConfigs: before reasonableness check, stereoisomers are {C1C[C@H]2CC[C@H]1C2.C3C[C@@H]4CC[C@H]3C4}
specifyUnspecifiedConfigs: C1C[C@@H]2CC[C@H]1C2 has a reasonable conformation.
No regular build due to fallback.
Clean failed.
C1C[C@H]2CC[C@H]1C2
specifyUnspecifiedConfigs: C1C[C@H]2CC[C@H]1C2 has a reasonable conformation.
The relevant code:
Code:
ConformerPlugin plugin = new ConformerPlugin();
System.out.println("specifyUnspecifiedConfigs: before reasonableness check, "
+ "stereoisomers are " + Utils.printMolArrayList(stereoisomers));
int start = stereoisomers.size() - 1;
for (isomerNum = start; isomerNum >= 0; isomerNum--) {
try {
plugin.setMolecule(stereoisomers.get(isomerNum));
plugin.run();
if (plugin.hasValidConformer())
System.out.println("specifyUnspecifiedConfigs: removing "
+ stereoisomers.remove(isomerNum).toFormat("smiles")
+ " from list of stereoisomers due to absence of "
+ "reasonable conformer.");
else System.out.println("specifyUnspecifiedConfigs: "
+ stereoisomers.get(isomerNum).toFormat("smiles")
+ " has a reasonable conformation.");
} catch (PluginException e) {
System.out.println("MolFunctions.specifyUnspecifiedConfigs: "
+ "caught PluginException calculating conformers of "
+ stereoisomers.get(isomerNum).toFormat("smiles")
+ "; continuing.");
} // try
} // for each stereoisomer
So it appears that Ödön's comment applies as well to ConformerPlugin.hasValidConformer() as it does to GeometryPlugin.getDreidingEnergy(). But it evidently does *not* apply to StereoisomerPlugin.run() when preceded by setCheck3DStereo(true).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum