Skip to content

Commit bd8a7d4

Browse files
committed
Fixes to code for remaining tests. TestModificationInfoListProteinGroupsOutput() was not consistent when run individually vs when run with all other tests. The ordering of the output was changing. Fixed to not look for the first data line but rather for the one with the right PG.
1 parent 8de1426 commit bd8a7d4

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

MetaMorpheus/EngineLayer/ProteinParsimony/ProteinGroup.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public string GetTabSeparatedHeader()
170170
sb.Append("Fragment Sequence Coverage" + '\t');
171171
//sb.Append("Modification Info List" + "\t");
172172

173-
if (FilesForQuantification != null)
173+
if (IntensitiesByFile != null && FilesForQuantification != null)
174174
{
175175
bool unfractionated = FilesForQuantification.Select(p => p.Fraction).Distinct().Count() == 1;
176176
bool conditionsUndefined = FilesForQuantification.All(p => string.IsNullOrEmpty(p.Condition));
@@ -204,8 +204,12 @@ public string GetTabSeparatedHeader()
204204
}
205205
}
206206
}
207+
else
208+
{
209+
sb.Append("\t");
210+
}
207211

208-
sb.Append("Number of PSMs" + '\t');
212+
sb.Append("Number of PSMs" + '\t');
209213
sb.Append("Protein Decoy/Contaminant/Target" + '\t');
210214
sb.Append("Protein Cumulative Target" + '\t');
211215
sb.Append("Protein Cumulative Decoy" + '\t');

MetaMorpheus/Test/ProteinGroupTest.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,10 @@ public static void TestModificationInfoListInProteinGroupsOutput()
248248
Assert.That(totalNumberOfMods, Is.EqualTo(4));
249249

250250
List<string> proteinGroupsOutput = File.ReadAllLines(Path.Combine(outputFolder, "task2", "AllQuantifiedProteinGroups.tsv")).ToList();
251-
string firstDataLine = proteinGroupsOutput[2];
252-
string modInfoListProteinTwo = firstDataLine.Split('\t')[14];
251+
string testDataLine = proteinGroupsOutput.Where(x => x.StartsWith("P10591")).First();
252+
string modInfoListProteinTwo = testDataLine.Split('\t')[14];
253+
254+
Assert.That(8, Is.EqualTo(proteinGroupsOutput.Count));
253255
Assert.That(modInfoListProteinTwo, Is.EqualTo("P10591:{M#65[Common Variable:Oxidation on M, info: occupancy=1.0000(654315.977066199)]S#71[Less Common:Oxidation on S, info: occupancy=0.1957(654315.977066199)]}" +
254256
"P10592:{M#65[Common Variable:Oxidation on M, info: occupancy=1.0000(654315.977066199)]S#71[Less Common:Oxidation on S, info: occupancy=0.1957(654315.977066199)]}"));
255257

0 commit comments

Comments
 (0)