Dear All
I am using CDK to create a tool (Java GUI) for editing molecules. To start
with I am considering linear alkanes. I will describe my problem briefly.
I have an IAtomcontainer with *Heptane(H) *molecule loaded into it (all
atoms and bonds are connected)
I* removed atoms 3,4,5* from the container and the bonds connecting them.
So now I have two fragments of ethane(*atom1 - atom2 connected *similarly*
atom6-atom7 connected*) in the atom container.
I have another IAtomcontainer with *Propane(P)* (say with *atom numbers 8,
9, 10*) loaded into it (again all atoms and bonds are connected )
I added the propane Iatomcontainer to the heptane Iatomcontaner. Then I
added a bond between (atom2(H) -atom8(P)) and (atom6(H)-atom10(P)) and
created a new molecule called NewHeptane.
When I tried creating a 3d model of the NewHeptane using model3dbuilder I
get an exception
*org.openscience.cdk.exception.NoSuchAtomTypeException: Atom is unkown:
Symbol:C does not MATCH AtomType. HoseCode:C-5;CC(C,C/C,/)*
By the way, I checked with
AtomContainerManipulator.perceiveatomsandconfigure() and all atoms in the
NewHeptane Iatomcontainer has C.Sp3 hybridized.
*Below is the code*
//add propane to heptane
NewHeptane.add(Propane)
//adding bonds
NewHeptane.addBond(2,8,IBond.Order.Single)
NewHeptane.addBond(6,10, IBond.Order.Single)
//Generate smiles
SmilesGenerator sg = SmilesGenerator.absolute();
String smi = sg.create(NewHeptane);
//Parse smiles
SmilesParser sp = new SmilesParser(SilentChemObjectBuilder.getInstance());
IAtomContainer m = sp.parseSmiles(smi);
// Build 3d model
ModelBuilder3D builder3d = ModelBuilder3D.getInstance(m.getBuilder());
IAtomContainer newHeptane = builder3d.generate3DCoordinates(m, false);
Any suggestion in the right direction is highly appreciated. Thank you.
--
Regards
Vinothkumar Mohanakrishnan
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user