Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Evalue for best peptides #2300

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
some useful comments
trishorts committed Aug 4, 2023
commit 1c5e367da75a6ba721a2e6d4431eb40fcbd75195
17 changes: 11 additions & 6 deletions MetaMorpheus/EngineLayer/FdrAnalysis/FdrAnalysisEngine.cs
Original file line number Diff line number Diff line change
@@ -167,8 +167,16 @@ private void DoFalseDiscoveryRateAnalysis(FdrAnalysisResults myAnalysisResults)
Compute_PEPValue(myAnalysisResults);
}
}

public double[] EValueByTailFittingForTopPsms(List<PeptideSpectralMatch> allPSMs)
/// <summary>
/// The method fits a line for log[survival] vs. log[(int)score] for the top 10% scoring spectrum matches
/// This line can be used to compute the E-value of a spectrum match by inputing the log[(int)score]
/// and raising 10 the the power of the computed value (10^y)
/// For high scoring spectrum matches (~the set of spectrum matches at 1% FDR), this value should be <= 0
/// This function should not used to calculate E-Value for anything with greater than 1% FDR
/// </summary>
/// <param name="allPSMs"></param>
/// <returns></returns>
public (double intercept, double slope) EValueRegressionFormulaByTailFittingForTopPsms(List<PeptideSpectralMatch> allPSMs)
{
int myCount = allPSMs.Count;
var decoyScoreHistogram = allPSMs
@@ -212,10 +220,7 @@ public double[] EValueByTailFittingForTopPsms(List<PeptideSpectralMatch> allPSMs
}
}

(double intercept,double slope) p = Fit.Line(logScores.ToArray(), logSurvivals.ToArray());


return logSurvival;
return Fit.Line(logScores.ToArray(), logSurvivals.ToArray());
}

public void Compute_PEPValue(FdrAnalysisResults myAnalysisResults)