Esempio n. 1
0
# Figure 1 - visual representation using three studies
study_list = ['1_1', '10_1', '52_11']
fig = plt.figure(figsize = (10.5, 7))
iplot = 1
for feas_type in ['partition', 'composition']:
    for study in study_list:
        ax = plt.subplot(2, 3, iplot)
        if iplot == 1 or iplot == 4: legend = True
        else: legend = False
        tl.plot_emp_vs_sim(study, feas_type = feas_type, ax = ax, legend = legend)     
        iplot += 1
plt.subplots_adjust(wspace = 0.29, hspace = 0.29)
plt.savefig('Fig1.pdf', dpi = 600)

# Figure 2 - compare the full distribution of empirical TLs and those from the feasible sets
study_info = tl.get_study_info('study_taxon_type.txt')
tl_pars_par = tl.get_tl_par_file('out_files/TL_form_partition.txt')

var_par = tl.get_var_sample_file('out_files/taylor_QN_var_predicted_partition_1000_full.txt')
var_comp = tl.get_var_sample_file('out_files/taylor_QN_var_predicted_composition_1000_full.txt')
par_quad = tl.get_val_ind_sample_file('out_files/TL_quad_p_partition.txt')
comp_quad = tl.get_val_ind_sample_file('out_files/TL_quad_p_composition.txt')

b_obs, b_par, b_comp, b_type = [], [], [], []
p_obs, p_par, p_comp = [], [], []
pcurv_obs, pcurv_par, pcurv_comp = [], [], []
r2_obs, r2_par, r2_comp = [], [], []
for study in np.unique(var_par['study']):
    b_obs.append((tl_pars_par['b_obs'][tl_pars_par['study'] == study])[0])
    p_obs.append((tl_pars_par['p_obs'][tl_pars_par['study'] == study])[0])
    r2_obs.append((tl_pars_par['R2_obs'][tl_pars_par['study'] == study])[0])