Re: [Rdkit-discuss] elimination of small fragments
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: Paolo T. <pao...@gm...> - 2018-06-28 20:09:00
|
Dear Alfredo,
if you wish to keep only the largest disconnected fragment you may try
the following:
mols = list(rdmolops.GetMolFrags(mol, asMols = True))
if (mols):
mols.sort(reverse = True, key = lambda m: m.GetNumAtoms())
mol = mols[0]
Hope that helps, cheers
p.
On 06/28/18 19:38, Alfredo Quevedo wrote:
> Good afternoon,
>
> I would like to filter out small fragments from a list of molecules
> using the below strategy:
>
> from rdkit import Chem
> from rdkit.Chem import AllChem
> from rdkit.Chem import SaltRemover fragment
>
> remover=SaltRemover.SaltRemover()
> mol=Chem.MolFromSmiles('CCC.CC')
> res=remover.StripMol(mol)
> print(res.GetNumAtoms())
>
>
> I am getting 5 atoms as output, so the ´CC´ is not being stripped (the
> script workd ok for salts). Is there any way of filtering non salts
> small fragments?
>
> thank you very much in advance,
>
> regards,
>
> Alfredo
>
>
>
>
>
>
> ------------------------------------------------------------------------------
>
> 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
> Rdk...@li...
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
|