def format_correlation_info(corr_coeff, param_p_val, nonparam_p_val, conf_interval, num_permutations, header=''):
 result = ''
 if (header != ''):
  result += (header + '\n')
 result += ('Correlation coefficient DCTB Parametric p-value DCTB ' + 'Nonparametric p-value DCTB CI (lower) DCTB CI (upper)\n')
 if (num_permutations > 0):
  nonparam_p_val_str = format_p_value_for_num_iters(nonparam_p_val, num_permutations)
 else:
  nonparam_p_val_str = 'N/A'
 if (conf_interval == (None, None)):
  conf_interval_str = 'N/A DCTB N/A'
 else:
  conf_interval_str = ('%.4f DCTB %.4f' % conf_interval)
 result += ('%.4f DCTB %.4f DCTB %s DCTB %s\n' % (corr_coeff, param_p_val, nonparam_p_val_str, conf_interval_str))
 return result

def format_correlation_info ( corr_coeff , param_p_val , nonparam_p_val , conf_interval , num_permutations , header = '' ) : result = '' if ( header != '' ) : result += ( header + '\n' ) result += ( 'Correlation coefficient DCTB Parametric p-value DCTB ' + 'Nonparametric p-value DCTB CI (lower) DCTB CI (upper)\n' ) if ( num_permutations > 0 ) : nonparam_p_val_str = format_p_value_for_num_iters ( nonparam_p_val , num_permutations ) else : nonparam_p_val_str = 'N/A' if ( conf_interval == ( None , None ) ) : conf_interval_str = 'N/A DCTB N/A' else : conf_interval_str = ( '%.4f DCTB %.4f' % conf_interval ) result += ( '%.4f DCTB %.4f DCTB %s DCTB %s\n' % ( corr_coeff , param_p_val , nonparam_p_val_str , conf_interval_str ) ) return result
formats correlation information to be suitable for writing to a file .