Greg,

I am looking to remove entries that contain un-stable isotopes of elements
CHNOPS (e.g. heavy_isotopes =['13C', '14C', '2H', '3H', '15N', '24P',
'46P', '33S', '34S', '36S'] ). Is there a way to modify the above code to
achieve that?

Thanks,
Milinda



On Wed, Jan 18, 2017 at 11:16 AM, Greg Landrum <greg.land...@gmail.com>
wrote:

> Hi Milinda,
>
> Here's an approach that finds all the atoms that have an isotope specified:
>
> In [1]: from rdkit import Chem
>
> In [2]: from rdkit.Chem import rdqueries
>
> In [3]: q = rdqueries.IsotopeGreaterQueryAtom(1)
>
> In [7]: list(x.GetIdx() for x in Chem.MolFromSmiles('CC[13CH3]'
> ).GetAtomsMatchingQuery(q))
> Out[7]: [2]
>
> In [8]: list(x.GetIdx() for x in Chem.MolFromSmiles('[12CH3]CC[13CH3]').
> GetAtomsMatchingQuery(q))
> Out[8]: [0, 3]
>
> Does that do what you want it to do?
>
> -greg
>
>
>
> On Wed, Jan 18, 2017 at 3:56 PM, Milinda Samaraweera <
> milindaatw...@gmail.com> wrote:
>
>> Dear Experts,
>>
>> I am trying to figure out a way to exclude entries which contain heavy
>> atoms (13C, 2H, 3H, etc), from a SD file (which has close to two thousand
>> entries) and write an updated file with the remaining entries.
>>
>> I do understand how to read/write SD files using rdkit.
>>
>> What I do understand is how to detect entries with heavy isotopes: Is
>> there an efficient and correct way of achieving this using rdkit?
>>
>> thanks,
>> --
>> Milinda Samaraweera
>>
>> ------------------------------------------------------------
>> ------------------
>> 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
>>
>>
>


-- 
Milinda Samaraweera, Ph.D.
Postdoctoral Fellow, Department of Pharmacy
University of Connecticut
69 North Eagleville road
Storrs, CT, 06269
milindaatw...@gmail.com
860-617-8046
------------------------------------------------------------------------------
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