Skip to content

Commit 5e38f34

Browse files
authored
Merge pull request #170 from compomics/1.4.3
Release of v1.4.3
2 parents 45ed3df + 34656a8 commit 5e38f34

26 files changed

+975
-914
lines changed

MainClass.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static class MainClass
2020
private static readonly ILog Log =
2121
LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
2222

23-
public const string Version = "1.4.2";
23+
public const string Version = "1.4.3";
2424
public static void Main(string[] args)
2525
{
2626
// Set Invariant culture as default for all further processing

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ Provide one of the following filters:
192192
* M/Z start and end
193193
* sequence and tolerance (tolerance unit optional, defaults to `ppm`)
194194

195-
optionally one can define starting and ending retention times and thermo filter string (defaults to `ms`)
195+
optionally one can define starting and ending retention times, provide filter string (defaults to `ms`, i.e. only MS1 scans), and a comment (free text) field; any valid filter string is supported,
196+
however only basic validation is performed, see [issue #158](https://github.com/compomics/ThermoRawFileParser/issues/158) for details. Comment can contain any text and will be preserved in the output.
196197

197198
An example input JSON file:
198199

@@ -219,7 +220,17 @@ An example input JSON file:
219220
{
220221
"sequence":"TRANNEL",
221222
"tolerance":10
223+
},
224+
{
225+
"mz":1014.5099732499732,
226+
"rt_start":14.0600881872,
227+
"rt_end":14.4167198290667,
228+
"tolerance":5,
229+
"tolerance_unit":"ppm",
230+
"comment":"Only ion trap scans"
231+
"scan_filter":"ITMS"
222232
}
233+
}
223234
]
224235
225236
```

RawFileParser.cs

100644100755
Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,18 +136,23 @@ private static void ProcessFile(ParseInput parseInput)
136136

137137
// Get the number of instruments (controllers) present in the RAW file and set the
138138
// selected instrument to the MS instrument, first instance of it
139-
rawFile.SelectInstrument(Device.MS, 1);
139+
var firstScanNumber = -1;
140+
var lastScanNumber = -1;
140141

141-
rawFile.IncludeReferenceAndExceptionData = !parseInput.ExData;
142+
if (rawFile.GetInstrumentCountOfType(Device.MS) != 0)
143+
{
144+
rawFile.SelectInstrument(Device.MS, 1);
145+
rawFile.IncludeReferenceAndExceptionData = !parseInput.ExData;
142146

143-
// Get the first and last scan from the RAW file
144-
var firstScanNumber = rawFile.RunHeaderEx.FirstSpectrum;
145-
var lastScanNumber = rawFile.RunHeaderEx.LastSpectrum;
147+
// Get the first and last scan from the RAW file
148+
firstScanNumber = rawFile.RunHeaderEx.FirstSpectrum;
149+
lastScanNumber = rawFile.RunHeaderEx.LastSpectrum;
146150

147-
// Check for empty file
148-
if (lastScanNumber < 1)
149-
{
150-
throw new RawFileParserException("Empty RAW file, no output will be produced");
151+
// Check for empty file
152+
if (lastScanNumber < 1)
153+
{
154+
throw new RawFileParserException("Empty RAW file, no output will be produced");
155+
}
151156
}
152157

153158
if (parseInput.MetadataFormat != MetadataFormat.NONE)

ThermoRawFileParser.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,11 @@
176176
<Reference Include="System.Data.DataSetExtensions" />
177177
<Reference Include="System.Data" />
178178
<Reference Include="System.Xml" />
179-
<Reference Include="ThermoFisher.CommonCore.Data, Version=5.0.0.88, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
180-
<HintPath>packages\ThermoFisher.CommonCore.Data.5.0.0.88\lib\ThermoFisher.CommonCore.Data.dll</HintPath>
179+
<Reference Include="ThermoFisher.CommonCore.Data, Version=5.0.0.93, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
180+
<HintPath>packages\ThermoFisher.CommonCore.Data.5.0.0.93\lib\netstandard2.0\ThermoFisher.CommonCore.Data.dll</HintPath>
181181
</Reference>
182-
<Reference Include="ThermoFisher.CommonCore.RawFileReader, Version=5.0.0.88, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
183-
<HintPath>packages\ThermoFisher.CommonCore.RawFileReader.5.0.0.88\lib\ThermoFisher.CommonCore.RawFileReader.dll</HintPath>
182+
<Reference Include="ThermoFisher.CommonCore.RawFileReader, Version=5.0.0.93, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
183+
<HintPath>packages\ThermoFisher.CommonCore.RawFileReader.5.0.0.93\lib\netstandard2.0\ThermoFisher.CommonCore.RawFileReader.dll</HintPath>
184184
</Reference>
185185
<Reference Include="zlib.net, Version=1.0.3.0, Culture=neutral, PublicKeyToken=47d7877cb3620160">
186186
<HintPath>packages\zlib.net.1.0.4.0\lib\zlib.net.dll</HintPath>
@@ -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+
}

0 commit comments

Comments
 (0)