def create_all_reports(data_dir, num_groups, trial_duration, p_b_e_range, p_x_e_range, p_e_e_range, p_e_i_range, p_i_i_range, p_i_e_range, contrast_range, num_trials, e_desc, base_report_dir, regenerate_network_plots=True, regenerate_trial_plots=True, smooth_missing_params=False, summary_filename='wta_network_summary.h5'): make_report_dirs(base_report_dir) summary_data = SummaryData(num_groups=num_groups, num_trials=num_trials, trial_duration=trial_duration, p_b_e_range=p_b_e_range, p_x_e_range=p_x_e_range, p_e_e_range=p_e_e_range, p_e_i_range=p_e_i_range, p_i_i_range=p_i_i_range, p_i_e_range=p_i_e_range) bc_slope_dict = {} bc_intercept_dict = {} bc_r_sqr_dict = {} auc_dict = {} bfr_slope_dict = {} bfr_intercept_dict = {} bfr_r_sqr_dict = {} param_combos = get_tested_param_combos(data_dir, num_groups, trial_duration, contrast_range, num_trials, e_desc) report_info = Struct() report_info.edesc = e_desc report_info.roc_auc = {} report_info.bc_slope = {} report_info.bc_intercept = {} report_info.bc_r_sqr = {} report_info.bfr_slope = {} report_info.bfr_intercept = {} report_info.bfr_r_sqr = {} for (p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e) in param_combos: if p_b_e in p_b_e_range and p_x_e in p_x_e_range and p_e_e in p_e_e_range and p_e_i in p_e_i_range and p_i_i in p_i_i_range and p_i_e in p_i_e_range: i = p_b_e_range.index(round(p_b_e, 3)) j = p_x_e_range.index(round(p_x_e, 3)) k = p_e_e_range.index(round(p_e_e, 3)) l = p_e_i_range.index(round(p_e_i, 3)) m = p_i_i_range.index(round(p_i_i, 3)) n = p_i_e_range.index(round(p_i_e, 3)) file_desc='wta.groups.%d.duration.%0.3f.p_b_e.%0.3f.p_x_e.%0.3f.p_e_e.%0.3f.p_e_i.%0.3f.p_i_i.%0.3f.p_i_e.%0.3f.%s' %\ (num_groups, trial_duration, p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e, e_desc) file_prefix = os.path.join(data_dir, file_desc) reports_dir = os.path.join(base_report_dir, file_desc) if all_trials_exist(file_prefix, contrast_range, num_trials): print('Creating report for %s' % file_desc) wta_report = create_wta_network_report( file_prefix, contrast_range, num_trials, reports_dir, e_desc, regenerate_network_plots=regenerate_network_plots, regenerate_trial_plots=regenerate_trial_plots) if not (i, j, k, l, m, n) in bc_slope_dict: bc_slope_dict[(i, j, k, l, m, n)] = [] bc_slope_dict[(i, j, k, l, m, n)].append(wta_report.bold.bold_contrast_slope) if not (i, j, k, l, m, n) in bc_intercept_dict: bc_intercept_dict[(i, j, k, l, m, n)] = [] bc_intercept_dict[(i, j, k, l, m, n)].append( wta_report.bold.bold_contrast_intercept) if not (i, j, k, l, m, n) in bc_r_sqr_dict: bc_r_sqr_dict[(i, j, k, l, m, n)] = [] bc_r_sqr_dict[(i, j, k, l, m, n)].append(wta_report.bold.bold_contrast_r_sqr) if not (i, j, k, l, m, n) in auc_dict: auc_dict[(i, j, k, l, m, n)] = [] auc_dict[(i, j, k, l, m, n)].append(wta_report.roc.auc) if not (i, j, k, l, m, n) in bfr_slope_dict: bfr_slope_dict[(i, j, k, l, m, n)] = [] bfr_slope_dict[(i, j, k, l, m, n)].append( wta_report.bold.bold_firing_rate_slope) if not (i, j, k, l, m, n) in bfr_intercept_dict: bfr_intercept_dict[(i, j, k, l, m, n)] = [] bfr_intercept_dict[(i, j, k, l, m, n)].append( wta_report.bold.bold_firing_rate_intercept) if not (i, j, k, l, m, n) in bfr_r_sqr_dict: bfr_r_sqr_dict[(i, j, k, l, m, n)] = [] bfr_r_sqr_dict[(i, j, k, l, m, n)].append( wta_report.bold.bold_firing_rate_r_sqr) report_info.roc_auc[(p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = wta_report.roc.auc report_info.bc_slope[( p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = wta_report.bold.bold_contrast_slope report_info.bc_intercept[( p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = wta_report.bold.bold_contrast_intercept report_info.bc_r_sqr[( p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = wta_report.bold.bold_contrast_r_sqr report_info.bfr_slope[( p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = wta_report.bold.bold_firing_rate_slope report_info.bfr_intercept[( p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = wta_report.bold.bold_firing_rate_intercept report_info.bfr_r_sqr[( p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = wta_report.bold.bold_firing_rate_r_sqr else: report_info.roc_auc[(p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = 0 report_info.bc_slope[(p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = 0 report_info.bc_intercept[(p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = 0 report_info.bc_r_sqr[(p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = 0 report_info.bfr_slope[(p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = 0 report_info.bfr_intercept[(p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = 0 report_info.brf_r_sqr[(p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = 0 report_info.num_groups = num_groups report_info.trial_duration = trial_duration report_info.num_trials = num_trials report_info.p_b_e_range = p_b_e_range report_info.p_x_e_range = p_x_e_range report_info.p_e_e_range = p_e_e_range report_info.p_e_i_range = p_e_i_range report_info.p_i_i_range = p_i_i_range report_info.p_i_e_range = p_i_e_range summary_data.fill(auc_dict, bc_slope_dict, bc_intercept_dict, bc_r_sqr_dict, bfr_slope_dict, bfr_intercept_dict, bfr_r_sqr_dict, smooth_missing_params=smooth_missing_params) summary_data.write_to_file(os.path.join(base_report_dir, summary_filename)) bc_bayes_analysis = run_bayesian_analysis( summary_data.auc, summary_data.bc_slope, summary_data.bc_intercept, summary_data.bc_r_sqr, num_trials, p_b_e_range, p_e_e_range, p_e_i_range, p_i_e_range, p_i_i_range, p_x_e_range) bfr_bayes_analysis = run_bayesian_analysis( summary_data.auc, summary_data.bfr_slope, summary_data.bfr_intercept, summary_data.bfr_r_sqr, num_trials, p_b_e_range, p_e_e_range, p_e_i_range, p_i_e_range, p_i_i_range, p_x_e_range) bc_base_dir = os.path.join(base_report_dir, 'bold-contrast') make_report_dirs(bc_base_dir) render_summary_report(bc_base_dir, bc_bayes_analysis, p_b_e_range, p_e_e_range, p_e_i_range, p_i_e_range, p_i_i_range, p_x_e_range, report_info) bfr_base_dir = os.path.join(base_report_dir, 'bold-firing_rate') make_report_dirs(bfr_base_dir) render_summary_report(bfr_base_dir, bfr_bayes_analysis, p_b_e_range, p_e_e_range, p_e_i_range, p_i_e_range, p_i_i_range, p_x_e_range, report_info)
def create_all_reports(data_dir, num_groups, trial_duration, p_b_e_range, p_x_e_range, p_e_e_range, p_e_i_range, p_i_i_range, p_i_e_range, contrast_range, num_trials, e_desc, base_report_dir, regenerate_network_plots=True, regenerate_trial_plots=True, smooth_missing_params=False, summary_filename='wta_network_summary.h5'): make_report_dirs(base_report_dir) summary_data=SummaryData(num_groups=num_groups, num_trials=num_trials, trial_duration=trial_duration, p_b_e_range=p_b_e_range, p_x_e_range=p_x_e_range, p_e_e_range=p_e_e_range, p_e_i_range=p_e_i_range, p_i_i_range=p_i_i_range, p_i_e_range=p_i_e_range) bc_slope_dict={} bc_intercept_dict={} bc_r_sqr_dict={} auc_dict={} bfr_slope_dict={} bfr_intercept_dict={} bfr_r_sqr_dict={} param_combos=get_tested_param_combos(data_dir, num_groups, trial_duration, contrast_range, num_trials, e_desc) report_info=Struct() report_info.edesc=e_desc report_info.roc_auc={} report_info.bc_slope={} report_info.bc_intercept={} report_info.bc_r_sqr={} report_info.bfr_slope={} report_info.bfr_intercept={} report_info.bfr_r_sqr={} for (p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e) in param_combos: if p_b_e in p_b_e_range and p_x_e in p_x_e_range and p_e_e in p_e_e_range and p_e_i in p_e_i_range and p_i_i in p_i_i_range and p_i_e in p_i_e_range: i=p_b_e_range.index(round(p_b_e,3)) j=p_x_e_range.index(round(p_x_e,3)) k=p_e_e_range.index(round(p_e_e,3)) l=p_e_i_range.index(round(p_e_i,3)) m=p_i_i_range.index(round(p_i_i,3)) n=p_i_e_range.index(round(p_i_e,3)) file_desc='wta.groups.%d.duration.%0.3f.p_b_e.%0.3f.p_x_e.%0.3f.p_e_e.%0.3f.p_e_i.%0.3f.p_i_i.%0.3f.p_i_e.%0.3f.%s' %\ (num_groups, trial_duration, p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e, e_desc) file_prefix=os.path.join(data_dir,file_desc) reports_dir=os.path.join(base_report_dir,file_desc) if all_trials_exist(file_prefix, contrast_range, num_trials): print('Creating report for %s' % file_desc) wta_report=create_wta_network_report(file_prefix, contrast_range, num_trials, reports_dir, e_desc, regenerate_network_plots=regenerate_network_plots, regenerate_trial_plots=regenerate_trial_plots) if not (i,j,k,l,m,n) in bc_slope_dict: bc_slope_dict[(i,j,k,l,m,n)]=[] bc_slope_dict[(i,j,k,l,m,n)].append(wta_report.bold.bold_contrast_slope) if not (i,j,k,l,m,n) in bc_intercept_dict: bc_intercept_dict[(i,j,k,l,m,n)]=[] bc_intercept_dict[(i,j,k,l,m,n)].append(wta_report.bold.bold_contrast_intercept) if not (i,j,k,l,m,n) in bc_r_sqr_dict: bc_r_sqr_dict[(i,j,k,l,m,n)]=[] bc_r_sqr_dict[(i,j,k,l,m,n)].append(wta_report.bold.bold_contrast_r_sqr) if not (i,j,k,l,m,n) in auc_dict: auc_dict[(i,j,k,l,m,n)]=[] auc_dict[(i,j,k,l,m,n)].append(wta_report.roc.auc) if not (i,j,k,l,m,n) in bfr_slope_dict: bfr_slope_dict[(i,j,k,l,m,n)]=[] bfr_slope_dict[(i,j,k,l,m,n)].append(wta_report.bold.bold_firing_rate_slope) if not (i,j,k,l,m,n) in bfr_intercept_dict: bfr_intercept_dict[(i,j,k,l,m,n)]=[] bfr_intercept_dict[(i,j,k,l,m,n)].append(wta_report.bold.bold_firing_rate_intercept) if not (i,j,k,l,m,n) in bfr_r_sqr_dict: bfr_r_sqr_dict[(i,j,k,l,m,n)]=[] bfr_r_sqr_dict[(i,j,k,l,m,n)].append(wta_report.bold.bold_firing_rate_r_sqr) report_info.roc_auc[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=wta_report.roc.auc report_info.bc_slope[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=wta_report.bold.bold_contrast_slope report_info.bc_intercept[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=wta_report.bold.bold_contrast_intercept report_info.bc_r_sqr[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=wta_report.bold.bold_contrast_r_sqr report_info.bfr_slope[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=wta_report.bold.bold_firing_rate_slope report_info.bfr_intercept[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=wta_report.bold.bold_firing_rate_intercept report_info.bfr_r_sqr[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=wta_report.bold.bold_firing_rate_r_sqr else: report_info.roc_auc[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=0 report_info.bc_slope[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=0 report_info.bc_intercept[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=0 report_info.bc_r_sqr[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=0 report_info.bfr_slope[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=0 report_info.bfr_intercept[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=0 report_info.brf_r_sqr[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=0 report_info.num_groups=num_groups report_info.trial_duration=trial_duration report_info.num_trials=num_trials report_info.p_b_e_range=p_b_e_range report_info.p_x_e_range=p_x_e_range report_info.p_e_e_range=p_e_e_range report_info.p_e_i_range=p_e_i_range report_info.p_i_i_range=p_i_i_range report_info.p_i_e_range=p_i_e_range summary_data.fill(auc_dict, bc_slope_dict, bc_intercept_dict, bc_r_sqr_dict, bfr_slope_dict, bfr_intercept_dict, bfr_r_sqr_dict, smooth_missing_params=smooth_missing_params) summary_data.write_to_file(os.path.join(base_report_dir,summary_filename)) bc_bayes_analysis=run_bayesian_analysis(summary_data.auc, summary_data.bc_slope, summary_data.bc_intercept, summary_data.bc_r_sqr, num_trials, p_b_e_range, p_e_e_range, p_e_i_range, p_i_e_range, p_i_i_range, p_x_e_range) bfr_bayes_analysis=run_bayesian_analysis(summary_data.auc, summary_data.bfr_slope, summary_data.bfr_intercept, summary_data.bfr_r_sqr, num_trials, p_b_e_range, p_e_e_range, p_e_i_range, p_i_e_range, p_i_i_range, p_x_e_range) bc_base_dir=os.path.join(base_report_dir, 'bold-contrast') make_report_dirs(bc_base_dir) render_summary_report(bc_base_dir, bc_bayes_analysis, p_b_e_range, p_e_e_range, p_e_i_range, p_i_e_range, p_i_i_range, p_x_e_range, report_info) bfr_base_dir=os.path.join(base_report_dir, 'bold-firing_rate') make_report_dirs(bfr_base_dir) render_summary_report(bfr_base_dir, bfr_bayes_analysis, p_b_e_range, p_e_e_range, p_e_i_range, p_i_e_range, p_i_i_range, p_x_e_range, report_info)
def create_summary_report(summary_file_name, base_report_dir, e_desc): make_report_dirs(base_report_dir) summary_data=SummaryData() summary_data.read_from_file(summary_file_name) report_info=Struct() report_info.edesc=e_desc report_info.roc_auc={} report_info.io_slope={} report_info.io_intercept={} report_info.io_r_sqr={} report_info.bc_slope={} report_info.bc_intercept={} report_info.bc_r_sqr={} report_info.bfr_slope={} report_info.bfr_intercept={} report_info.bfr_r_sqr={} for i,p_b_e in enumerate(summary_data.p_b_e_range): for j,p_x_e in enumerate(summary_data.p_x_e_range): for k,p_e_e in enumerate(summary_data.p_e_e_range): for l,p_e_i in enumerate(summary_data.p_e_i_range): for m,p_i_i in enumerate(summary_data.p_i_i_range): for n,p_i_e in enumerate(summary_data.p_i_e_range): if summary_data.auc[i,j,k,l,m,n]>0: report_info.roc_auc[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=summary_data.auc[i,j,k,l,m,n] report_info.bc_slope[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=summary_data.bc_slope[i,j,k,l,m,n] report_info.bc_intercept[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=summary_data.bc_intercept[i,j,k,l,m,n] report_info.bc_r_sqr[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=summary_data.bc_r_sqr[i,j,k,l,m,n] report_info.bfr_slope[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=summary_data.bfr_slope[i,j,k,l,m,n] report_info.bfr_intercept[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=summary_data.bfr_intercept[i,j,k,l,m,n] report_info.bfr_r_sqr[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=summary_data.bfr_r_sqr[i,j,k,l,m,n] else: report_info.roc_auc[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=0 report_info.bc_slope[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=0 report_info.bc_intercept[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=0 report_info.bc_r_sqr[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=0 report_info.bfr_slope[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=0 report_info.bfr_intercept[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=0 report_info.bfr_r_sqr[(p_b_e,p_x_e,p_e_e,p_e_i,p_i_i,p_i_e)]=0 report_info.num_groups=summary_data.num_groups report_info.trial_duration=summary_data.trial_duration report_info.num_trials=summary_data.num_trials report_info.p_b_e_range=summary_data.p_b_e_range report_info.p_x_e_range=summary_data.p_x_e_range report_info.p_e_e_range=summary_data.p_e_e_range[:-1] report_info.p_e_i_range=summary_data.p_e_i_range report_info.p_i_i_range=summary_data.p_i_i_range report_info.p_i_e_range=summary_data.p_i_e_range bc_bayes_analysis=run_bayesian_analysis(summary_data.auc, summary_data.bc_slope, summary_data.bc_intercept, summary_data.bc_r_sqr, summary_data.num_trials, summary_data.p_b_e_range, summary_data.p_e_e_range, summary_data.p_e_i_range, summary_data.p_i_e_range, summary_data.p_i_i_range, summary_data.p_x_e_range) bfr_bayes_analysis=run_bayesian_analysis(summary_data.auc, summary_data.bfr_slope, summary_data.bfr_intercept, summary_data.bfr_r_sqr, summary_data.num_trials, summary_data.p_b_e_range, summary_data.p_e_e_range, summary_data.p_e_i_range, summary_data.p_i_e_range, summary_data.p_i_i_range, summary_data.p_x_e_range) bc_base_dir=os.path.join(base_report_dir, 'bold-contrast') make_report_dirs(bc_base_dir) render_summary_report(bc_base_dir, bc_bayes_analysis, summary_data.p_b_e_range, summary_data.p_e_e_range, summary_data.p_e_i_range, summary_data.p_i_e_range, summary_data.p_i_i_range, summary_data.p_x_e_range, report_info) bfr_base_dir=os.path.join(base_report_dir, 'bold-firing_rate') make_report_dirs(bfr_base_dir) render_summary_report(bfr_base_dir, bfr_bayes_analysis, summary_data.p_b_e_range, summary_data.p_e_e_range, summary_data.p_e_i_range, summary_data.p_i_e_range, summary_data.p_i_i_range, summary_data.p_x_e_range, report_info)
def create_summary_report(summary_file_name, base_report_dir, e_desc): make_report_dirs(base_report_dir) summary_data = SummaryData() summary_data.read_from_file(summary_file_name) report_info = Struct() report_info.edesc = e_desc report_info.roc_auc = {} report_info.io_slope = {} report_info.io_intercept = {} report_info.io_r_sqr = {} report_info.bc_slope = {} report_info.bc_intercept = {} report_info.bc_r_sqr = {} report_info.bfr_slope = {} report_info.bfr_intercept = {} report_info.bfr_r_sqr = {} for i, p_b_e in enumerate(summary_data.p_b_e_range): for j, p_x_e in enumerate(summary_data.p_x_e_range): for k, p_e_e in enumerate(summary_data.p_e_e_range): for l, p_e_i in enumerate(summary_data.p_e_i_range): for m, p_i_i in enumerate(summary_data.p_i_i_range): for n, p_i_e in enumerate(summary_data.p_i_e_range): if summary_data.auc[i, j, k, l, m, n] > 0: report_info.roc_auc[( p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = summary_data.auc[i, j, k, l, m, n] report_info.bc_slope[( p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = summary_data.bc_slope[i, j, k, l, m, n] report_info.bc_intercept[( p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = summary_data.bc_intercept[i, j, k, l, m, n] report_info.bc_r_sqr[( p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = summary_data.bc_r_sqr[i, j, k, l, m, n] report_info.bfr_slope[( p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = summary_data.bfr_slope[i, j, k, l, m, n] report_info.bfr_intercept[( p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = summary_data.bfr_intercept[i, j, k, l, m, n] report_info.bfr_r_sqr[( p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = summary_data.bfr_r_sqr[i, j, k, l, m, n] else: report_info.roc_auc[(p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = 0 report_info.bc_slope[(p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = 0 report_info.bc_intercept[(p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = 0 report_info.bc_r_sqr[(p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = 0 report_info.bfr_slope[(p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = 0 report_info.bfr_intercept[(p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = 0 report_info.bfr_r_sqr[(p_b_e, p_x_e, p_e_e, p_e_i, p_i_i, p_i_e)] = 0 report_info.num_groups = summary_data.num_groups report_info.trial_duration = summary_data.trial_duration report_info.num_trials = summary_data.num_trials report_info.p_b_e_range = summary_data.p_b_e_range report_info.p_x_e_range = summary_data.p_x_e_range report_info.p_e_e_range = summary_data.p_e_e_range[:-1] report_info.p_e_i_range = summary_data.p_e_i_range report_info.p_i_i_range = summary_data.p_i_i_range report_info.p_i_e_range = summary_data.p_i_e_range bc_bayes_analysis = run_bayesian_analysis( summary_data.auc, summary_data.bc_slope, summary_data.bc_intercept, summary_data.bc_r_sqr, summary_data.num_trials, summary_data.p_b_e_range, summary_data.p_e_e_range, summary_data.p_e_i_range, summary_data.p_i_e_range, summary_data.p_i_i_range, summary_data.p_x_e_range) bfr_bayes_analysis = run_bayesian_analysis( summary_data.auc, summary_data.bfr_slope, summary_data.bfr_intercept, summary_data.bfr_r_sqr, summary_data.num_trials, summary_data.p_b_e_range, summary_data.p_e_e_range, summary_data.p_e_i_range, summary_data.p_i_e_range, summary_data.p_i_i_range, summary_data.p_x_e_range) bc_base_dir = os.path.join(base_report_dir, 'bold-contrast') make_report_dirs(bc_base_dir) render_summary_report(bc_base_dir, bc_bayes_analysis, summary_data.p_b_e_range, summary_data.p_e_e_range, summary_data.p_e_i_range, summary_data.p_i_e_range, summary_data.p_i_i_range, summary_data.p_x_e_range, report_info) bfr_base_dir = os.path.join(base_report_dir, 'bold-firing_rate') make_report_dirs(bfr_base_dir) render_summary_report(bfr_base_dir, bfr_bayes_analysis, summary_data.p_b_e_range, summary_data.p_e_e_range, summary_data.p_e_i_range, summary_data.p_i_e_range, summary_data.p_i_i_range, summary_data.p_x_e_range, report_info)