(CC'ing the list as I hadn't in my original reply)

Dear Janusz,

this is what I would do:

>>> from rdkit import Chem
>>> mol = Chem.MolFromSmiles('SSC')
>>> print Chem.MolToSmiles(mol)
CSS
>>> print Chem.MolToSmiles(mol, allHsExplicit=True)
[CH3][S][SH]
>>> a = mol.GetAtomWithIdx(1)
>>> print (a.GetTotalValence())
2
>>> desiredValence = 4
>>> a.SetNumExplicitHs(desiredValence -     a.GetTotalValence())
>>> a.UpdatePropertyCache()
>>> print (a.GetTotalValence())
4
>>> print Chem.MolToSmiles(mol, allHsExplicit=True)
[CH3][SH2][SH]

Cheers,
p.

> On 06/20/17 15:37, Janusz Petkowski wrote:
> Dear RDKit Community,
> 
> I have a quick question regarding a possibility of setting valence of an atom 
> in rdkit. 
> 
> Let's say that I have a molecule like this (smiles notation): PPC or SSC and 
> I would like to change the valence of one or more S or P atoms from default 
> II for S or III for P to let's say SIV or SVI and PV. As a result I would 
> like to have the following molecules (as an example): [H][SH3](C)[SH5], 
> [H][SH2]SC, [H][SH3](C)[SH3] or [H][PH3]PC, [H][PH3][PH3]C
> 
> Is it possible to output such molecules using SSC or PPC molecules as inputs, 
> using one of rdkit methods (modules)?
> 
> Thank you very much for your help,
> 
> Best regards,
> 
> Dr Janusz Petkowski
> Research Fellow at MIT EAPS
> Tel:  +1 (617) 258 - 6910
> 
> 
> ------------------------------------------------------------------------------
> 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

Reply via email to