Example #1
0
 print("\nDeleting existing ChEMBL data...")
 rv = dba.del_cmpd_activities('ChEMBL')
 if type(rv) == int:
     print(f"  Deleted {rv} 'ChEMBL' cmpd_activity rows")
 else:
     print(
         f"Error deleting 'ChEMBL' cmpd_activity rows. See logfile {logfile} for details."
     )
     exit(1)
 rv = dba.del_dataset('ChEMBL')
 if not rv:
     print(
         f"Error deleting 'ChEMBL' dataset. See logfile {logfile} for details."
     )
     exit(1)
 rv = dba.del_tdl_infos('ChEMBL First Reference Year')
 if type(rv) == int:
     print(f"  Deleted {rv} 'ChEMBL First Reference Year' tdl_info rows")
 else:
     print(
         f"Error deleting 'ChEMBL First Reference Year' tdl_info rows. See logfile {logfile} for details."
     )
     exit(1)
 rv = dba.del_tdl_infos('ChEMBL Selective Compound')
 if type(rv) == int:
     print(f"  Deleted {rv} 'ChEMBL Selective Compound' tdl_info rows")
 else:
     print(
         f"Error deleting 'ChEMBL Selective Compound' tdl_info rows. See logfile {logfile} for details."
     )
     exit(1)
Example #2
0
  download_pmscores(args)
  download_DISEASES(args)
  download_mentions(args)
  download_do(args)

  start_time = time.time()
  print("\nUpdating JensenLab PubMed Text-mining Scores...")
  # delete existing pmscores
  rv = dba.del_all_rows(pmscore)
  if type(rv) == int:
    print(f"  Deleted {rv} rows from pmscore")
  else:
    print(f"Error deleting rows from pmscore... Exiting.")
    exit(1)
  # delete 'JensenLab PubMed Score' TDL Infos
  rv = dba.del_tdl_infos('JensenLab PubMed Score')
  if type(rv) == int:
    print(f"  Deleted {rv} 'JensenLab PubMed Score' tdl_info rows")
  else:
    print(f"Error deleting 'JensenLab PubMed Score' tdl_info rows. Exiting.")
    exit(1)
  # load new pmsores and TDL Infos
  load_pmscores(args, dba, logger, logfile)
  # update dataset
  upds = {'app': PROGRAM, 'app_version': __version__,
          'datetime': time.strftime("%Y-%m-%d %H:%M:%S")}
  rv = upd_dataset_by_name(self, 'JensenLab PubMed Text-mining Scores', upds):
  assert rv "Error updating dataset 'JensenLab PubMed Text-mining Scores'. Exiting."

  print("\nUpdating JensenLab DISEASES...")
  # delete existing DISEASES