Esempio n. 1
0
 def test_signature_significance_fdr_bh_corr(self):
     """
     A typical corr='fdr_bh' scenario, that requires statsmodels.
     """
     sig_spectrum = spade.test_signature_significance(
         pv_spec=((2, 3, 0.2), (2, 4, 0.05)),
         concepts=([[(2, 3), (1, 2, 3)],
                    [(2, 4), (1, 2, 3, 4)]]),
         alpha=0.15, winlen=1, corr='fdr_bh')
     self.assertEqual(sig_spectrum, [(2., 3., False), (2., 4., True)])
Esempio n. 2
0
    config = yaml.load(stream)
psr_param = config['psr_param']
correction = config['correction']
path = '../results/results_data{0}/'.format(data_idx)

res_ind, params = np.load(path + 'result_ind.npy', encoding='latin1')
pval_spectrum = res_ind[0]['pvalue_spectrum']
spectrum = params['spectrum']
if len(pval_spectrum) == 0:
    ns_sgnt = []
else:
    # Computing non-significant entries of the spectrum applying
    # the statistical correction
    ns_sgnt = spade.test_signature_significance(pval_spectrum,
                                                alpha,
                                                corr=correction,
                                                report='non_significant',
                                                spectrum=spectrum)

filtered_results = {}
for xi in range(2, 11):
    for occ in range(3, 11):
        try:
            results, params = np.load(
                path + 'result_xi{xi}_occ{occ}.npy'.format(xi=xi, occ=occ),
                encoding='latin1')
        except:
            print('not all res available')
            continue
        filtered_results['xi{xi}_occ{occ}'.format(xi=xi, occ=occ)] = {}
        # SPADE parameters