def correlate_output_formatter(bt, test_stats, pvals, fdr_pvals, bon_pvals, md_key):
 header = ['Feature ID', 'Test stat.', 'pval', 'pval_fdr', 'pval_bon', md_key]
 num_lines = len(test_stats)
 lines = [' DCTB '.join(header)]
 for i in range(num_lines):
  tmp = [bt.ids(axis='observation')[i], test_stats[i], pvals[i], fdr_pvals[i], bon_pvals[i]]
  lines.append(' DCTB '.join(map(str, tmp)))
 nls = _add_metadata(bt, md_key, lines)
 return nls

def correlate_output_formatter ( bt , test_stats , pvals , fdr_pvals , bon_pvals , md_key ) : header = [ 'Feature ID' , 'Test stat.' , 'pval' , 'pval_fdr' , 'pval_bon' , md_key ] num_lines = len ( test_stats ) lines = [ ' DCTB ' . join ( header ) ] for i in range ( num_lines ) : tmp = [ bt . ids ( axis = 'observation' ) [ i ] , test_stats [ i ] , pvals [ i ] , fdr_pvals [ i ] , bon_pvals [ i ] ] lines . append ( ' DCTB ' . join ( map ( str , tmp ) ) ) nls = _add_metadata ( bt , md_key , lines ) return nls
produce lines for a tab delimited text file for correlations .