Skip to content

Commit

Permalink
Fix segfault in AnalyzeSP as code did not exclude PEFF mods to fragme…
Browse files Browse the repository at this point in the history
…nt NL scaling. Reported by Z. Sun.
  • Loading branch information
jke000 committed Nov 5, 2024
1 parent c40a2ed commit b7ef80b
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions CometSearch/CometPostAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,13 @@ void CometPostAnalysis::CalculateSP(Results *pOutput,

int iMod = pOutput[i].piVarModSites[ii];

if (g_staticParams.options.bScaleFragmentNL)
iCountNLB[iMod-1][ii] += 1;
else
iCountNLB[iMod-1][ii] = 1;
if (iMod > 0)
{
if (g_staticParams.options.bScaleFragmentNL)
iCountNLB[iMod-1][ii] += 1;
else
iCountNLB[iMod-1][ii] = 1;
}
}

if (pOutput[i].piVarModSites[iPos] != 0)
Expand All @@ -467,10 +470,13 @@ void CometPostAnalysis::CalculateSP(Results *pOutput,

int iMod = pOutput[i].piVarModSites[iPos];

if (g_staticParams.options.bScaleFragmentNL)
iCountNLY[iMod-1][ii] += 1;
else
iCountNLY[iMod-1][ii] = 1;
if (iMod > 0)
{
if (g_staticParams.options.bScaleFragmentNL)
iCountNLY[iMod-1][ii] += 1;
else
iCountNLY[iMod-1][ii] = 1;
}
}
}

Expand Down Expand Up @@ -523,7 +529,7 @@ void CometPostAnalysis::CalculateSP(Results *pOutput,

if (g_staticParams.variableModParameters.bUseFragmentNeutralLoss)
{
for (int iMod=0; iMod < VMODS; iMod++)
for (int iMod = 0; iMod < VMODS; iMod++)
{
if (iWhichIonSeries <= 2) // abc ions
{
Expand Down

0 comments on commit b7ef80b

Please sign in to comment.