Hi,

In DataStrucs there are CreateFrom* functions which do what you want,
although you'd have to pass numpy array to a string of ints. ''.join(array)
would probably be enough.

See
http://www.rdkit.org/Python_Docs/rdkit.DataStructs.cDataStructs-module.html#CreateFromBitString

----
Pozdrawiam,  |  Best regards,
Maciek Wójcikowski
mac...@wojcikowski.pl

2018-01-11 16:30 GMT+01:00 Michał Nowotka <mmm...@gmail.com>:

> Hi,
>
> Imagine I have two numpy arrays containing zeros and ones (or bools)
> effectively being fingerprints:
>
> np_1, np_2 = some_fingerprints_as_np_arrays()
>
> I want to convert them both to rdkit fingerprint objects so I can use
> DiceSimilarity:
>
> from rdkit import DataStructs
>
> # this won't work becuse of type incompatibility
> DataStructs.DiceSimilarity(np_1, np_2)
>
> In the http://www.rdkit.org/Python_Docs/rdkit.DataStructs.
> cDataStructs.ExplicitBitVect-class.html
> docs I can't find any constructor apart from FromBase64.
> Any hints?
>
> Cheers,
>
> Michał
>
> ------------------------------------------------------------
> ------------------
> 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