Re: [Rdkit-discuss] SetAtomAlias

2016-12-17 Thread Jean-Marc Nuzillard

Sure. I still work with version 2016.03.1.
I will update my installation and try what you suggest.

All the best,

Jean-Marc

Le 17/12/2016 à 14:25, Peter Gedeck a écrit :

Hello

I tried it with the master branch. The function was added August 10, 
so maybe too late for the current release. That commit added functions 
to get/set atom specific MDL features (RLabel, atom alias, atom value).


Best

Peter
On Sat, Dec 17, 2016 at 7:47 AM Jean-Marc Nuzillard 
> wrote:


Dear Peter,

I got:

AttributeError: 'module' object has no attribute 'SetAtomAlias'

with your example code, below.

Best regards,

Jean-Marc


Le 17/12/2016 à 00:44, Peter Gedeck a écrit :

Hello,

SetMolAlias is available in Python as a function and not as an
Atom method:

from rdkit import Chem
import sys
m = Chem.MolFromSmiles('CCC')
for i, atom in enumerate(m.GetAtoms()):
  Chem.SetAtomAlias(atom, 'C' + str(i + 1))
 w = Chem.SDWriter(sys.stdout)
 w.write(m)
 w.close()

Best,

Peter


On Fri, Dec 16, 2016 at 5:31 PM Paolo Tosco > wrote:

Dear Jean-Marc,

here:


https://gist.github.com/ptosco/6e4468350f0fff183e4507ef24f092a1#file-pdb_atom_names-ipynb


there's an example how to use the atom aliases in RDKit.

Cheers,
p.


On 12/16/2016 10:26 PM, Jean-Marc Nuzillard wrote:
> Hi all,
>
> I try add labels to atoms in a molecule, so that lines like
>
> A1
> C12
> A2
> C3
>
> are written when the molecule is written in a SD file.
>
> Considering atom a and alias text txt,
> I expected the function call SetAtomAlias(a, txt) to do the
job.
> I found this function in a documentation page about the
rdchem module.
> So, my script started with
>
> from rdkit import Chem
> from rdkit.Chem import rdchem
>
> I got:
>
> NameError: name 'SetAtomAlias' is not defined.
>
> I guess the solution is trivial.
> Forgive my ignorance.
>
> All the best,
>
> Jean-Marc
>



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Rdkit-discuss mailing list
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/




--
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/

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] SetAtomAlias

2016-12-17 Thread Peter Gedeck
Hello

I tried it with the master branch. The function was added August 10, so
maybe too late for the current release. That commit added functions to
get/set atom specific MDL features (RLabel, atom alias, atom value).

Best

Peter
On Sat, Dec 17, 2016 at 7:47 AM Jean-Marc Nuzillard <
jm.nuzill...@univ-reims.fr> wrote:

> Dear Peter,
>
> I got:
>
> AttributeError: 'module' object has no attribute 'SetAtomAlias'
>
> with your example code, below.
>
> Best regards,
>
> Jean-Marc
>
>
> Le 17/12/2016 à 00:44, Peter Gedeck a écrit :
>
> Hello,
>
> SetMolAlias is available in Python as a function and not as an Atom method:
>
> from rdkit import Chem
> import sys
> m = Chem.MolFromSmiles('CCC')
> for i, atom in enumerate(m.GetAtoms()):
>   Chem.SetAtomAlias(atom, 'C' + str(i + 1))
>  w = Chem.SDWriter(sys.stdout)
>  w.write(m)
>  w.close()
>
> Best,
>
> Peter
>
>
> On Fri, Dec 16, 2016 at 5:31 PM Paolo Tosco  wrote:
>
> Dear Jean-Marc,
>
> here:
>
>
> https://gist.github.com/ptosco/6e4468350f0fff183e4507ef24f092a1#file-pdb_atom_names-ipynb
>
>
> there's an example how to use the atom aliases in RDKit.
>
> Cheers,
> p.
>
>
> On 12/16/2016 10:26 PM, Jean-Marc Nuzillard wrote:
> > Hi all,
> >
> > I try add labels to atoms in a molecule, so that lines like
> >
> > A1
> > C12
> > A2
> > C3
> >
> > are written when the molecule is written in a SD file.
> >
> > Considering atom a and alias text txt,
> > I expected the function call SetAtomAlias(a, txt) to do the job.
> > I found this function in a documentation page about the rdchem module.
> > So, my script started with
> >
> > from rdkit import Chem
> > from rdkit.Chem import rdchem
> >
> > I got:
> >
> > NameError: name 'SetAtomAlias' is not defined.
> >
> > I guess the solution is trivial.
> > Forgive my ignorance.
> >
> > All the best,
> >
> > Jean-Marc
> >
>
>
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Rdkit-discuss mailing list
> 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 66http://www.univ-reims.fr/ICMR
> http://www.univ-reims.fr/LSD/http://www.univ-reims.fr/LSD/JmnSoft/
>
>
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] SetAtomAlias

2016-12-17 Thread Jean-Marc Nuzillard

Dear Peter,

I got:

AttributeError: 'module' object has no attribute 'SetAtomAlias'

with your example code, below.

Best regards,

Jean-Marc

Le 17/12/2016 à 00:44, Peter Gedeck a écrit :

Hello,

SetMolAlias is available in Python as a function and not as an Atom 
method:


from rdkit import Chem
import sys
m = Chem.MolFromSmiles('CCC')
for i, atom in enumerate(m.GetAtoms()):
  Chem.SetAtomAlias(atom, 'C' + str(i + 1))
 w = Chem.SDWriter(sys.stdout)
 w.write(m)
 w.close()

Best,

Peter


On Fri, Dec 16, 2016 at 5:31 PM Paolo Tosco > wrote:


Dear Jean-Marc,

here:


https://gist.github.com/ptosco/6e4468350f0fff183e4507ef24f092a1#file-pdb_atom_names-ipynb


there's an example how to use the atom aliases in RDKit.

Cheers,
p.


On 12/16/2016 10:26 PM, Jean-Marc Nuzillard wrote:
> Hi all,
>
> I try add labels to atoms in a molecule, so that lines like
>
> A1
> C12
> A2
> C3
>
> are written when the molecule is written in a SD file.
>
> Considering atom a and alias text txt,
> I expected the function call SetAtomAlias(a, txt) to do the job.
> I found this function in a documentation page about the rdchem
module.
> So, my script started with
>
> from rdkit import Chem
> from rdkit.Chem import rdchem
>
> I got:
>
> NameError: name 'SetAtomAlias' is not defined.
>
> I guess the solution is trivial.
> Forgive my ignorance.
>
> All the best,
>
> Jean-Marc
>



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Rdkit-discuss mailing list
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/

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] SetAtomAlias

2016-12-17 Thread Jean-Marc Nuzillard
Dear Paolo,

Many thanks,
Your solution works.
The key point is to considered an Alias as an atom property:

for i, atom in enumerate(m.GetAtoms()):
 atom.SetProp('molFileAlias', 'C' + str(i + 1))


All the best,

Jean-Marc


Le 16/12/2016 à 23:30, Paolo Tosco a écrit :
> Dear Jean-Marc,
>
> here:
>
> https://gist.github.com/ptosco/6e4468350f0fff183e4507ef24f092a1#file-pdb_atom_names-ipynb
>  
>
>
> there's an example how to use the atom aliases in RDKit.
>
> Cheers,
> p.
>
>
> On 12/16/2016 10:26 PM, Jean-Marc Nuzillard wrote:
>> Hi all,
>>
>> I try add labels to atoms in a molecule, so that lines like
>>
>> A1
>> C12
>> A2
>> C3
>>
>> are written when the molecule is written in a SD file.
>>
>> Considering atom a and alias text txt,
>> I expected the function call SetAtomAlias(a, txt) to do the job.
>> I found this function in a documentation page about the rdchem module.
>> So, my script started with
>>
>> from rdkit import Chem
>> from rdkit.Chem import rdchem
>>
>> I got:
>>
>> NameError: name 'SetAtomAlias' is not defined.
>>
>> I guess the solution is trivial.
>> Forgive my ignorance.
>>
>> All the best,
>>
>> 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/


--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] SetAtomAlias

2016-12-16 Thread Peter Gedeck
Hello,

SetMolAlias is available in Python as a function and not as an Atom method:

from rdkit import Chem
import sys
m = Chem.MolFromSmiles('CCC')
for i, atom in enumerate(m.GetAtoms()):
  Chem.SetAtomAlias(atom, 'C' + str(i + 1))
 w = Chem.SDWriter(sys.stdout)
 w.write(m)
 w.close()

Best,

Peter


On Fri, Dec 16, 2016 at 5:31 PM Paolo Tosco  wrote:

> Dear Jean-Marc,
>
> here:
>
>
> https://gist.github.com/ptosco/6e4468350f0fff183e4507ef24f092a1#file-pdb_atom_names-ipynb
>
>
> there's an example how to use the atom aliases in RDKit.
>
> Cheers,
> p.
>
>
> On 12/16/2016 10:26 PM, Jean-Marc Nuzillard wrote:
> > Hi all,
> >
> > I try add labels to atoms in a molecule, so that lines like
> >
> > A1
> > C12
> > A2
> > C3
> >
> > are written when the molecule is written in a SD file.
> >
> > Considering atom a and alias text txt,
> > I expected the function call SetAtomAlias(a, txt) to do the job.
> > I found this function in a documentation page about the rdchem module.
> > So, my script started with
> >
> > from rdkit import Chem
> > from rdkit.Chem import rdchem
> >
> > I got:
> >
> > NameError: name 'SetAtomAlias' is not defined.
> >
> > I guess the solution is trivial.
> > Forgive my ignorance.
> >
> > All the best,
> >
> > Jean-Marc
> >
>
>
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] SetAtomAlias

2016-12-16 Thread Paolo Tosco
Dear Jean-Marc,

here:

https://gist.github.com/ptosco/6e4468350f0fff183e4507ef24f092a1#file-pdb_atom_names-ipynb
 


there's an example how to use the atom aliases in RDKit.

Cheers,
p.


On 12/16/2016 10:26 PM, Jean-Marc Nuzillard wrote:
> Hi all,
>
> I try add labels to atoms in a molecule, so that lines like
>
> A1
> C12
> A2
> C3
>
> are written when the molecule is written in a SD file.
>
> Considering atom a and alias text txt,
> I expected the function call SetAtomAlias(a, txt) to do the job.
> I found this function in a documentation page about the rdchem module.
> So, my script started with
>
> from rdkit import Chem
> from rdkit.Chem import rdchem
>
> I got:
>
> NameError: name 'SetAtomAlias' is not defined.
>
> I guess the solution is trivial.
> Forgive my ignorance.
>
> All the best,
>
> Jean-Marc
>


--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss