Dear Takayuki,
Thank you for your reply. What I want to do is to count substructures based
on fragments in MACCS key, not to count the number of types of fragments
that appear in a molecule. My temporary measure is to simply count the
substructures using `mol.GetSubstructMatches`. A sample code is here:
https://gist.github.com/sshojiro/c156c351fbc4e05e478a6acc1b7d4949
But, right now, 1: isotope, 125: aromatic ring, and 166: fragments are
ignored because their corresponding SMARTS are simply '?', which seems
incompatible with GetSubstructMatches.
If you know some alternative ways of implementation, it'd be so much help
if you let me know that. Thanks in advance!
Best regards,
Shojiro
On 4 August 2018 at 22:32, Taka Seri <[email protected]> wrote:
> Dear Shojiro,
>
> To count the number of on bits, you can use GetNumOnBits.
> http://www.rdkit.org/Python_Docs/rdkit.DataStructs.
> cDataStructs.ExplicitBitVect-class.html#GetNumOnBits
>
> from rdkit import Chem
>
> from rdkit.Chem import AllChem
>
> mol = Chem.MolFromSmiles('O1ccnccc1')
>
> maccsfp = AllChem.GetMACCSKeysFingerprint(mol)
>
> print(macsfp.GetNumOnBits())
>
> # output is 16
>
>
> Kind regards,
>
> Takayuki
>
> 2018年8月4日(土) 17:14 Shojiro Shibayama <[email protected]>:
>
>> Hi, community members,
>>
>> I'm looking for a way to count all fragments that I give for some
>> quantitative analysis. I want the count data based on e.g. MACCS key's
>> fragments instead of MACCS key 0/1 descriptor itself. Could anyone please
>> help me with this? Thanks in advance.
>>
>> Sincerely,
>> Shojiro
>> ------------------------------------------------------------
>> ------------------
>> 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
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
>
--
----
The University of Tokyo
2nd year Ph.D. candidate
Shojiro Shibayama
----
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss