示例#1
0
def get_fdr_cutoffs( tsv_file, index='networks', alphas=[.05, .01], dec_places=2 ):
    for a in alphas:
        if a < .01:
            raise Exception("Alphas only go to .01, easy to fix, but I have bigger fish to fry")
    b6 = pandas.read_csv( tsv_file , sep='\t')
    b6.set_index(index)
    cutoffs = defaultdict(dict)
    for alpha in alphas:
        for c in b6.columns:
            if c != index:
                cutoff = pval.fdr_threshold(b6[c].values, alpha=alpha)
                cutoffs[c][("{:.%if}"%dec_places ).format(alpha)] = cutoff
    return cutoffs
示例#2
0
 
 tsr, psr = ttest_ind(samatha[subjects.T[1] == level], 
                  rest[subjects.T[1] == level],
                  #equal_var=False,
                  axis=0)
 
 psr_corrected = fdr_threshold(psr[upper_mask], alpha=p_value)
 psr_corrected = p_value
 
 '''
 tsv, psv = ttest_ind(samatha[subjects.T[1] == level], 
                  vipassana[subjects.T[1] == level],
                  #equal_var=False,
                  axis=0)
 
 psv_corrected = fdr_threshold(psv[upper_mask], alpha=p_value)
 psv_corrected = p_value
 
 '''
 fields['ttest_samatha_rest_t'] = tsr
 fields['ttest_samatha_rest_p'] = psr
 
 fields['ttest_vipassana_rest_t'] = tvr
 fields['ttest_vipassana_rest_p'] = pvr    
 '''
 
 fields['ttest_samatha_vipassana_t'] = tsv
 fields['ttest_samatha_vipassana_p'] = psv
 '''
 f, _ = plot_connectivity_circle_edited(tsr * (psr < psr_corrected), roi_names, None, 
                                        n_lines=np.count_nonzero(psr < psr_corrected))