This is the easiest way.

python -c "import json,gzip,pickle; print
json.dumps(pickle.load(gzip.open('publicnp.model.gz', 'rb')))"  >
publicnp.model.json

Modify as appropriate for the other file.

-David

On Sun, Sep 6, 2015 at 11:48 AM, Guillaume GODIN <
[email protected]> wrote:

> Dear Nicholas,
>
> We need to have access rawData in javascript directly from gz files but
> the python pickle.load function has no equivalent in javascript as far as
> I know.
>
> So I need to find a way either to read the file in JS or to extract those
> data into json format or binary json.
>
> Best regards,
>
> *Dr. Guillaume GODIN*
>
> Project Manager
>
> Innovation
>
> CORPORATE R&D DIVISION
>
> DIRECT LINE +41 (0)22 780 3645
>
> MOBILE       +41 (0)79 536 1039
>
> *Firmenich SA*
>
> RUE DES JEUNES 1 | CASE POSTALE 239 | CH-1211 GENEVE 8
>
> ------------------------------
> *De :* Nicholas Firth [[email protected]]
> *Envoyé :* dimanche, 6. septembre 2015 15:59
> *À :* Guillaume GODIN
> *Cc :* [email protected]
> *Objet :* Re: [Rdkit-discuss] NP-score and SA-score datas
>
> Dear Guillaume,
>
> This is a one liner in Python, the model is saved as a Python dictionary
> in the case of the NP model and I believe the SA score is a Python list.
> Probably best you work out what you want to do with it rather than have
> multiple versions of such large files packaged with the source.
>
> >>> import gzip, pickle
> >>> rawData = pickle.load(gzip.open('publicnp.model.gz', 'rb'))
>
> Best,
> Nick
>
> *Nicholas C. Firth* | PhD Student | Cancer Therapeutics
> The Institute of Cancer Research | 15 Cotswold Road | Belmont | Sutton |
> Surrey | SM2 5NG
>
> *T* 020 8722 4033 | *E* [email protected] | *W* www.icr.ac.uk |
> *Twitter* @ICRnews <https://twitter.com/ICRnews>
>
> *Facebook* www.facebook.com/theinstituteofcancerresearch
>
> *Making the discoveries that defeat cancer*
>
>
> On 6 Sep 2015, at 14:52, Guillaume GODIN <[email protected]>
> wrote:
>
> Dear all,
>
> I need the original unpickle data for javascript to implement those two
> descriptor in RDKitjs.
>
> Can you provide publicnp.model.gz fpscores.pkl.gz uncompressed files
> please ?
>
> thanks in advance
>
> Best regards,
>
> *Dr. Guillaume GODIN*
>
> Project Manager
>
> Innovation
>
> CORPORATE R&D DIVISION
>
> DIRECT LINE +41 (0)22 780 3645
>
> MOBILE       +41 (0)79 536 1039
>
> *Firmenich SA*
>
> RUE DES JEUNES 1 | CASE POSTALE 239 | CH-1211 GENEVE 8
>
>
> **********************************************************************
> DISCLAIMER
> This email and any files transmitted with it, including replies and
> forwarded copies (which may contain alterations) subsequently transmitted
> from Firmenich, are confidential and solely for the use of the intended
> recipient. The contents do not represent the opinion of Firmenich except to
> the extent that it relates to their official business.
> **********************************************************************
> ------------------------------------------------------------------------------
> _______________________________________________
> Rdkit-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
> The Institute of Cancer Research: Royal Cancer Hospital, a charitable
> Company Limited by Guarantee, Registered in England under Company No.
> 534147 with its Registered Office at 123 Old Brompton Road, London SW7 3RP.
>
> This e-mail message is confidential and for use by the addressee only. If
> the message is received by anyone other than the addressee, please return
> the message to the sender by replying to it and then delete the message
> from your computer and network.
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Rdkit-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
------------------------------------------------------------------------------
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to