Changeset 4362


Ignore:
Timestamp:
Oct 24, 2012, 8:24:43 AM (10 years ago)
Author:
Fredrik Levander
Message:

Refs #773. Further optimisation of counting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugin/src/org/proteios/plugins/CombinedHitsReport.java

    r4361 r4362  
    699699      log.debug("First sorting done. Setting score values");
    700700      // Set dummy scores
     701      float[][] combScores = new float[combinedHits.size()][score_types.length];
     702      int index=0;
    701703      for (CombinedHit ch : combinedHits)
    702704      {
     
    714716            }
    715717          }
    716         }
     718          combScores[index][i]=ch.scores[i];
     719        }
     720        index++;
    717721      }
    718722      float[][] revScores = new float[revCombinedHits.size()][score_types.length];
    719       int index=0;
     723      index=0;
    720724      for (CombinedHit ch : revCombinedHits)
    721725      {
     
    737741        index++;
    738742      }
    739       log.debug("Adding of extreme scores done.");
     743      log.debug("Addition of extreme scores done.");
    740744      // count spots
    741745      int spots = 0;
     
    778782      }
    779783      log.debug("Counting better hits for targets.");
    780       countBetterRandomHits(combinedHits, revScores);
     784      countBetterRandomHits(combinedHits, combScores, revScores);
    781785      log.debug("Counting better hits for decoys.");
    782       countBetterRandomHits(revCombinedHits, revScores);
     786      countBetterRandomHits(revCombinedHits, revScores, revScores);
    783787      log.debug("Counting done. Sorting after score counts");
    784788      if (progress != null)
     
    957961
    958962
    959   private void countBetterRandomHits(List<CombinedHit> combinedHits,
     963  private void countBetterRandomHits(List<CombinedHit> combinedHits, float[][] combScores,
    960964      float[][] revScores)
    961965  {
     
    969973       * Count how many reverse hits that have better score of any type.
    970974       * If the reverse hit has all the score types that the forward hit
    971        * has, and any of them is above those of the forward hit, it should
     975       * has, and all of them are above those of the forward hit, it should
    972976       * be counted.
    973977       */
     
    977981        for (int k = 0; k < scoreSize; k++)
    978982        {
    979             if ((!compareE[k] && (revScores[j][k] < combinedHits
    980               .get(i).scores[k])) || (compareE[k] && (revScores
    981               [j][k] > combinedHits.get(i).scores[k])))
    982             {
    983               above = false;
    984             }
     983          if (compareE[k])
     984          {
     985            if (revScores[j][k]>combScores[i][k]) above=false;
     986          }
     987          else
     988          {
     989            if (revScores[j][k]<combScores[i][k]) above=false;
     990          }
    985991        }
    986992        if (above)
Note: See TracChangeset for help on using the changeset viewer.