Esempio n. 1
0
def main(draw_thumb=False, export_csv=False):
    django.setup()
    logging.info('> Flushing SQL data')
    execute_from_command_line(['', 'flush', '--noinput'])

    transaction.set_autocommit(False)

    database_io.CheckData()

    logging.info('> Loading citation data')
    database_io.LoadCitationData()
    transaction.commit()

    logging.info('> Loading KEGG compound names')
    cid_replace = database_io.LoadKeggCompoundNames()
    transaction.commit()

    logging.info('> Loading KEGG compound thermodynamic data')
    database_io.LoadFormationEnergies()
    database_io.LoadAlbertyEnergies()
    transaction.commit()

    logging.info('> Loading KEGG reaction data')
    database_io.LoadKeggReactions(cid_replace)
    transaction.commit()

    logging.info('> Loading KEGG enzyme data')
    database_io.LoadKeggEnzymes()
    transaction.commit()

    if draw_thumb:
        logging.info('> Drawing thumbnails for all KEGG compounds')
        database_io.GenerateCompoundThumbnails()
        transaction.commit()

    logging.info('> Loading corrections/additions to KEGG')
    database_io.LoadAdditionalCompoundData()
    transaction.commit()

    if export_csv:
        logging.info('> Exporting database to JSON and CSV files')
        database_io.export_database()

    logging.info('> Rebuilding Solr index')
    execute_from_command_line(['', 'rebuild_index', '--noinput'])
Esempio n. 2
0
def load_from_raw_files(draw_thumb, export_csv):
    from util import database_io
    transaction.set_autocommit(False)

    database_io.CheckData()

    logging.info('> Loading citation data')
    database_io.LoadCitationData()
    transaction.commit()

    logging.info('> Loading KEGG compound names')
    cid_replace = database_io.LoadKeggCompoundNames()
    transaction.commit()

    logging.info('> Loading KEGG compound thermodynamic data')
    database_io.LoadFormationEnergies()
    database_io.LoadAlbertyEnergies()
    transaction.commit()

    logging.info('> Loading KEGG reaction data')
    database_io.LoadKeggReactions(cid_replace)
    transaction.commit()

    logging.info('> Loading KEGG enzyme data')
    database_io.LoadKeggEnzymes()
    transaction.commit()

    if draw_thumb:
        logging.info('> Drawing thumbnails for all KEGG compounds')
        database_io.GenerateCompoundThumbnails()
        transaction.commit()

    logging.info('> Loading corrections/additions to KEGG')
    database_io.LoadAdditionalCompoundData()
    transaction.commit()

    if export_csv:
        logging.info('> Exporting database to JSON and CSV files')
        database_io.export_database()
Esempio n. 3
0
def main(draw_thumb=False, export_csv=False):
    transaction.set_autocommit(False)

    db.CheckData()

    logging.info('Loading citation data')
    db.LoadCitationData()
    transaction.commit()
        
    logging.info('Loading KEGG compound names')
    cid_replace = db.LoadKeggCompoundNames()
    transaction.commit()

    logging.info('Loading KEGG compound thermodynamic data')
    db.LoadFormationEnergies()
    db.LoadAlbertyEnergies()
    transaction.commit()

    logging.info('Loading KEGG reaction data')
    db.LoadKeggReactions(cid_replace)
    transaction.commit()

    logging.info('Loading KEGG enzyme data')
    db.LoadKeggEnzymes()
    transaction.commit()

    if draw_thumb:
        logging.info('Drawing thumbnails for all KEGG compounds')
        db.GenerateCompoundThumbnails()
        transaction.commit()
    
    logging.info('Loading corrections/additions to KEGG')
    db.LoadAdditionalCompoundData()
    transaction.commit()
    
    if export_csv:
        logging.info('Exporting database to JSON and CSV files')
        db.export_database()
Esempio n. 4
0
def main():
    logging.info('Exporting database to JSON and CSV files')
    db.export_database()