Git Product home page Git Product logo

coconut's Introduction

Compiler for the COlleCtion of Open NatUral producTs (COCONUT)

This compiles is designed to read molecules from various file types (SMILES, SDF, MOL, csv, tsv), check them for errors and connectivity, compute a large number of molecular parameters and properties, and store everything in a Mongo database. Unless you want to modify the code, we recomment using the compiled JAR that can be downloaded here: https://zenodo.org/record/3695455

System pre-requisites:

  • MongoDB installed and accessible by the default (27017) port on localhost
  • Java minimum 8 version installed

Load COCONUT

You can download the latest version COCONUT from ZENODO (https://zenodo.org/record/3688734). In case you want to explore the whole database in MongoDB, you can load the downloaded dataset dump as following:

unzip COCONUT2020-07.zip
cd COCONUT2020-07/COCONUT2020-07/
mongorestore --db=COCONUT --noIndexRestore .

Note that for system compatibilities reason, it is better to restore the database without the indexes (hence the "noIndexRestore" option). However, seen the size of the dataset, we suggest to add the indexes as following:

mongo
use COCONUT2020-07


 db.sourceNaturalProduct.createIndex( {source:1})

 db.sourceNaturalProduct.createIndex( {simpleInchi:"hashed"})

 db.sourceNaturalProduct.createIndex( {simpleInchiKey:1})
 db.sourceNaturalProduct.createIndex( {originalInchiKey:1})
 db.sourceNaturalProduct.createIndex( {originalSmiles:"hashed"})
 db.sourceNaturalProduct.createIndex( {absoluteSmiles:"hashed"})
 db.sourceNaturalProduct.createIndex( {idInSource:1})


db.uniqueNaturalProduct.createIndex( {inchi:"hashed"})
db.uniqueNaturalProduct.createIndex( {inchikey:1})
db.uniqueNaturalProduct.createIndex( {clean_smiles: "hashed"})
db.uniqueNaturalProduct.createIndex( {molecular_formula:1})
db.uniqueNaturalProduct.createIndex( {coconut_id:1})
db.uniqueNaturalProduct.createIndex( {fragmentsWithSugar:"hashed"})
db.uniqueNaturalProduct.createIndex( {fragments:"hashed"})
db.uniqueNaturalProduct.createIndex( {annotationLevel:1})
db.uniqueNaturalProduct.createIndex( {synonyms:"text", name:"text"})
db.uniqueNaturalProduct.createIndex( {npl_score:1})

db.uniqueNaturalProduct.createIndex( { pubchemBits : "hashed" } )

db.uniqueNaturalProduct.createIndex( {unique_smiles: "hashed"})

db.uniqueNaturalProduct.createIndex( { "pfCounts.bits" :1} )
db.uniqueNaturalProduct.createIndex( { "pfCounts.count" : 1 })


db.fragment.createIndex({signature:1})
db.fragment.createIndex({signature:1, withsugar:-1})



Required folder structure

COCONUT
├── coconut-0.0.1-SNAPSHOT.jar # the compiled jar. It can be downloaded from ZENODO: https://zenodo.org/record/3695455
├── coconut_ids_june2020.csv
├── data # here go the files with NP molecular structures
├── UpdateCOCONUT
│   ├── COCONUTupdater.py
│   ├── VerifyNames.py
├── fragments
│   ├── fragment_without_sugar.txt
│   ├── fragment_with_sugar.txt
├── sm # file(s) with structures of synthetic molecules 

Execution options

Run COCONUT compilation from scratch
java -Xmx16288m -jar coconut-0.0.1-SNAPSHOT.jar data sm/sm.tsv fragments/fragment_without_sugar.txt fragments/fragment_with_sugar.txt importCOCONUTids coconut_ids_june2020.csv > logs.txt &
Re-run COCONUT to recompute missing molecular features
java -jar coconut-0.0.1-SNAPSHOT.jar recomputeMissing &
Run only similarity calculation

The provided script also computes similatiry between molecules in COCONUT. This step requires a large amount of memory (this will be optimized in the future) and might need a separate calculation.

java -Xmx12288m -jar coconut-0.0.1-SNAPSHOT.jar runOnlySimilarity &
Run only addition of synthetic molecules

Synthetic molecules (SM) are required for a large number of comparisons with NPs (for example a re-calculation from scratch of NP-likeness score). You need to provide your own dataset of synthetic molecules (SM), we suggest using the ZINC15 dataset. Note that not adding any SM will not affect COCONUT, unless there is a need of re-calculating the NP-likeness score from scratch.

java -jar coconut-0.0.1-SNAPSHOT.jar onlyAddSM ~/Projects/NP/COCONUT/sm/sm.tsv & 
Run only CNPid calculation

In case you need to produce your own CNPid (COCONUT NP identifiers) - not recommened.

java -jar coconut-0.0.1-SNAPSHOT.jar addCNPid  & 
run only import of CNPid from file

java -jar coconut-0.0.1-SNAPSHOT.jar onlyImportCoconutIds coconut_ids_june2020.csv &

Molecule names curation

Import names from ChEBI, PubChem and CMAUP
python3 UpdateCOCONUT/COCONUTupdater.py
Import IUPAC names and clean
python3 UpdateCOCONUT/VerifyNames.py
Run annotation level recalculation
java -Xmx16288m -jar coconut-0.0.1-SNAPSHOT.jar evaluateAnnotation &
Names to low case
java -Xmx16288m -jar coconut-0.0.1-SNAPSHOT.jar namesToLowerCase &

coconut's People

Contributors

dependabot[bot] avatar msorok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.