Skip to content

Commit

Permalink
Merge pull request #170 from compomics/1.4.3
Browse files Browse the repository at this point in the history
Release of v1.4.3
  • Loading branch information
caetera committed Sep 15, 2023
2 parents 45ed3df + 34656a8 commit 5e38f34
Show file tree
Hide file tree
Showing 26 changed files with 975 additions and 914 deletions.
2 changes: 1 addition & 1 deletion MainClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static class MainClass
private static readonly ILog Log =
LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

public const string Version = "1.4.2";
public const string Version = "1.4.3";
public static void Main(string[] args)
{
// Set Invariant culture as default for all further processing
Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ Provide one of the following filters:
* M/Z start and end
* sequence and tolerance (tolerance unit optional, defaults to `ppm`)

optionally one can define starting and ending retention times and thermo filter string (defaults to `ms`)
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,
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.

An example input JSON file:

Expand All @@ -219,7 +220,17 @@ An example input JSON file:
{
"sequence":"TRANNEL",
"tolerance":10
},
{
"mz":1014.5099732499732,
"rt_start":14.0600881872,
"rt_end":14.4167198290667,
"tolerance":5,
"tolerance_unit":"ppm",
"comment":"Only ion trap scans"
"scan_filter":"ITMS"
}
}
]
```
Expand Down
23 changes: 14 additions & 9 deletions RawFileParser.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,23 @@ private static void ProcessFile(ParseInput parseInput)

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

rawFile.IncludeReferenceAndExceptionData = !parseInput.ExData;
if (rawFile.GetInstrumentCountOfType(Device.MS) != 0)
{
rawFile.SelectInstrument(Device.MS, 1);
rawFile.IncludeReferenceAndExceptionData = !parseInput.ExData;

// Get the first and last scan from the RAW file
var firstScanNumber = rawFile.RunHeaderEx.FirstSpectrum;
var lastScanNumber = rawFile.RunHeaderEx.LastSpectrum;
// Get the first and last scan from the RAW file
firstScanNumber = rawFile.RunHeaderEx.FirstSpectrum;
lastScanNumber = rawFile.RunHeaderEx.LastSpectrum;

// Check for empty file
if (lastScanNumber < 1)
{
throw new RawFileParserException("Empty RAW file, no output will be produced");
// Check for empty file
if (lastScanNumber < 1)
{
throw new RawFileParserException("Empty RAW file, no output will be produced");
}
}

if (parseInput.MetadataFormat != MetadataFormat.NONE)
Expand Down
9 changes: 5 additions & 4 deletions ThermoRawFileParser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="ThermoFisher.CommonCore.Data, Version=5.0.0.88, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
<HintPath>packages\ThermoFisher.CommonCore.Data.5.0.0.88\lib\ThermoFisher.CommonCore.Data.dll</HintPath>
<Reference Include="ThermoFisher.CommonCore.Data, Version=5.0.0.93, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
<HintPath>packages\ThermoFisher.CommonCore.Data.5.0.0.93\lib\netstandard2.0\ThermoFisher.CommonCore.Data.dll</HintPath>
</Reference>
<Reference Include="ThermoFisher.CommonCore.RawFileReader, Version=5.0.0.88, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
<HintPath>packages\ThermoFisher.CommonCore.RawFileReader.5.0.0.88\lib\ThermoFisher.CommonCore.RawFileReader.dll</HintPath>
<Reference Include="ThermoFisher.CommonCore.RawFileReader, Version=5.0.0.93, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
<HintPath>packages\ThermoFisher.CommonCore.RawFileReader.5.0.0.93\lib\netstandard2.0\ThermoFisher.CommonCore.RawFileReader.dll</HintPath>
</Reference>
<Reference Include="zlib.net, Version=1.0.3.0, Culture=neutral, PublicKeyToken=47d7877cb3620160">
<HintPath>packages\zlib.net.1.0.4.0\lib\zlib.net.dll</HintPath>
Expand All @@ -199,6 +199,7 @@
<Compile Include="Query\ProxiSpectrumReader.cs" />
<Compile Include="RawFileParserException.cs" />
<Compile Include="RawFileParser.cs" />
<Compile Include="Util\CVHelpers.cs" />
<Compile Include="Util\LimitedSizeDictionary.cs" />
<Compile Include="Util\MZArray.cs" />
<Compile Include="Util\NativeMethods.cs" />
Expand Down
6 changes: 3 additions & 3 deletions ThermoRawFileParserTest/OntologyMappingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ public class OntologyMappingTests
public void TestGetInstrumentModel()
{
// exact match
var match = OntologyMapping.getInstrumentModel("LTQ Orbitrap");
var match = OntologyMapping.GetInstrumentModel("LTQ Orbitrap");
Assert.AreEqual("MS:1000449", match.accession);
// partial match, should return the longest partial match
var partialMatch = OntologyMapping.getInstrumentModel("LTQ Orbitrap XXL");
var partialMatch = OntologyMapping.GetInstrumentModel("LTQ Orbitrap XXL");
Assert.AreEqual("MS:1000449", partialMatch.accession);
// no match, should return the generic thermo instrument
var noMatch = OntologyMapping.getInstrumentModel("non existing model");
var noMatch = OntologyMapping.GetInstrumentModel("non existing model");
Assert.AreEqual("MS:1000483", noMatch.accession);
}
}
Expand Down
8 changes: 4 additions & 4 deletions ThermoRawFileParserTest/ThermoRawFileParserTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@
<HintPath>..\packages\mzLib.1.0.450\lib\net471\ThermoFisher.CommonCore.BackgroundSubtraction.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ThermoFisher.CommonCore.Data, Version=5.0.0.88, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
<HintPath>..\packages\ThermoFisher.CommonCore.Data.5.0.0.88\lib\ThermoFisher.CommonCore.Data.dll</HintPath>
<Reference Include="ThermoFisher.CommonCore.Data, Version=5.0.0.93, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
<HintPath>..\packages\ThermoFisher.CommonCore.Data.5.0.0.93\lib\netstandard2.0\ThermoFisher.CommonCore.Data.dll</HintPath>
</Reference>
<Reference Include="ThermoFisher.CommonCore.MassPrecisionEstimator, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\mzLib.1.0.450\lib\net471\ThermoFisher.CommonCore.MassPrecisionEstimator.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ThermoFisher.CommonCore.RawFileReader, Version=5.0.0.88, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
<HintPath>..\packages\ThermoFisher.CommonCore.RawFileReader.5.0.0.88\lib\ThermoFisher.CommonCore.RawFileReader.dll</HintPath>
<Reference Include="ThermoFisher.CommonCore.RawFileReader, Version=5.0.0.93, Culture=neutral, PublicKeyToken=1aef06afb5abd953, processorArchitecture=MSIL">
<HintPath>..\packages\ThermoFisher.CommonCore.RawFileReader.5.0.0.93\lib\netstandard2.0\ThermoFisher.CommonCore.RawFileReader.dll</HintPath>
</Reference>
<Reference Include="ThermoRawFileReader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\mzLib.1.0.450\lib\net471\ThermoRawFileReader.dll</HintPath>
Expand Down
4 changes: 2 additions & 2 deletions ThermoRawFileParserTest/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ThermoFisher.CommonCore.RawFileReader" publicKeyToken="1aef06afb5abd953" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.88" newVersion="5.0.0.88" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.93" newVersion="5.0.0.93" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
Expand All @@ -28,7 +28,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ThermoFisher.CommonCore.Data" publicKeyToken="1aef06afb5abd953" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.88" newVersion="5.0.0.88" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.93" newVersion="5.0.0.93" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.FileSystem.AccessControl" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
Expand Down
4 changes: 2 additions & 2 deletions ThermoRawFileParserTest/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<package id="System.IO.FileSystem.AccessControl" version="5.0.0" targetFramework="net472" />
<package id="System.Security.AccessControl" version="5.0.0" targetFramework="net472" />
<package id="System.Security.Principal.Windows" version="5.0.0" targetFramework="net472" />
<package id="ThermoFisher.CommonCore.Data" version="5.0.0.88" targetFramework="net472" />
<package id="ThermoFisher.CommonCore.RawFileReader" version="5.0.0.88" targetFramework="net472" />
<package id="ThermoFisher.CommonCore.Data" version="5.0.0.93" targetFramework="net472" />
<package id="ThermoFisher.CommonCore.RawFileReader" version="5.0.0.93" targetFramework="net472" />
<package id="zlib.net" version="1.0.4.0" targetFramework="net471" />
</packages>
21 changes: 21 additions & 0 deletions Util/CVHelpers.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using ThermoRawFileParser.Writer.MzML;

namespace ThermoRawFileParser.Util
{
public static class CVHelpers
{
public static CVParamType Copy (this CVParamType old)
{
return new CVParamType
{
accession = old.accession,
name = old.name,
cvRef = old.cvRef,
unitAccession = old.unitAccession,
unitCvRef = old.unitCvRef,
unitName = old.unitName,
value = old.value
};
}
}
}
Loading

0 comments on commit 5e38f34

Please sign in to comment.