Find Missing Structure

This program is designed specifically for Open Enventory to fix issue with molecules missing structures (could not be extracted through "Read data from supplier")

DETAILS

This programs does:

  1. Connect into mysql database and find molecule in 'molecule' table

    of specific database and find those molecule with missing structure (smiles)

  2. folder "missing_mol_files" needs to be created inside /var/lib/mysql

    with 'mysql' as ownner (chown mysql:mysql)

  3. Try to download mol files from various sources into a folder in

    /var/lib/mysql/missing_mol_files

  4. Update those sql entries with new downloaded mol_files

REQUIREMENTS

  • root access to the server hosting Open Enventory

  • Python 3+

  • This file is made for Linux environment, you should be able

    to used it on other OS with changing the location of the "download_path"

USAGE

After cloning this repo onto the Open Enventory server:

  1. Change into directory of the new file:

    cd update_sql_mol
  2. (Optional): create virtual environment for python to install dependency:

    # you can change "update_sql_mol_venv" to other name too
    python3 -m venv update_sql_mol_venv   # Create virtual environment
    source update_sql_mol_venv/bin/activate    # Activate the virtual environment
  3. Install python dependencies:

    pip install -r requirements.txt
  4. Run the program:

    python3 update_sql_mol_v6/update_sql_mol.py    # Replace "update_sql_mol_v6" with latest version
    • Answer questions for:

      • confirming running under root

      • mySQL root password (typing password will not be shown on screen)

      • the name of the database you want to update (twice to confirm)

      • url path for your Open Enventory server (including 'http/https' and no trailing '/')

VERSIONS

Version 4:

  • Using simple download bar with bar=wget.bar_thermometer in wget.download

  • Added handling database connection error (wrong password, wrong database)

  • Added confirmation for database

Version 5

  • Change to https (from http) for ChemicalBook site

Version 6 (2020-01-18):

  • Remove this extra step of going into Open Enventory manual by the user using a web browser and doing Batch Processing.

    Why: for versions 5 and before:

    after running this program, YOU STILL NEED TO LOGIN INTO OPEN ENVENTORY ON A WEB BROWSER AS ROOT, GO TO "SETTINGS/BATCH PROCESSING". CHOOSE DATABASE THAT YOU WANT TO UPDATE AND THEN CHOOSE "MOLECULE", "EMPIRICAL FORMULA", "MW", "DEG. OF UNSAT." , "STRUCTURE", "SMILES" AND "FINGERPRINT" AND THEN SUBMIT TO UPDATE THE SQL QUERY. ONLY AFTER THIS, THE STRUCTURE WILL SHOW UP

Last updated