Пример #1
0
 /*
  * Salichos Stamatakis and Rokas, MBE v31 p1261 (2014)
  * If only two splits are listed, returns IC, the Internode Certainty.
  * If more splits are listed, returns ICA, (IC All).
  */
 private double internodeCertainty(DoubleList<Split, Integer> splits) {
   int sum = 0;
   int n = splits.size(); // number of splits under consideration
   for (int i = 0; i < n; i++) sum += splits.getB(i);
   double ic = 1;
   if (n > 1) {
     ic = Math.log(n);
     for (int i = 0; i < n; i++) {
       double p = ((double) splits.getB(i)) / sum;
       ic += p * Math.log(p);
     }
     ic /= Math.log(n); // convert from natural log to log base n
   }
   return ic;
 }
Пример #2
0
 /**
  * Returns the sum of Internode Certainties over a greedy consensus tree.
  *
  * @return
  */
 public double treeCertainty() {
   double tc = 0;
   DoubleList<Split, Double> ic = getICs();
   for (int i = 0; i < ic.size(); i++) {
     tc += ic.getB(i);
   }
   return tc;
 }
Пример #3
0
 /**
  * Returns the sum of Internode Certainty All over a greedy consensus tree.
  *
  * @return
  */
 public double treeCertaintyAll(int threshold) {
   double tca = 0;
   DoubleList<Split, Double> ic = getICAs(threshold);
   for (int i = 0; i < ic.size(); i++) {
     tca += ic.getB(i);
   }
   return tca;
 }
Пример #4
0
 public void printInternodeCertainties(PrintWriter out) {
   DoubleList<Split, Double> ic = getICs();
   for (int i = 0; i < ic.size(); i++) {
     out.printf("IC = %f for split %s\n", ic.getB(i), ic.getA(i).toString());
   }
 }