Skip to content

Commit c9cb2da

Browse files
author
stefanks
authored
Merge pull request #215 from smith-chem-wisc/StefanBranch
mhm
2 parents a0c2708 + 54f018b commit c9cb2da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+320
-356
lines changed

CMD/CMD.csproj

+18-18
Original file line numberDiff line numberDiff line change
@@ -35,40 +35,40 @@
3535
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
3636
</PropertyGroup>
3737
<ItemGroup>
38-
<Reference Include="Chemistry, Version=1.0.90.0, Culture=neutral, processorArchitecture=AMD64">
39-
<HintPath>..\packages\mzLib.1.0.90\lib\Chemistry.dll</HintPath>
38+
<Reference Include="Chemistry, Version=1.0.91.0, Culture=neutral, processorArchitecture=AMD64">
39+
<HintPath>..\packages\mzLib.1.0.91\lib\Chemistry.dll</HintPath>
4040
<Private>True</Private>
4141
</Reference>
42-
<Reference Include="MassSpectrometry, Version=1.0.90.0, Culture=neutral, processorArchitecture=AMD64">
43-
<HintPath>..\packages\mzLib.1.0.90\lib\MassSpectrometry.dll</HintPath>
42+
<Reference Include="MassSpectrometry, Version=1.0.91.0, Culture=neutral, processorArchitecture=AMD64">
43+
<HintPath>..\packages\mzLib.1.0.91\lib\MassSpectrometry.dll</HintPath>
4444
<Private>True</Private>
4545
</Reference>
4646
<Reference Include="MathNet.Numerics, Version=3.17.0.0, Culture=neutral, processorArchitecture=MSIL">
4747
<HintPath>..\packages\MathNet.Numerics.3.17.0\lib\net40\MathNet.Numerics.dll</HintPath>
4848
<Private>True</Private>
4949
</Reference>
50-
<Reference Include="mzIdentML, Version=1.0.90.0, Culture=neutral, processorArchitecture=AMD64">
51-
<HintPath>..\packages\mzLib.1.0.90\lib\mzIdentML.dll</HintPath>
50+
<Reference Include="mzIdentML, Version=1.0.91.0, Culture=neutral, processorArchitecture=AMD64">
51+
<HintPath>..\packages\mzLib.1.0.91\lib\mzIdentML.dll</HintPath>
5252
<Private>True</Private>
5353
</Reference>
54-
<Reference Include="MzLibUtil, Version=1.0.90.0, Culture=neutral, processorArchitecture=AMD64">
55-
<HintPath>..\packages\mzLib.1.0.90\lib\MzLibUtil.dll</HintPath>
54+
<Reference Include="MzLibUtil, Version=1.0.91.0, Culture=neutral, processorArchitecture=AMD64">
55+
<HintPath>..\packages\mzLib.1.0.91\lib\MzLibUtil.dll</HintPath>
5656
<Private>True</Private>
5757
</Reference>
58-
<Reference Include="MzML, Version=1.0.90.0, Culture=neutral, processorArchitecture=AMD64">
59-
<HintPath>..\packages\mzLib.1.0.90\lib\MzML.dll</HintPath>
58+
<Reference Include="MzML, Version=1.0.91.0, Culture=neutral, processorArchitecture=AMD64">
59+
<HintPath>..\packages\mzLib.1.0.91\lib\MzML.dll</HintPath>
6060
<Private>True</Private>
6161
</Reference>
6262
<Reference Include="NetSerializer, Version=4.1.0.0, Culture=neutral, processorArchitecture=MSIL">
6363
<HintPath>..\packages\NetSerializer.4.1.0\lib\net45\NetSerializer.dll</HintPath>
6464
<Private>True</Private>
6565
</Reference>
66-
<Reference Include="Proteomics, Version=1.0.90.0, Culture=neutral, processorArchitecture=AMD64">
67-
<HintPath>..\packages\mzLib.1.0.90\lib\Proteomics.dll</HintPath>
66+
<Reference Include="Proteomics, Version=1.0.91.0, Culture=neutral, processorArchitecture=AMD64">
67+
<HintPath>..\packages\mzLib.1.0.91\lib\Proteomics.dll</HintPath>
6868
<Private>True</Private>
6969
</Reference>
70-
<Reference Include="Spectra, Version=1.0.90.0, Culture=neutral, processorArchitecture=AMD64">
71-
<HintPath>..\packages\mzLib.1.0.90\lib\Spectra.dll</HintPath>
70+
<Reference Include="Spectra, Version=1.0.91.0, Culture=neutral, processorArchitecture=AMD64">
71+
<HintPath>..\packages\mzLib.1.0.91\lib\Spectra.dll</HintPath>
7272
<Private>True</Private>
7373
</Reference>
7474
<Reference Include="System" />
@@ -80,12 +80,12 @@
8080
<Reference Include="System.Data" />
8181
<Reference Include="System.Net.Http" />
8282
<Reference Include="System.Xml" />
83-
<Reference Include="Thermo, Version=1.0.90.0, Culture=neutral, processorArchitecture=AMD64">
84-
<HintPath>..\packages\mzLib.1.0.90\lib\Thermo.dll</HintPath>
83+
<Reference Include="Thermo, Version=1.0.91.0, Culture=neutral, processorArchitecture=AMD64">
84+
<HintPath>..\packages\mzLib.1.0.91\lib\Thermo.dll</HintPath>
8585
<Private>True</Private>
8686
</Reference>
87-
<Reference Include="UsefulProteomicsDatabases, Version=1.0.90.0, Culture=neutral, processorArchitecture=AMD64">
88-
<HintPath>..\packages\mzLib.1.0.90\lib\UsefulProteomicsDatabases.dll</HintPath>
87+
<Reference Include="UsefulProteomicsDatabases, Version=1.0.91.0, Culture=neutral, processorArchitecture=AMD64">
88+
<HintPath>..\packages\mzLib.1.0.91\lib\UsefulProteomicsDatabases.dll</HintPath>
8989
<Private>True</Private>
9090
</Reference>
9191
<Reference Include="Zlib.Portable, Version=1.11.0.0, Culture=neutral, processorArchitecture=MSIL">

CMD/packages.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="MathNet.Numerics" version="3.17.0" targetFramework="net451" />
4-
<package id="mzLib" version="1.0.90" targetFramework="net451" />
4+
<package id="mzLib" version="1.0.91" targetFramework="net451" />
55
<package id="NetSerializer" version="4.1.0" targetFramework="net451" />
66
<package id="Zlib.Portable" version="1.11.0" targetFramework="net451" />
77
</packages>

EngineLayer/Analysis/AnalysisEngine.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class AnalysisEngine : MyEngine
4141

4242
#region Public Constructors
4343

44-
public AnalysisEngine(PsmParent[][] newPsms, Dictionary<CompactPeptide, HashSet<PeptideWithSetModifications>> compactPeptideToProteinPeptideMatching, List<Protein> proteinList, List<ModificationWithMass> variableModifications, List<ModificationWithMass> fixedModifications, List<ModificationWithMass> localizeableModifications, Protease protease, List<SearchMode> searchModes, IMsDataFile<IMsDataScan<IMzSpectrum<IMzPeak>>> myMSDataFile, Tolerance fragmentTolerance, Action<BinTreeStructure, string> action1, Action<List<NewPsmWithFdr>, string> action2, Action<List<ProteinGroup>, string> action3, bool doParsimony, int maximumMissedCleavages, int maxModIsoforms, bool doHistogramAnalysis, List<ProductType> lp, double binTol) : base(2)
44+
public AnalysisEngine(PsmParent[][] newPsms, Dictionary<CompactPeptide, HashSet<PeptideWithSetModifications>> compactPeptideToProteinPeptideMatching, List<Protein> proteinList, List<ModificationWithMass> variableModifications, List<ModificationWithMass> fixedModifications, List<ModificationWithMass> localizeableModifications, Protease protease, List<SearchMode> searchModes, IMsDataFile<IMsDataScan<IMzSpectrum<IMzPeak>>> myMSDataFile, Tolerance fragmentTolerance, Action<BinTreeStructure, string> action1, Action<List<NewPsmWithFdr>, string> action2, Action<List<ProteinGroup>, string> action3, bool doParsimony, int maximumMissedCleavages, int maxModIsoforms, bool doHistogramAnalysis, List<ProductType> lp, double binTol)
4545
{
4646
this.doParsimony = doParsimony;
4747
this.doHistogramAnalysis = doHistogramAnalysis;
@@ -974,7 +974,7 @@ private void AddObservedPeptidesToDictionary()
974974
if (peptide.Length == 1 || peptide.Length > byte.MaxValue - 2) // 2 is for indexing terminal modifications
975975
continue;
976976

977-
var ListOfModifiedPeptides = peptide.GetPeptideWithSetModifications(variableModifications, maxModIsoforms, max_mods_for_peptide).ToList();
977+
var ListOfModifiedPeptides = peptide.GetPeptidesWithSetModifications(variableModifications, maxModIsoforms, max_mods_for_peptide).ToList();
978978
foreach (var yyy in ListOfModifiedPeptides)
979979
{
980980
HashSet<PeptideWithSetModifications> v;

EngineLayer/Analysis/AnalysisResults.cs

+16-18
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,28 @@ public AnalysisResults(AnalysisEngine s, List<NewPsmWithFdr>[] allResultingIdent
2626

2727
#region Protected Properties
2828

29-
protected override string StringForOutput
29+
public override string ToString()
3030
{
31-
get
32-
{
33-
var sb = new StringBuilder();
34-
sb.Append("\t\tAll PSMS within 1% FDR: " + string.Join(", ", AllResultingIdentifications.Select(b => b.Count(c => c.qValue <= 0.01))));
31+
var sb = new StringBuilder();
32+
sb.AppendLine(base.ToString());
33+
sb.Append("\t\tAll PSMS within 1% FDR: " + string.Join(", ", AllResultingIdentifications.Select(b => b.Count(c => c.qValue <= 0.01))));
3534

36-
var check = ProteinGroups.Where(s => s != null);
37-
if (check.Any())
35+
var check = ProteinGroups.Where(s => s != null);
36+
if (check.Any())
37+
{
38+
var numProteinsList = new List<int>();
39+
for (int i = 0; i < ProteinGroups.Length; i++)
3840
{
39-
var numProteinsList = new List<int>();
40-
for(int i = 0; i < ProteinGroups.Length; i++)
41-
{
42-
if (ProteinGroups[i] == null)
43-
numProteinsList.Add(0);
44-
else
45-
numProteinsList.Add(ProteinGroups[i].Count(c => c.QValue <= 0.01));
46-
}
47-
48-
sb.Append("\n\t\tAll proteins within 1% FDR: " + string.Join(", ", numProteinsList));
41+
if (ProteinGroups[i] == null)
42+
numProteinsList.Add(0);
43+
else
44+
numProteinsList.Add(ProteinGroups[i].Count(c => c.QValue <= 0.01));
4945
}
5046

51-
return sb.ToString();
47+
sb.Append("\n\t\tAll proteins within 1% FDR: " + string.Join(", ", numProteinsList));
5248
}
49+
50+
return sb.ToString();
5351
}
5452

5553
#endregion Protected Properties

EngineLayer/CalibrationEngine/CalibrationEngine.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class CalibrationEngine : MyEngine
3333

3434
#region Public Constructors
3535

36-
public CalibrationEngine(IMsDataFile<IMsDataScan<IMzSpectrum<IMzPeak>>> myMSDataFile, int randomSeed, Tolerance mzToleranceForMs2Search, List<NewPsmWithFdr> identifications, int minMS1IsotopicPeaksNeededForConfirmedIdentification, int minMS2IsotopicPeaksNeededForConfirmedIdentification, int numFragmentsNeededForEveryIdentification, Tolerance mzToleranceForMS1Search, FragmentTypes fragmentTypesForCalibration) : base(2)
36+
public CalibrationEngine(IMsDataFile<IMsDataScan<IMzSpectrum<IMzPeak>>> myMSDataFile, int randomSeed, Tolerance mzToleranceForMs2Search, List<NewPsmWithFdr> identifications, int minMS1IsotopicPeaksNeededForConfirmedIdentification, int minMS2IsotopicPeaksNeededForConfirmedIdentification, int numFragmentsNeededForEveryIdentification, Tolerance mzToleranceForMS1Search, FragmentTypes fragmentTypesForCalibration)
3737
{
3838
this.myMsDataFile = myMSDataFile;
3939
this.randomSeed = randomSeed;

EngineLayer/CalibrationEngine/CalibrationResults.cs

+15-17
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,26 @@ public CalibrationResults(IMsDataFile<IMsDataScan<IMzSpectrum<IMzPeak>>> myMSDat
4242

4343
#region Protected Properties
4444

45-
protected override string StringForOutput
45+
public override string ToString()
4646
{
47-
get
47+
var sb = new StringBuilder();
48+
sb.AppendLine(base.ToString());
49+
for (int i = 0; i < countList.Count; i++)
4850
{
49-
var sb = new StringBuilder();
50-
for (int i = 0; i < countList.Count; i++)
51+
sb.AppendLine("\t\tRound " + (i + 1));
52+
sb.AppendLine("\t\t\tTraining points: " + countList[i]);
53+
sb.AppendLine("\t\t\tMs1MassChargeSeen: " + numMs1MassChargeCombinationsConsideredList[i]);
54+
sb.AppendLine("\t\t\tMs1MassChargeSeenAndIgnoredBecause too many: " + numMs1MassChargeCombinationsThatAreIgnoredBecauseOfTooManyPeaksList[i]);
55+
sb.AppendLine("\t\t\tMs2MassChargeSeen: " + numMs2MassChargeCombinationsConsideredList[i]);
56+
sb.AppendLine("\t\t\tMs2MassChargeSeenAndIgnoredBecause too many: " + numMs2MassChargeCombinationsThatAreIgnoredBecauseOfTooManyPeaksList[i]);
57+
58+
if (i < calibrationFunctions.Count)
5159
{
52-
sb.AppendLine("\t\tRound " + (i + 1));
53-
sb.AppendLine("\t\t\tTraining points: " + countList[i]);
54-
sb.AppendLine("\t\t\tMs1MassChargeSeen: " + numMs1MassChargeCombinationsConsideredList[i]);
55-
sb.AppendLine("\t\t\tMs1MassChargeSeenAndIgnoredBecause too many: " + numMs1MassChargeCombinationsThatAreIgnoredBecauseOfTooManyPeaksList[i]);
56-
sb.AppendLine("\t\t\tMs2MassChargeSeen: " + numMs2MassChargeCombinationsConsideredList[i]);
57-
sb.AppendLine("\t\t\tMs2MassChargeSeenAndIgnoredBecause too many: " + numMs2MassChargeCombinationsThatAreIgnoredBecauseOfTooManyPeaksList[i]);
58-
59-
if (i < calibrationFunctions.Count)
60-
{
61-
sb.AppendLine("\t\t\tMs1Calibration function: " + calibrationFunctions[i].CalibrationFunction1.ToString());
62-
sb.AppendLine("\t\t\tMs2Calibration function: " + calibrationFunctions[i].CalibrationFunction2.ToString());
63-
}
60+
sb.AppendLine("\t\t\tMs1Calibration function: " + calibrationFunctions[i].CalibrationFunction1.ToString());
61+
sb.AppendLine("\t\t\tMs2Calibration function: " + calibrationFunctions[i].CalibrationFunction2.ToString());
6462
}
65-
return sb.ToString();
6663
}
64+
return sb.ToString();
6765
}
6866

6967
#endregion Protected Properties

EngineLayer/ClassicSearch/ClassicSearchEngine.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class ClassicSearchEngine : MyEngine
4444

4545
#region Public Constructors
4646

47-
public ClassicSearchEngine(LocalMS2Scan[] arrayOfSortedMS2Scans, int myMsDataFileNumSpectra, List<ModificationWithMass> variableModifications, List<ModificationWithMass> fixedModifications, List<Protein> proteinList, Tolerance productMassTolerance, Protease protease, List<SearchMode> searchModes, int maximumMissedCleavages, int maximumVariableModificationIsoforms, string fileName, List<ProductType> lp) : base(2)
47+
public ClassicSearchEngine(LocalMS2Scan[] arrayOfSortedMS2Scans, int myMsDataFileNumSpectra, List<ModificationWithMass> variableModifications, List<ModificationWithMass> fixedModifications, List<Protein> proteinList, Tolerance productMassTolerance, Protease protease, List<SearchMode> searchModes, int maximumMissedCleavages, int maximumVariableModificationIsoforms, string fileName, List<ProductType> lp)
4848
{
4949
this.arrayOfSortedMS2Scans = arrayOfSortedMS2Scans;
5050
this.myScanPrecursorMasses = arrayOfSortedMS2Scans.Select(b => b.PrecursorMass).ToArray();
@@ -98,10 +98,11 @@ protected override MyResults RunSpecific()
9898
var digestedList = protein.Digest(protease, maximumMissedCleavages, InitiatorMethionineBehavior.Variable, fixedModifications).ToList();
9999
foreach (var peptide in digestedList)
100100
{
101+
101102
if (peptide.Length == 1 || peptide.Length > byte.MaxValue - 2)
102103
continue;
103104

104-
if (peptide.OneBasedPossibleLocalizedModifications.Count == 0)
105+
if (peptide.numLocMods == 0)
105106
{
106107
var hc = peptide.BaseLeucineSequence;
107108
var observed = level3_observed.Contains(hc);
@@ -116,10 +117,10 @@ protected override MyResults RunSpecific()
116117
}
117118
}
118119

119-
var ListOfModifiedPeptides = peptide.GetPeptideWithSetModifications(variableModifications, maximumVariableModificationIsoforms, max_mods_for_peptide).ToList();
120+
var ListOfModifiedPeptides = peptide.GetPeptidesWithSetModifications(variableModifications, maximumVariableModificationIsoforms, max_mods_for_peptide).ToList();
120121
foreach (var yyy in ListOfModifiedPeptides)
121122
{
122-
if (peptide.OneBasedPossibleLocalizedModifications.Count > 0)
123+
if (peptide.numLocMods > 0)
123124
{
124125
var hc = yyy.Sequence;
125126
var observed = level4_observed.Contains(hc);

EngineLayer/ClassicSearch/ClassicSearchResults.cs

+4-6
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@ internal ClassicSearchResults(ClassicSearchEngine searchParams) : base(searchPar
2121

2222
#region Protected Properties
2323

24-
protected override string StringForOutput
24+
public override string ToString()
2525
{
26-
get
27-
{
28-
var sb = new StringBuilder();
29-
return sb.ToString();
30-
}
26+
var sb = new StringBuilder();
27+
sb.AppendLine(base.ToString());
28+
return sb.ToString();
3129
}
3230

3331
#endregion Protected Properties

0 commit comments

Comments
 (0)