Skip to content

Commit 70c3e97

Browse files
committed
Merge branch 'noMS' into 1.4.3
2 parents d876704 + f977baa commit 70c3e97

16 files changed

+521
-61330
lines changed

ThermoRawFileParser.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@
199199
<Compile Include="Query\ProxiSpectrumReader.cs" />
200200
<Compile Include="RawFileParserException.cs" />
201201
<Compile Include="RawFileParser.cs" />
202+
<Compile Include="Util\CVHelpers.cs" />
202203
<Compile Include="Util\LimitedSizeDictionary.cs" />
203204
<Compile Include="Util\MZArray.cs" />
204205
<Compile Include="Util\NativeMethods.cs" />

ThermoRawFileParserTest/OntologyMappingTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ public class OntologyMappingTests
1212
public void TestGetInstrumentModel()
1313
{
1414
// exact match
15-
var match = OntologyMapping.getInstrumentModel("LTQ Orbitrap");
15+
var match = OntologyMapping.GetInstrumentModel("LTQ Orbitrap");
1616
Assert.AreEqual("MS:1000449", match.accession);
1717
// partial match, should return the longest partial match
18-
var partialMatch = OntologyMapping.getInstrumentModel("LTQ Orbitrap XXL");
18+
var partialMatch = OntologyMapping.GetInstrumentModel("LTQ Orbitrap XXL");
1919
Assert.AreEqual("MS:1000449", partialMatch.accession);
2020
// no match, should return the generic thermo instrument
21-
var noMatch = OntologyMapping.getInstrumentModel("non existing model");
21+
var noMatch = OntologyMapping.GetInstrumentModel("non existing model");
2222
Assert.AreEqual("MS:1000483", noMatch.accession);
2323
}
2424
}

ThermoRawFileParserTest/ThermoRawFileParserTest.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,15 @@
155155
<HintPath>..\packages\mzLib.1.0.450\lib\net471\ThermoFisher.CommonCore.BackgroundSubtraction.dll</HintPath>
156156
<Private>True</Private>
157157
</Reference>
158-
<Reference Include="ThermoFisher.CommonCore.Data, Version=5.0.0.88, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
159-
<HintPath>..\packages\ThermoFisher.CommonCore.Data.5.0.0.88\lib\ThermoFisher.CommonCore.Data.dll</HintPath>
158+
<Reference Include="ThermoFisher.CommonCore.Data, Version=5.0.0.93, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
159+
<HintPath>..\packages\ThermoFisher.CommonCore.Data.5.0.0.93\lib\netstandard2.0\ThermoFisher.CommonCore.Data.dll</HintPath>
160160
</Reference>
161161
<Reference Include="ThermoFisher.CommonCore.MassPrecisionEstimator, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
162162
<HintPath>..\packages\mzLib.1.0.450\lib\net471\ThermoFisher.CommonCore.MassPrecisionEstimator.dll</HintPath>
163163
<Private>True</Private>
164164
</Reference>
165-
<Reference Include="ThermoFisher.CommonCore.RawFileReader, Version=5.0.0.88, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
166-
<HintPath>..\packages\ThermoFisher.CommonCore.RawFileReader.5.0.0.88\lib\ThermoFisher.CommonCore.RawFileReader.dll</HintPath>
165+
<Reference Include="ThermoFisher.CommonCore.RawFileReader, Version=5.0.0.93, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
166+
<HintPath>..\packages\ThermoFisher.CommonCore.RawFileReader.5.0.0.93\lib\netstandard2.0\ThermoFisher.CommonCore.RawFileReader.dll</HintPath>
167167
</Reference>
168168
<Reference Include="ThermoRawFileReader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
169169
<HintPath>..\packages\mzLib.1.0.450\lib\net471\ThermoRawFileReader.dll</HintPath>

ThermoRawFileParserTest/app.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</dependentAssembly>
1313
<dependentAssembly>
1414
<assemblyIdentity name="ThermoFisher.CommonCore.RawFileReader" publicKeyToken="1aef06afb5abd953" culture="neutral" />
15-
<bindingRedirect oldVersion="0.0.0.0-5.0.0.88" newVersion="5.0.0.88" />
15+
<bindingRedirect oldVersion="0.0.0.0-5.0.0.93" newVersion="5.0.0.93" />
1616
</dependentAssembly>
1717
<dependentAssembly>
1818
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
@@ -28,7 +28,7 @@
2828
</dependentAssembly>
2929
<dependentAssembly>
3030
<assemblyIdentity name="ThermoFisher.CommonCore.Data" publicKeyToken="1aef06afb5abd953" culture="neutral" />
31-
<bindingRedirect oldVersion="0.0.0.0-5.0.0.88" newVersion="5.0.0.88" />
31+
<bindingRedirect oldVersion="0.0.0.0-5.0.0.93" newVersion="5.0.0.93" />
3232
</dependentAssembly>
3333
<dependentAssembly>
3434
<assemblyIdentity name="System.IO.FileSystem.AccessControl" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />

ThermoRawFileParserTest/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<package id="System.IO.FileSystem.AccessControl" version="5.0.0" targetFramework="net472" />
2020
<package id="System.Security.AccessControl" version="5.0.0" targetFramework="net472" />
2121
<package id="System.Security.Principal.Windows" version="5.0.0" targetFramework="net472" />
22-
<package id="ThermoFisher.CommonCore.Data" version="5.0.0.88" targetFramework="net472" />
23-
<package id="ThermoFisher.CommonCore.RawFileReader" version="5.0.0.88" targetFramework="net472" />
22+
<package id="ThermoFisher.CommonCore.Data" version="5.0.0.93" targetFramework="net472" />
23+
<package id="ThermoFisher.CommonCore.RawFileReader" version="5.0.0.93" targetFramework="net472" />
2424
<package id="zlib.net" version="1.0.4.0" targetFramework="net471" />
2525
</packages>

Util/CVHelpers.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using ThermoRawFileParser.Writer.MzML;
2+
3+
namespace ThermoRawFileParser.Util
4+
{
5+
public static class CVHelpers
6+
{
7+
public static CVParamType Copy (this CVParamType old)
8+
{
9+
return new CVParamType
10+
{
11+
accession = old.accession,
12+
name = old.name,
13+
cvRef = old.cvRef,
14+
unitAccession = old.unitAccession,
15+
unitCvRef = old.unitCvRef,
16+
unitName = old.unitName,
17+
value = old.value
18+
};
19+
}
20+
}
21+
}

Writer/MgfSpectrumWriter.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,23 @@ public MgfSpectrumWriter(ParseInput parseInput) : base(parseInput)
3838
/// <inheritdoc />
3939
public override void Write(IRawDataPlus rawFile, int firstScanNumber, int lastScanNumber)
4040
{
41+
if (!rawFile.HasMsData)
42+
{
43+
throw new RawFileParserException("No MS data in RAW file, no output will be produced");
44+
}
45+
4146
ConfigureWriter(".mgf");
4247
using (Writer)
4348
{
49+
4450
Log.Info("Processing " + (lastScanNumber - firstScanNumber + 1) + " scans");
4551

4652
var lastScanProgress = 0;
4753
for (var scanNumber = firstScanNumber; scanNumber <= lastScanNumber; scanNumber++)
4854
{
4955
if (ParseInput.LogFormat == LogFormat.DEFAULT)
5056
{
51-
var scanProgress = (int) ((double) scanNumber / (lastScanNumber - firstScanNumber + 1) * 100);
57+
var scanProgress = (int)((double)scanNumber / (lastScanNumber - firstScanNumber + 1) * 100);
5258
if (scanProgress % ProgressPercentageStep == 0)
5359
{
5460
if (scanProgress != lastScanProgress)
@@ -160,12 +166,12 @@ public override void Write(IRawDataPlus rawFile, int firstScanNumber, int lastSc
160166
Writer.WriteLine("BEGIN IONS");
161167
if (!ParseInput.MgfPrecursor)
162168
{
163-
Writer.WriteLine($"TITLE={ConstructSpectrumTitle((int) Device.MS, 1, scanNumber)}");
169+
Writer.WriteLine($"TITLE={ConstructSpectrumTitle((int)Device.MS, 1, scanNumber)}");
164170
}
165171
else
166172
{
167173
Writer.WriteLine(
168-
$"TITLE={ConstructSpectrumTitle((int) Device.MS, 1, scanNumber)} [PRECURSOR={precursorReference}]");
174+
$"TITLE={ConstructSpectrumTitle((int)Device.MS, 1, scanNumber)} [PRECURSOR={precursorReference}]");
169175
}
170176

171177
Writer.WriteLine($"SCANS={scanNumber}");
@@ -250,6 +256,7 @@ public override void Write(IRawDataPlus rawFile, int firstScanNumber, int lastSc
250256
{
251257
Console.WriteLine();
252258
}
259+
253260
}
254261
}
255262
}

0 commit comments

Comments
 (0)