Dear Michal,

On Thu, Nov 7, 2013 at 12:46 PM, Michal Krompiec
<michal.kromp...@gmail.com>wrote:

> Hello again,
> I browsed through the sources and I found the answer to my question:
> the atom at index 0 from the replacement is used for the new bond. It
> would be nice to be able to specify the index of this bonding atom as
> a parameter in AllChem.ReplaceSubstructs.
>
> Is it possible to reorder atoms in a molecule (i.e. to have a chosen
> atom at index 0)?
>

Indeed there is, the functionality was added at the last minute to the
2013.09 release.

Here's how you use it:

In [2]: m = Chem.MolFromSmiles('NCO')

In [3]: print Chem.MolToMolBlock(m)

     RDKit

  3  2  0  0  0  0  0  0  0  0999 V2000
    0.0000    0.0000    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  1  0
  2  3  1  0
M  END


In [4]: m2 = Chem.RenumberAtoms(m,(1,2,0))

In [5]: print Chem.MolToMolBlock(m2)

     RDKit

  3  2  0  0  0  0  0  0  0  0999 V2000
    0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
  3  1  1  0
  1  2  1  0
M  END
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to