Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions RawFileParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,20 +136,19 @@ 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);

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

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

// Check for empty file
if (lastScanNumber < 1)
{
throw new RawFileParserException("Empty RAW file, no output will be produced");
// Get the first and last scan from the RAW file
firstScanNumber = rawFile.RunHeaderEx.FirstSpectrum;
lastScanNumber = rawFile.RunHeaderEx.LastSpectrum;
}

if (parseInput.MetadataFormat != MetadataFormat.NONE)
{
MetadataWriter metadataWriter = new MetadataWriter(parseInput);
Expand Down
Loading