Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 0 additions & 38 deletions MetaMorpheus/EngineLayer/BioPolymerNotchFragmentIonComparer.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ protected override MetaMorpheusEngineResults RunSpecific()
int ms2scanNumber = identification.ScanNumber;
int peptideCharge = identification.ScanPrecursorCharge;
//skip if ambiguous
if (identification.FullSequence == null || identification.BestMatchingBioPolymersWithSetMods.Any(p => p.Peptide.AllModsOneIsNterminus.Any(m => m.Value.ChemicalFormula == null)))
if (identification.FullSequence == null || identification.BestMatchingBioPolymersWithSetMods.Any(p => p.WithSetMods.AllModsOneIsNterminus.Any(m => m.Value.ChemicalFormula == null)))
continue;

var representativeSinglePeptide = identification.BestMatchingBioPolymersWithSetMods.First().Peptide;
var representativeSinglePeptide = identification.BestMatchingBioPolymersWithSetMods.First().WithSetMods;

// Get the peptide, don't forget to add the modifications!!!!
var SequenceWithChemicalFormulas = representativeSinglePeptide.SequenceWithChemicalFormulas;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using MzLibUtil;
using Omics;
using Omics.Fragmentation;
using Proteomics.ProteolyticDigestion;
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -129,18 +128,16 @@ public static void CalculateSpectralAngles(SpectralLibrary spectralLibrary, Spec
if (psms[i] != null)
{
Ms2ScanWithSpecificMass scan = arrayOfSortedMs2Scans[psms[i].ScanIndex];
List<(int, IBioPolymerWithSetMods)> pwsms = new();
List<double> pwsmSpectralAngles = new();
foreach (var (Notch, Peptide) in psms[i].BestMatchingBioPolymersWithSetMods)
foreach (var bestMatch in psms[i].BestMatchingBioPolymersWithSetMods)
{
//if peptide is target, directly look for the target's spectrum in the spectral library
if (!Peptide.Parent.IsDecoy && spectralLibrary.TryGetSpectrum(Peptide.FullSequence, scan.PrecursorCharge, out var librarySpectrum))
if (!bestMatch.IsDecoy && spectralLibrary.TryGetSpectrum(bestMatch.FullSequence, scan.PrecursorCharge, out var librarySpectrum))
{
SpectralSimilarity s = new SpectralSimilarity(scan.TheScan.MassSpectrum, librarySpectrum.XArray, librarySpectrum.YArray,
SpectralSimilarity.SpectrumNormalizationScheme.SquareRootSpectrumSum, fileSpecificParameters.ProductMassTolerance.Value, false);
if (s.SpectralContrastAngle().HasValue)
{
pwsms.Add((Notch, Peptide));
pwsmSpectralAngles.Add((double)s.SpectralContrastAngle());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public CrosslinkSpectralMatch(
XLTotalScore = score;
_BestMatchingBioPolymersWithSetMods.Clear();

_BestMatchingBioPolymersWithSetMods.Add((0, theBestPeptide));
_BestMatchingBioPolymersWithSetMods.Add(new SpectrumMatch.TentativeSpectralMatch(0, theBestPeptide, matchedFragmentIons));

}

Expand Down Expand Up @@ -127,8 +127,8 @@ public static bool IsIntraCsm(CrosslinkSpectralMatch csm)

if (csm.Accession == null)
{
var alphaProteins = csm.BestMatchingBioPolymersWithSetMods.Select(p => p.Peptide.Parent.Accession).ToList();
var betaProteins = csm.BetaPeptide.BestMatchingBioPolymersWithSetMods.Select(p => p.Peptide.Parent.Accession).ToList();
var alphaProteins = csm.BestMatchingBioPolymersWithSetMods.Select(p => p.WithSetMods.Parent.Accession).ToList();
var betaProteins = csm.BetaPeptide.BestMatchingBioPolymersWithSetMods.Select(p => p.WithSetMods.Parent.Accession).ToList();

foreach (var alpha in alphaProteins)
{
Expand Down Expand Up @@ -373,7 +373,7 @@ public override string ToString()
}

sb.Append("\t"); //Intentionally left empty for readability in the tsv file.
List<PeptideWithSetModifications> pepsWithMods = BestMatchingBioPolymersWithSetMods.Select(p => p.Peptide as PeptideWithSetModifications).ToList();
List<PeptideWithSetModifications> pepsWithMods = BestMatchingBioPolymersWithSetMods.Select(p => p.WithSetMods as PeptideWithSetModifications).ToList();
var proteinAccessionString = Accession ?? PsmTsvWriter.Resolve(pepsWithMods.Select(b => b.Protein.Accession), FullSequence).ResolvedString;
sb.Append(proteinAccessionString + "\t");
sb.Append(XlProteinPos + (XlProteinPosLoop.HasValue ? "~" + XlProteinPosLoop.Value : null) + "\t");
Expand Down Expand Up @@ -422,7 +422,7 @@ public override string ToString()
if (BetaPeptide != null)
{
sb.Append("\t"); //Intentionally left empty for readability in the tsv file.
List<PeptideWithSetModifications> betaPepsWithMods = BetaPeptide.BestMatchingBioPolymersWithSetMods.Select(p => p.Peptide as PeptideWithSetModifications).ToList();
List<PeptideWithSetModifications> betaPepsWithMods = BetaPeptide.BestMatchingBioPolymersWithSetMods.Select(p => p.WithSetMods as PeptideWithSetModifications).ToList();
var betaProteinAccessionString = BetaPeptide.Accession ?? PsmTsvWriter.Resolve(betaPepsWithMods.Select(b => b.Protein.Accession), FullSequence).ResolvedString;
sb.Append(betaProteinAccessionString + "\t");
sb.Append(BetaPeptide.XlProteinPos + "\t");
Expand Down
4 changes: 2 additions & 2 deletions MetaMorpheus/EngineLayer/FdrAnalysis/FdrAnalysisEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,10 @@ public void CalculateQValue(List<SpectralMatch> psms, bool peptideLevelCalculati
// e.g. if the PSM matched to 1 target and 2 decoys, it counts as 2/3 decoy
double decoyHits = 0;
double totalHits = 0;
var hits = psm.BestMatchingBioPolymersWithSetMods.GroupBy(p => p.Peptide.FullSequence);
var hits = psm.BestMatchingBioPolymersWithSetMods.GroupBy(p => p.FullSequence);
foreach (var hit in hits)
{
if (hit.First().Peptide.Parent.IsDecoy)
if (hit.First().IsDecoy)
{
decoyHits++;
}
Expand Down
Loading
Loading