Skip to content

Commit

Permalink
Little edits
Browse files Browse the repository at this point in the history
  • Loading branch information
zrolfs committed Sep 25, 2017
1 parent 85e9750 commit b640776
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions EngineLayer/ModernSearch/ModernSearchEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,25 +97,29 @@ protected override MetaMorpheusEngineResults RunSpecific()
{
if (fragmentIndex[fragmentBin] != null)
{
var peptideIdsInThisBin = fragmentIndex[fragmentBin];
int l = 0;
int r = peptideIdsInThisBin.Count - 1;
int m = 0;
List<int> peptideIdsInThisBin = fragmentIndex[fragmentBin];
// binary search in the fragment bin for lowest acceptable precursor mass
while (l <= r)
int m = 0;
if (!Double.IsInfinity(lowestMassPeptideToLookFor))
{
m = l + ((r - l) / 2);
if (r - l < 2)
break;
if (peptideIndex[peptideIdsInThisBin[m]].MonoisotopicMassIncludingFixedMods < lowestMassPeptideToLookFor)
l = m + 1;
else
r = m - 1;
int l = 0;
int r = peptideIdsInThisBin.Count - 1;
// binary search in the fragment bin for lowest acceptable precursor mass
while (l <= r)
{
m = l + ((r - l) / 2);
if (r - l < 2)
break;
if (peptideIndex[peptideIdsInThisBin[m]].MonoisotopicMassIncludingFixedMods < lowestMassPeptideToLookFor)
l = m + 1;
else
r = m - 1;
}
if (m > 0)
m--;
}
if (m > 0)
m--;
// add +1 score for each peptide candidate in the scoring table up to the maximum allowed precursor mass
if (!Double.IsInfinity(highestMassPeptideToLookFor))
Expand Down Expand Up @@ -148,7 +152,7 @@ protected override MetaMorpheusEngineResults RunSpecific()
scoringTable[id]++;
// add possible search results to the hashset of id's
if (scoringTable[id] >= intScoreCutoff)
if (scoringTable[id] == intScoreCutoff)
{
int notch = massDiffAcceptors.Accepts(scan.PrecursorMass, peptideIndex[id].MonoisotopicMassIncludingFixedMods);
Expand Down

0 comments on commit b640776

Please sign in to comment.