Hi,
I'm trying to make a copy of a molecule to be processed, while keeping the
original intact.
I've found a suggestion from Noel[1]:

 myCopyMol = pybel.ob.OBMol(mol.OBMol)

but, as I suspected, this doesn't guarantee that the same internal structure
is conserved, in particular for what concerns bond id's (and atom id's, I
assume), as from the following code:

 b1 = mol.OBMol.GetBond(bondIndex)
 b2 = myCopyMol.GetBond(bondIndex)

 atomSet1 = set( b1.GetBeginAtomIdx(), b1.GetEndAtomIdx() )
 atomSet2 = set( b2.GetBeginAtomIdx(), b2.GetEndAtomIdx() ) 

 atomSet1 == atomSet2 # False

Is there a more robust method already available, or I should implement my
own to guarantee that properties I'm interested in are conserved?

Thanks!

Stefano


[1]
http://forums.openbabel.org/Loss-of-precision-when-copying-pybel-Molecule-tp4656097p4656098.html



--
View this message in context: 
http://forums.openbabel.org/Copy-molecule-Python-tp4657383.html
Sent from the General discussion mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to