Skip to content

Commit 1543412

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 c76418c commit 1543412

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
@@ -247,8 +247,10 @@ public static void TestModificationInfoListInProteinGroupsOutput()
247247
Assert.That(totalNumberOfMods, Is.EqualTo(4));
248248

249249
List<string> proteinGroupsOutput = File.ReadAllLines(Path.Combine(outputFolder, "task2", "AllQuantifiedProteinGroups.tsv")).ToList();
250-
string firstDataLine = proteinGroupsOutput[2];
251-
string modInfoListProteinTwo = firstDataLine.Split('\t')[14];
250+
string testDataLine = proteinGroupsOutput.Where(x => x.StartsWith("P10591")).First();
251+
string modInfoListProteinTwo = testDataLine.Split('\t')[14];
252+
253+
Assert.That(8, Is.EqualTo(proteinGroupsOutput.Count));
252254
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)]}" +
253255
"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)]}"));
254256

0 commit comments

Comments
 (0)