Skip to content

Commit 3d0a4e4

Browse files
trishortsMICHAEL SHORTREED
andauthored
Top down biomarker III (#626)
* correct Within calculation * update unit tests * first correct top-down biomarker test * remove unused test code * quotable protease * unquotable * add full length proteoform proteolysis products for biomarker search with unit tests * new strategy for adding proteolysis products * more complete biomarker addition * works for protein.xml databases * add unit test biomarkers with xml database * clean up * more clean up * fix unit test * adjust biomarker generation for three initiator methionine behaviors (cleave, retain, variable) * make sure decoy biomarkers for standard xml proteolysis products are generated * deal appropriately w/ n-terminal methionine cleavage * last litle unit test tweaks * delete unused code * add biomarkers during protein database load * greater clarity for biomarker proteolysis product entries * change digest for top-down biomarker search to resolve issues in MM * bro. shouldn't have been that hard * cleanup * add unit test * don't need to cover unit tests with unit tests * increase unit test coverage of protein.cs * codemaid * biomarkers on protein with no methionine * unit test booster * ACs comments * more summary statemsn * deleted mzlib.sln scarry * delete empty line * c-terminal products w/ and w/o methionine * delete remaining initiator meth behavior dependances * remove reference to meth behavior in biomarker test functions * fix effected unit tests * fix more unit tests * Biomarkers changed to Truncations * Biomarker to truncation * added method summaries * MsDataScan tests to boost coverage * more MsDataScan tests * more MsDataFile tests * delete unused comment Co-authored-by: MICHAEL SHORTREED <mrshortreed@wisc.edu>
1 parent b6f3851 commit 3d0a4e4

File tree

8 files changed

+211
-282
lines changed

8 files changed

+211
-282
lines changed

mzLib/Proteomics/Protein/Protein.cs

Lines changed: 50 additions & 134 deletions
Large diffs are not rendered by default.

mzLib/Proteomics/ProteolyticDigestion/Protease.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public CleavageSpecificity GetCleavageSpecificity(Protein protein, int startInde
9292
/// <param name="maxPeptideLength"></param>
9393
/// <returns></returns>
9494
internal List<ProteolyticPeptide> GetUnmodifiedPeptides(Protein protein, int maximumMissedCleavages, InitiatorMethionineBehavior initiatorMethionineBehavior,
95-
int minPeptideLength, int maxPeptideLength, Protease specificProtease, bool topDownBiomarkerSearch = false)
95+
int minPeptideLength, int maxPeptideLength, Protease specificProtease, bool topDownTruncationSearch = false)
9696
{
9797
List<ProteolyticPeptide> peptides = new List<ProteolyticPeptide>();
9898

@@ -111,7 +111,7 @@ internal List<ProteolyticPeptide> GetUnmodifiedPeptides(Protein protein, int max
111111
//top-down
112112
else if (CleavageSpecificity == CleavageSpecificity.None)
113113
{
114-
if (!topDownBiomarkerSearch)//standard top-down
114+
if (!topDownTruncationSearch)//standard top-down
115115
{
116116
// retain methionine
117117
if ((initiatorMethionineBehavior != InitiatorMethionineBehavior.Cleave || protein[0] != 'M')

mzLib/Proteomics/ProteolyticDigestion/ProteinDigestion.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,9 @@ public IEnumerable<ProteolyticPeptide> SpeedySemiSpecificDigestion(Protein prote
232232
/// </summary>
233233
/// <param name="protein"></param>
234234
/// <returns></returns>
235-
public IEnumerable<ProteolyticPeptide> Digestion(Protein protein, bool topDownBiomarkerSearch = false)
235+
public IEnumerable<ProteolyticPeptide> Digestion(Protein protein, bool topDownTruncationSearch = false)
236236
{
237-
return Protease.GetUnmodifiedPeptides(protein, MaximumMissedCleavages, InitiatorMethionineBehavior, MinPeptideLength, MaxPeptideLength, DigestionParams.SpecificProtease, topDownBiomarkerSearch);
237+
return Protease.GetUnmodifiedPeptides(protein, MaximumMissedCleavages, InitiatorMethionineBehavior, MinPeptideLength, MaxPeptideLength, DigestionParams.SpecificProtease, topDownTruncationSearch);
238238
}
239239
}
240240
}

mzLib/Test/TestDigestionMotif.cs

Lines changed: 57 additions & 70 deletions
Large diffs are not rendered by default.

mzLib/Test/TestMsDataFile.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,37 @@ public void DataFileTest()
144144
Assert.AreEqual(0, ok3);
145145
}
146146

147+
[Test]
148+
public void TestFunctionsOfMsDataScan()
149+
{
150+
MsDataScan theSpectrum = new MsDataScan(_mzSpectrumA, 1, 1, true, Polarity.Positive, 1, new MzRange(300, 1000), "fake scan filter", MZAnalyzerType.Unknown, _mzSpectrumA.SumOfAllY, 1, null, "scan=1");
151+
List<IsotopicEnvelope> isolatedMassesAndCharges = theSpectrum.GetIsolatedMassesAndCharges(_mzSpectrumA, 1, 10, 10, 1).ToList();
152+
Assert.AreEqual(0, isolatedMassesAndCharges.Count); //Isolation range is null, so we get an empty set
153+
154+
Assert.Throws<MzLibException>(() => theSpectrum.RefineSelectedMzAndIntensity(_mzSpectrumA)); //no isolation Mz throws error
155+
156+
theSpectrum.SetOneBasedPrecursorScanNumber(6);
157+
Assert.AreEqual(6, theSpectrum.OneBasedPrecursorScanNumber);
158+
159+
theSpectrum.SetNativeID("bubba");
160+
Assert.AreEqual("bubba", theSpectrum.NativeId);
161+
162+
theSpectrum.SetIsolationMz(42);
163+
Assert.AreEqual(42, theSpectrum.IsolationMz);
164+
}
165+
166+
[Test]
167+
public void MoreMsDataFilesTests()
168+
{
169+
MsDataFile fakeDataFile = new MsDataFile(new MsDataScan[1], new SourceFile(@"scan number only nativeID format", "mzML format", null, "SHA-1", @"C:\fake.mzML", null));
170+
Assert.AreEqual(1, fakeDataFile.NumSpectra);
171+
Assert.AreEqual("scan number only nativeID format", fakeDataFile.SourceFile.NativeIdFormat);
172+
Assert.AreEqual("mzML format", fakeDataFile.SourceFile.MassSpectrometerFileFormat);
173+
Assert.IsNull(fakeDataFile.SourceFile.CheckSum);
174+
Assert.AreEqual("SHA-1", fakeDataFile.SourceFile.FileChecksumType);
175+
Assert.IsNull(fakeDataFile.SourceFile.Id);
176+
}
177+
147178
[Test]
148179
public void TestAMoreRealFile()
149180
{

mzLib/Test/TestPeptideWithSetMods.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -931,30 +931,30 @@ public static void CountTargetsWithMatchingDecoys()
931931
}
932932

933933
[Test]
934-
public static void TestPeptideWithSetModsReturnsBiomarkersInTopDown()
934+
public static void TestPeptideWithSetModsReturnsTruncationsInTopDown()
935935
{
936936
string xmlDatabase = Path.Combine(TestContext.CurrentContext.TestDirectory, "DataFiles", "humanInsulin.xml");
937937

938938
Protein insulin = ProteinDbLoader.LoadProteinXML(xmlDatabase, true,
939-
DecoyType.None, null, false, null, out var unknownModifications, addBiomarkers: true)[0];
939+
DecoyType.None, null, false, null, out var unknownModifications, addTruncations: true)[0];
940940

941941
Protease protease = new Protease("top-down", CleavageSpecificity.None, "", "", new List<DigestionMotif>(), null);
942-
List<PeptideWithSetModifications> insulinBiomarkers = insulin.Digest(new DigestionParams(protease: protease.Name), new List<Modification>(), new List<Modification>(), topDownBiomarkerSearch: true).ToList();
943-
Assert.AreEqual(56, insulinBiomarkers.Count);
942+
List<PeptideWithSetModifications> insulinTruncations = insulin.Digest(new DigestionParams(protease: protease.Name), new List<Modification>(), new List<Modification>(), topDownTruncationSearch: true).ToList();
943+
Assert.AreEqual(68, insulinTruncations.Count);
944944
}
945945

946946
[Test]
947-
public static void TestPeptideWithSetModsReturnsDecoyBiomarkersInTopDown()
947+
public static void TestPeptideWithSetModsReturnsDecoyTruncationsInTopDown()
948948
{
949949
string xmlDatabase = Path.Combine(TestContext.CurrentContext.TestDirectory, "DataFiles", "humanInsulin.xml");
950950
List<Protein> insulinProteins = ProteinDbLoader.LoadProteinXML(xmlDatabase, true,
951-
DecoyType.Reverse, null, false, null, out var unknownModifications, addBiomarkers: true);
951+
DecoyType.Reverse, null, false, null, out var unknownModifications, addTruncations: true);
952952

953953
Protease protease = new Protease("top-down", CleavageSpecificity.None, "", "", new List<DigestionMotif>(), null);
954-
List<PeptideWithSetModifications> insulintTargetBiomarkers = insulinProteins.Where(p=>!p.IsDecoy).First().Digest(new DigestionParams(protease: protease.Name), new List<Modification>(), new List<Modification>(), topDownBiomarkerSearch: true).ToList();
955-
Assert.AreEqual(56, insulintTargetBiomarkers.Count);
956-
List<PeptideWithSetModifications> insulintDecoyBiomarkers = insulinProteins.Where(p => p.IsDecoy).First().Digest(new DigestionParams(protease: protease.Name), new List<Modification>(), new List<Modification>(), topDownBiomarkerSearch: true).ToList();
957-
Assert.AreEqual(56, insulintDecoyBiomarkers.Count);
954+
List<PeptideWithSetModifications> insulintTargetTruncations = insulinProteins.Where(p=>!p.IsDecoy).First().Digest(new DigestionParams(protease: protease.Name), new List<Modification>(), new List<Modification>(), topDownTruncationSearch: true).ToList();
955+
Assert.AreEqual(68, insulintTargetTruncations.Count);
956+
List<PeptideWithSetModifications> insulintDecoyTruncations = insulinProteins.Where(p => p.IsDecoy).First().Digest(new DigestionParams(protease: protease.Name), new List<Modification>(), new List<Modification>(), topDownTruncationSearch: true).ToList();
957+
Assert.AreEqual(68, insulintDecoyTruncations.Count);
958958
}
959959

960960
[Test]

0 commit comments

Comments
 (0)