hill = 1 elif model == 2: pic50, hill = params if hill <= hill_lower or hill > hill_upper or pic50 <= pic50_lower: return 1e9 else: predicted = dr.dose_response_model(concs, hill, dr.pic50_to_ic50(pic50)) return np.sum((responses-predicted)**2) data_file = "../input/crumb_data.csv" run_all = True dr.setup(data_file) drugs_to_run, channels_to_run = dr.list_drug_channel_options(run_all) all_figs_dir = "../output/all_best_fits/" if not os.path.exists(all_figs_dir): os.makedirs(all_figs_dir) #drug = "Amitriptyline" #channel = "Cav1.2" #drug = "Amiodarone" #channel = "hERG" num_models = 2 def do_plot(drug_channel):
action='store_true', help='plot data points on top of predicted curves', default=False) parser.add_argument( "--save-pdf", action='store_true', help= 'save dose-response curves figure as pdf (in addition to png), but the file will probably be massive', default=False) args = parser.parse_args() dr.define_model(args.model) temperature = 1 num_params = dr.num_params dr.setup(args.data_file) drugs_to_run, channels_to_run = dr.list_drug_channel_options(args.all) num_x_pts = 50 alpha = 0.002 # this is the lowest value I've found that actually shows anything for drug, channel in it.product(drugs_to_run, channels_to_run): try: num_expts, experiment_numbers, experiments = dr.load_crumb_data( drug, channel) except: print "\nCan't load experimental data for {} + {} --- skipping\n".format( drug, channel) continue drug, channel, chain_file, images_dir = dr.nonhierarchical_chain_file_and_figs_dir(
pic50 = params[0] hill = 1 elif model == 2: pic50, hill = params if hill <= hill_lower or hill > hill_upper or pic50 <= pic50_lower: return 1e9 else: predicted = dr.dose_response_model(concs, hill, dr.pic50_to_ic50(pic50)) return np.sum((responses - predicted)**2) data_file = "../input/crumb_data.csv" run_all = True dr.setup(data_file) drugs_to_run, channels_to_run = dr.list_drug_channel_options(run_all) all_figs_dir = "../output/all_best_fits/" if not os.path.exists(all_figs_dir): os.makedirs(all_figs_dir) #drug = "Amitriptyline" #channel = "Cav1.2" #drug = "Amiodarone" #channel = "hERG" num_models = 2 def do_plot(drug_channel):