Hi again,

thank you for this efficient answer.

Just one question.
How would have it been possible for me to arrive at this answer
without your help?

Cheers,

Jean-Marc


Le 16/03/2016 17:25, Greg Landrum a écrit :
Hi Jean-Marc,

You use the molFileAlias property like this:


#-------------------
In [9]: m = Chem.MolFromSmiles('CCO')

In [10]: m.GetAtomWithIdx(0).SetProp('molFileAlias','alias 0')

In [11]: m.GetAtomWithIdx(2).SetProp('molFileAlias','the_oxygen')

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

     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 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
A    1
alias 0
A    3
the_oxygen
M  END
#-------------------

I hope this helps,
-greg


On Wed, Mar 16, 2016 at 8:23 AM, Jean-Marc Nuzillard <jm.nuzill...@univ-reims.fr <mailto:jm.nuzill...@univ-reims.fr>> wrote:

    Dear All,

    Is there a way, in Python,  to add an alias to an atom in a
    molecule so
    that is appears
    in an "A" line when the molecule is written in an SD file ?
    Searching the web, I found an atom attribute named molfileAlias
    but how do I practically set/get it?

    thanks,

    Jean-Marc

    --
    Jean-Marc Nuzillard
    Institut de Chimie Moléculaire de Reims
    CNRS UMR 7312
    Moulin de la Housse
    CPCBAI, Bâtiment 18
    BP 1039
    51687 REIMS Cedex 2
    France

    Tel : 03 26 91 82 10
    Fax : 03 26 91 31 66
    http://www.univ-reims.fr/ICMR

    http://www.univ-reims.fr/LSD/
    http://www.univ-reims.fr/LSD/JmnSoft/


    
------------------------------------------------------------------------------
    Transform Data into Opportunity.
    Accelerate data analysis in your applications with
    Intel Data Analytics Acceleration Library.
    Click to learn more.
    http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
    _______________________________________________
    Rdkit-discuss mailing list
    Rdkit-discuss@lists.sourceforge.net
    <mailto:Rdkit-discuss@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/rdkit-discuss




--
Jean-Marc Nuzillard
Institut de Chimie Moléculaire de Reims
CNRS UMR 7312
Moulin de la Housse
CPCBAI, Bâtiment 18
BP 1039
51687 REIMS Cedex 2
France

Tel : 03 26 91 82 10
Fax : 03 26 91 31 66
http://www.univ-reims.fr/ICMR

http://www.univ-reims.fr/LSD/
http://www.univ-reims.fr/LSD/JmnSoft/

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to