insertBondInOrder()

User 870ab5b546

12-05-2014 16:07:19

Hi, JChem 6.2 is deprecating the method MoleculeGraph.insertBond(), saying that it can lead to an inconsistent MoleculeGraph, and suggesting that we should use addBond() instead. I was using removeBond() to divide a Molecule into two SelectionMolecules, then restoring the bond with insertBond(). I don't want to use addBond() because I want to preserve the original order of the bonds. I see that there is a method MoleculeGraph.insertBondInOrder(MolBond, MolBond[]), but it is not clear to me at all what bonds should be in the array or how they specify where the bond of the first parameter is inserted. Can you explain?

ChemAxon d26931946c

16-05-2014 14:14:47

Hi Bob,


 


Unfortunately, MoleculeGraph.insertBondInOrder(MolBond, MolBond[]), is a function that we will deprecate too. Setting a bond into the middle of the molecule introduces problems in  case of embedded S-groups, so we decided to remove this functionality.


We may be able to provide a solution for you if you share us more details about your workflow.


 


Cheers,


Peter

User 870ab5b546

16-05-2014 18:46:32

Looking at my code, I think I can do without these methods. I was removing a bond from a Molecule so I could select one part of the Molecule, then restoring the bond that I removed, and then rotate the SelectionMolecule with respect to the rest of the molecule. But it looks like the code works just fine even if I add the deleted bond back at the end of the list of bonds instead of inserting it back into its original position.