def benjamini_hochberg_step_down(pvals):
 tmp = fdr_correction(pvals)
 corrected_vals = empty(len(pvals))
 max_pval = 1.0
 for i in argsort(pvals)[::(-1)]:
  if (tmp[i] < max_pval):
   corrected_vals[i] = tmp[i]
   max_pval = tmp[i]
  else:
   corrected_vals[i] = max_pval
 return corrected_vals

def benjamini_hochberg_step_down ( pvals ) : tmp = fdr_correction ( pvals ) corrected_vals = empty ( len ( pvals ) ) max_pval = 1.0 for i in argsort ( pvals ) [ : : ( - 1 ) ] : if ( tmp [ i ] < max_pval ) : corrected_vals [ i ] = tmp [ i ] max_pval = tmp [ i ] else : corrected_vals [ i ] = max_pval return corrected_vals
perform benjamini and hochbergs 1995 fdr step down procedure .