User b60e1d3756
21-04-2010 13:37:58
Hello,
I want to create a new field in my database that will count the number of chiral bonds on the molecules. I tried to use stereoDoubleBondCount(), but I dont understand how it works.
My question is how to calculate only those bonds that are defined as "up" or "down" in the molecule.
bets wishes,
Albina
ChemAxon e08c317633
22-04-2010 11:31:16
Hi Albina,
I don't really understand what do you mean by "chiral bond", and how "chiral bonds" are connected to "stereoDoubleBondCount()", but here is a code example that calculates up and down bonds:
Molecule mol = MolImporter.importMol("C[C@H](O)C\\C=C/C=CCC[C@H](Cl)Br");
mol.clean(2, null);
int upAndDownBondCount = 0;
for (MolBond bond : mol.getBondArray()) {
upAndDownBondCount += (((bond.getFlags() & MolBond.STEREO1_MASK) == MolBond.UP)
|| ((bond.getFlags() & MolBond.STEREO1_MASK) == MolBond.DOWN)) ? 1 : 0;
}
Note: in general, the number of up and down bonds does not provide information about how many chiral centers are in the molecule.
Zsolt
User b60e1d3756
26-04-2010 09:21:37
Thank you very much for the answer!
I exactly need number of up and down bonds, but not chiral centers.
I want to count them directly in Cartrdige, when adding a new Chemical Terms Field to a table, but not through the API functions.
Sorry if I sometimes explain vaguely.
Albina
ChemAxon d76e6e95eb
26-04-2010 11:50:45
Please fill your forum registration with real personal information, that is a condition for our support. Thank you for your understanding.
ChemAxon e08c317633
26-04-2010 11:54:49
There is no Chemical Terms function for calculating up and down bonds.
Note: Up and down bonds are only represented in 2D. If the structures are imported to database without 2D coordinates and wedges (e.g. from SMILES), then they will not contain any up or down bonds.
Zsolt
User b60e1d3756
27-04-2010 09:27:25
Hello,
Thank you for the answers.
If about profile was to me, I filled all necessary fields. I only set that the users cannot see it.
With the best wishes,
Albina
User b60e1d3756
27-04-2010 14:57:42
Hello,
it is said that clean recalculates the coordinates. why is it necessary when counting Up and Down bonds? because I get the exception:
java.lang.ArrayIndexOutOfBoundsException: -1
at chemaxon.marvin.modules.Clean2D.fillCoordinates(Clean2D.java:13710)
at chemaxon.marvin.modules.Clean2D.refineLongestChainInternalAngles(Clean2D.java:7398)
at chemaxon.marvin.modules.Clean2D.fixLongestChainInternalAngleToTrans(Clean2D.java:7377)
at chemaxon.marvin.modules.Clean2D.calcInitialGeometry(Clean2D.java:1397)
at chemaxon.marvin.modules.Clean2D.cleanFragment(Clean2D.java:1002)
at chemaxon.marvin.modules.Clean2D.cleanMoleculeStructure(Clean2D.java:786)
at chemaxon.marvin.modules.Clean2D.modfunc(Clean2D.java:592)
at chemaxon.struc.MoleculeGraph.clean(MoleculeGraph.java:3795)
at chemaxon.struc.Molecule.clean(Molecule.java:693)
at chemaxon.struc.MoleculeGraph.clean(MoleculeGraph.java:3638)
at ChemicalProperties.main(ChemicalProperties.java:73)
Albina