Skip to content

Commit a0c2708

Browse files
author
stefanks
authored
Merge pull request #212 from smith-chem-wisc/StefanBranch
Stefan branch
2 parents e27ceb3 + 87e9b86 commit a0c2708

Some content is hidden

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

66 files changed

+39319
-26369
lines changed

CMD/CMD.csproj

+20-16
Original file line numberDiff line numberDiff line change
@@ -35,36 +35,40 @@
3535
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
3636
</PropertyGroup>
3737
<ItemGroup>
38-
<Reference Include="Chemistry, Version=1.0.78.0, Culture=neutral, processorArchitecture=AMD64">
39-
<HintPath>..\packages\mzLib.1.0.78\lib\Chemistry.dll</HintPath>
38+
<Reference Include="Chemistry, Version=1.0.90.0, Culture=neutral, processorArchitecture=AMD64">
39+
<HintPath>..\packages\mzLib.1.0.90\lib\Chemistry.dll</HintPath>
4040
<Private>True</Private>
4141
</Reference>
42-
<Reference Include="MassSpectrometry, Version=1.0.78.0, Culture=neutral, processorArchitecture=AMD64">
43-
<HintPath>..\packages\mzLib.1.0.78\lib\MassSpectrometry.dll</HintPath>
42+
<Reference Include="MassSpectrometry, Version=1.0.90.0, Culture=neutral, processorArchitecture=AMD64">
43+
<HintPath>..\packages\mzLib.1.0.90\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.78.0, Culture=neutral, processorArchitecture=AMD64">
51-
<HintPath>..\packages\mzLib.1.0.78\lib\mzIdentML.dll</HintPath>
50+
<Reference Include="mzIdentML, Version=1.0.90.0, Culture=neutral, processorArchitecture=AMD64">
51+
<HintPath>..\packages\mzLib.1.0.90\lib\mzIdentML.dll</HintPath>
5252
<Private>True</Private>
5353
</Reference>
54-
<Reference Include="MzML, Version=1.0.78.0, Culture=neutral, processorArchitecture=AMD64">
55-
<HintPath>..\packages\mzLib.1.0.78\lib\MzML.dll</HintPath>
54+
<Reference Include="MzLibUtil, Version=1.0.90.0, Culture=neutral, processorArchitecture=AMD64">
55+
<HintPath>..\packages\mzLib.1.0.90\lib\MzLibUtil.dll</HintPath>
56+
<Private>True</Private>
57+
</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>
5660
<Private>True</Private>
5761
</Reference>
5862
<Reference Include="NetSerializer, Version=4.1.0.0, Culture=neutral, processorArchitecture=MSIL">
5963
<HintPath>..\packages\NetSerializer.4.1.0\lib\net45\NetSerializer.dll</HintPath>
6064
<Private>True</Private>
6165
</Reference>
62-
<Reference Include="Proteomics, Version=1.0.78.0, Culture=neutral, processorArchitecture=AMD64">
63-
<HintPath>..\packages\mzLib.1.0.78\lib\Proteomics.dll</HintPath>
66+
<Reference Include="Proteomics, Version=1.0.90.0, Culture=neutral, processorArchitecture=AMD64">
67+
<HintPath>..\packages\mzLib.1.0.90\lib\Proteomics.dll</HintPath>
6468
<Private>True</Private>
6569
</Reference>
66-
<Reference Include="Spectra, Version=1.0.78.0, Culture=neutral, processorArchitecture=AMD64">
67-
<HintPath>..\packages\mzLib.1.0.78\lib\Spectra.dll</HintPath>
70+
<Reference Include="Spectra, Version=1.0.90.0, Culture=neutral, processorArchitecture=AMD64">
71+
<HintPath>..\packages\mzLib.1.0.90\lib\Spectra.dll</HintPath>
6872
<Private>True</Private>
6973
</Reference>
7074
<Reference Include="System" />
@@ -76,12 +80,12 @@
7680
<Reference Include="System.Data" />
7781
<Reference Include="System.Net.Http" />
7882
<Reference Include="System.Xml" />
79-
<Reference Include="Thermo, Version=1.0.78.0, Culture=neutral, processorArchitecture=AMD64">
80-
<HintPath>..\packages\mzLib.1.0.78\lib\Thermo.dll</HintPath>
83+
<Reference Include="Thermo, Version=1.0.90.0, Culture=neutral, processorArchitecture=AMD64">
84+
<HintPath>..\packages\mzLib.1.0.90\lib\Thermo.dll</HintPath>
8185
<Private>True</Private>
8286
</Reference>
83-
<Reference Include="UsefulProteomicsDatabases, Version=1.0.78.0, Culture=neutral, processorArchitecture=AMD64">
84-
<HintPath>..\packages\mzLib.1.0.78\lib\UsefulProteomicsDatabases.dll</HintPath>
87+
<Reference Include="UsefulProteomicsDatabases, Version=1.0.90.0, Culture=neutral, processorArchitecture=AMD64">
88+
<HintPath>..\packages\mzLib.1.0.90\lib\UsefulProteomicsDatabases.dll</HintPath>
8589
<Private>True</Private>
8690
</Reference>
8791
<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.78" targetFramework="net451" />
4+
<package id="mzLib" version="1.0.90" 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

+19-15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using MassSpectrometry;
2+
using MzLibUtil;
23
using Proteomics;
34
using Spectra;
45
using System;
@@ -21,12 +22,12 @@ public class AnalysisEngine : MyEngine
2122
private readonly int maxModIsoforms;
2223
private readonly PsmParent[][] newPsms;
2324
private readonly List<Protein> proteinList;
24-
private readonly List<MetaMorpheusModification> variableModifications;
25-
private readonly List<MetaMorpheusModification> fixedModifications;
26-
private readonly List<MetaMorpheusModification> localizeableModifications;
25+
private readonly List<ModificationWithMass> variableModifications;
26+
private readonly List<ModificationWithMass> fixedModifications;
27+
private readonly List<ModificationWithMass> localizeableModifications;
2728
private readonly Protease protease;
2829
private readonly List<SearchMode> searchModes;
29-
private readonly IMsDataFile<IMzSpectrum<MzPeak>> myMsDataFile;
30+
private readonly IMsDataFile<IMsDataScan<IMzSpectrum<IMzPeak>>> myMsDataFile;
3031
private readonly Tolerance fragmentTolerance;
3132
private readonly Action<BinTreeStructure, string> writeHistogramPeaksAction;
3233
private readonly Action<List<NewPsmWithFdr>, string> writePsmsAction;
@@ -40,7 +41,7 @@ public class AnalysisEngine : MyEngine
4041

4142
#region Public Constructors
4243

43-
public AnalysisEngine(PsmParent[][] newPsms, Dictionary<CompactPeptide, HashSet<PeptideWithSetModifications>> compactPeptideToProteinPeptideMatching, List<Protein> proteinList, List<MetaMorpheusModification> variableModifications, List<MetaMorpheusModification> fixedModifications, List<MetaMorpheusModification> localizeableModifications, Protease protease, List<SearchMode> searchModes, IMsDataFile<IMzSpectrum<MzPeak>> 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) : base(2)
4445
{
4546
this.doParsimony = doParsimony;
4647
this.doHistogramAnalysis = doHistogramAnalysis;
@@ -203,8 +204,8 @@ public Dictionary<CompactPeptide, HashSet<PeptideWithSetModifications>> ApplyPro
203204
{
204205
HashSet<Protein> proteinsWithThisBaseSeq;
205206
peptideBaseSeqProteinListMatch.TryGetValue(newBaseSeq, out proteinsWithThisBaseSeq);
206-
207-
foreach(var protein in proteinsWithThisBaseSeq)
207+
208+
foreach (var protein in proteinsWithThisBaseSeq)
208209
{
209210
HashSet<CompactPeptide> t;
210211
proteinToPeptidesMatching.TryGetValue(protein, out t);
@@ -728,12 +729,13 @@ private static void IdentifyUnimodBins(BinTreeStructure myTreeStructure, double
728729
{
729730
var ok = new HashSet<string>();
730731
var okformula = new HashSet<string>();
731-
foreach (var hm in UnimodDeserialized.modifications)
732+
foreach (var hm in UnimodDeserialized)
732733
{
733-
if (Math.Abs(hm.mono_mass - bin.MassShift) <= v)
734+
var theMod = hm as ModificationWithMassAndCf;
735+
if (Math.Abs(theMod.monoisotopicMass - bin.MassShift) <= v)
734736
{
735-
ok.Add(hm.full_name);
736-
okformula.Add(hm.composition);
737+
ok.Add(hm.id);
738+
okformula.Add(theMod.chemicalFormula.Formula);
737739
}
738740
}
739741
bin.UnimodId = string.Join(" or ", ok);
@@ -748,10 +750,12 @@ private static void IdentifyUniprotBins(BinTreeStructure myTreeStructure, double
748750
var ok = new HashSet<string>();
749751
foreach (var hm in UniprotDeseralized)
750752
{
751-
if (Math.Abs(hm.Value.MonoisotopicMass - bin.MassShift) <= v)
752-
{
753-
ok.Add(hm.Value.NameAndSites);
754-
}
753+
var theMod = hm as ModificationWithMass;
754+
if (theMod != null)
755+
if (Math.Abs(theMod.monoisotopicMass - bin.MassShift) <= v)
756+
{
757+
ok.Add(hm.id);
758+
}
755759
}
756760
bin.uniprotID = string.Join(" or ", ok);
757761
}

0 commit comments

Comments
 (0)