private static void applyBonferroniCorrection(PhyloTree tree){
  int numberOfUpCases=0;
  int numberOfDownCases=0;
  for (Node v=tree.getFirstNode(); v != null; v=v.getNext()) {
    NodeData vd=(NodeData)v.getData();
    if (vd.getDownPValue() != Double.NaN && vd.getDownPValue() != -1 && v.getOutDegree() > 1)     numberOfDownCases++;
    if (vd.getUpPValue() != Double.NaN && vd.getUpPValue() != -1 && v.getInDegree() > 0)     numberOfUpCases++;
  }
  if (numberOfDownCases == 0)   numberOfDownCases=1;
  if (numberOfUpCases == 0)   numberOfUpCases=1;
  for (Node v=tree.getFirstNode(); v != null; v=v.getNext()) {
    NodeData vd=(NodeData)v.getData();
    if (vd.getUpPValue() != Double.NaN && vd.getUpPValue() != -1 && v.getInDegree() > 0)     vd.setUpPValue(Math.min(1,vd.getUpPValue() * numberOfUpCases));
    if (vd.getDownPValue() != Double.NaN && vd.getDownPValue() != -1 && v.getOutDegree() > 1)     vd.setDownPValue(Math.min(1,vd.getDownPValue() * numberOfDownCases));
  }
}

private static void applyBonferroniCorrection ( PhyloTree tree ) { int numberOfUpCases = 0 ; int numberOfDownCases = 0 ; for ( Node v = tree . getFirstNode ( ) ; v != null ; v = v . getNext ( ) ) { NodeData vd = ( NodeData ) v . getData ( ) ; if ( vd . getDownPValue ( ) != Double . NaN && vd . getDownPValue ( ) != - 1 && v . getOutDegree ( ) > 1 ) numberOfDownCases ++ ; if ( vd . getUpPValue ( ) != Double . NaN && vd . getUpPValue ( ) != - 1 && v . getInDegree ( ) > 0 ) numberOfUpCases ++ ; } if ( numberOfDownCases == 0 ) numberOfDownCases = 1 ; if ( numberOfUpCases == 0 ) numberOfUpCases = 1 ; for ( Node v = tree . getFirstNode ( ) ; v != null ; v = v . getNext ( ) ) { NodeData vd = ( NodeData ) v . getData ( ) ; if ( vd . getUpPValue ( ) != Double . NaN && vd . getUpPValue ( ) != - 1 && v . getInDegree ( ) > 0 ) vd . setUpPValue ( Math . min ( 1 , vd . getUpPValue ( ) * numberOfUpCases ) ) ; if ( vd . getDownPValue ( ) != Double . NaN && vd . getDownPValue ( ) != - 1 && v . getOutDegree ( ) > 1 ) vd . setDownPValue ( Math . min ( 1 , vd . getDownPValue ( ) * numberOfDownCases ) ) ; } }
apply the bonferroni correction
