Re: [Rdkit-discuss] Check for Heavy Isotopes using RdKit
Then I guess Greg’s solution is the better suited one since you don’t have to specify a list of isotopes (assuming that your input compounds will not have things like 12C specified). Minor modification: In [23]: q = rdqueries.IsotopeGreaterQueryAtom(1) In [24]: atomNums = [1,6,7,8,15,16] In [25]: [x.GetIdx() for x in Chem.MolFromSmiles('CCC[13CH3]').GetAtomsMatchingQuery(q) if x.GetAtomicNum() in atomNums] Out[25]: [3] In [26]: [x.GetIdx() for x in Chem.MolFromSmiles('CCC[19F]').GetAtomsMatchingQuery(q) if x.GetAtomicNum() in atomNums] Out[26]: [] From: Milinda Samaraweera <milindaatw...@gmail.com> Date: Wednesday 18 January 2017 at 23:01 To: Bob Funchess <bfunch...@kelaroo.com> Cc: RDKit Discuss <rdkit-discuss@lists.sourceforge.net>, Greg Landrum <greg.land...@gmail.com> Subject: Re: [Rdkit-discuss] Check for Heavy Isotopes using RdKit Hi Bob, I am trying to filter out any compound that does not have the most stable isotopic form; (anything other than: 12C,1H,14N,16O, 31P, 32S) or to contain only MonoIsotopic compounds. Thanks, Milinda -- 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] Check for Heavy Isotopes using RdKit
Yes, most common should be the correct term. Thanks, Milinda On Wed, Jan 18, 2017 at 5:49 PM, Peter S. Shenkinwrote: > You say "most stable", but I think you mean "most common." 2H is as stable > as 1H, but less common. > > -P. > > On Wed, Jan 18, 2017 at 5:01 PM, Milinda Samaraweera < > milindaatw...@gmail.com> wrote: > >> Hi Bob, >> >> I am trying to filter out any compound that does not have the most stable >> isotopic form; (anything other than: 12C,1H,14N,16O, 31P, 32S) or to >> contain only MonoIsotopic compounds. >> >> Thanks, >> Milinda >> >> >> >> -- >> 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
Re: [Rdkit-discuss] Check for Heavy Isotopes using RdKit
You say "most stable", but I think you mean "most common." 2H is as stable as 1H, but less common. -P. On Wed, Jan 18, 2017 at 5:01 PM, Milinda Samaraweera < milindaatw...@gmail.com> wrote: > Hi Bob, > > I am trying to filter out any compound that does not have the most stable > isotopic form; (anything other than: 12C,1H,14N,16O, 31P, 32S) or to > contain only MonoIsotopic compounds. > > Thanks, > Milinda > > > > -- > 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] Check for Heavy Isotopes using RdKit
Hi Bob, I am trying to filter out any compound that does not have the most stable isotopic form; (anything other than: 12C,1H,14N,16O, 31P, 32S) or to contain only MonoIsotopic compounds. Thanks, Milinda -- 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] Check for Heavy Isotopes using RdKit
Hi Milinda, As an aside, most of the isotopes you listed are stable. The only nuclides in the list that are actually unstable are 14C, 3H, 24P and 46P. If your goal is to exclude isotopically enriched structures rather than radioactive ones, it might be better to just look for ANY isotopic specification, rather than for a specific list. Kind Regards, Bob -- Bob Funchess, Ph.D.Kelaroo, Inc Director of Software Support & Development www.kelaroo.com bfunch...@kelaroo.com (858) 259-7561 x3 *From:* Milinda Samaraweera [mailto:milindaatw...@gmail.com] *Sent:* Wednesday, January 18, 2017 11:48 AM *To:* Greg Landrum <greg.land...@gmail.com> *Cc:* RDKit Discuss <rdkit-discuss@lists.sourceforge.net> *Subject:* Re: [Rdkit-discuss] Check for Heavy Isotopes using RdKit 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
Re: [Rdkit-discuss] Check for Heavy Isotopes using RdKit
Hi Maybe this is much less efficient but I guess if you need it for specific isotopes then you could try using a smarts pattern and check for that? In [20]: q = Chem.MolFromSmarts("[13C,14C,2H,3H,15N,24P,46P,33S,34S,36S]") In [21]: m = Chem.MolFromSmiles('CC[15NH2]') In [22]: m.HasSubstructMatch(q) Out[22]: True So you could loop over your molecules and then remove the ones that match the smarts. Ciao Nik From: Milinda Samaraweera <milindaatw...@gmail.com> Date: Wednesday 18 January 2017 at 20:47 To: Greg Landrum <greg.land...@gmail.com> Cc: RDKit Discuss <rdkit-discuss@lists.sourceforge.net> Subject: Re: [Rdkit-discuss] Check for Heavy Isotopes using RdKit 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<mailto: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<mailto: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<mailto: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<mailto: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
Re: [Rdkit-discuss] Check for Heavy Isotopes using RdKit
Nik, That works too... Thanks Milinda On Wed, Jan 18, 2017 at 3:08 PM, Stiefl, Nikolaus < nikolaus.sti...@novartis.com> wrote: > Hi > > Maybe this is much less efficient but I guess if you need it for specific > isotopes then you could try using a smarts pattern and check for that? > > > > In [*20*]: q = Chem.MolFromSmarts("[13C,14C,2H,3H,15N,24P,46P,33S,34S,36S] > ") > > > > In [*21*]: m = Chem.MolFromSmiles('CC[15NH2]') > > > > In [*22*]: m.HasSubstructMatch(q) > > Out[*22*]: True > > > > > > So you could loop over your molecules and then remove the ones that match > the smarts. > > Ciao > > Nik > > > > > > *From: *Milinda Samaraweera <milindaatw...@gmail.com> > *Date: *Wednesday 18 January 2017 at 20:47 > *To: *Greg Landrum <greg.land...@gmail.com> > *Cc: *RDKit Discuss <rdkit-discuss@lists.sourceforge.net> > *Subject: *Re: [Rdkit-discuss] Check for Heavy Isotopes using RdKit > > > > 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 <(860)%20617-8046> > -- 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
Re: [Rdkit-discuss] Check for Heavy Isotopes using RdKit
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 Landrumwrote: > 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
Re: [Rdkit-discuss] Check for Heavy Isotopes using RdKit
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 > > -- 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] Check for Heavy Isotopes using RdKit
How about a regex filter on the all-atom SMILES? -P. On Wed, Jan 18, 2017 at 9:56 AM, 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 > > -- 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
[Rdkit-discuss] Check for Heavy Isotopes using RdKit
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