Skip to content

Commit f5bbd4c

Browse files
committed
Refine messages
1 parent 9c28cd5 commit f5bbd4c

File tree

7 files changed

+21
-12
lines changed

7 files changed

+21
-12
lines changed

Query/ProxiSpectrumReader.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public List<ProxiSpectrum> Retrieve()
2828
IRawDataPlus rawFile;
2929
using (rawFile = RawFileReaderFactory.ReadFile(queryParameters.rawFilePath))
3030
{
31+
Log.Info($"Started parsing {queryParameters.rawFilePath}");
32+
3133
if (!rawFile.IsOpen)
3234
{
3335
throw new RawFileParserException("Unable to access the RAW file using the native Thermo library.");
@@ -37,13 +39,13 @@ public List<ProxiSpectrum> Retrieve()
3739
if (rawFile.IsError)
3840
{
3941
throw new RawFileParserException(
40-
$"Error opening ({rawFile.FileError}) - {queryParameters.rawFilePath}");
42+
$"RAW file cannot be processed because of an error - {rawFile.FileError}");
4143
}
4244

4345
// Check if the RAW file is being acquired
4446
if (rawFile.InAcquisition)
4547
{
46-
throw new RawFileParserException("RAW file still being acquired - " + queryParameters.rawFilePath);
48+
throw new RawFileParserException("RAW file cannot be processed since it is still being acquired");
4749
}
4850

4951
// Get the number of instruments (controllers) present in the RAW file and set the
@@ -227,7 +229,7 @@ public List<ProxiSpectrum> Retrieve()
227229
{
228230
if (ex.GetBaseException() is IndexOutOfRangeException)
229231
{
230-
Log.WarnFormat("Spectrum #{0} outside of file boundries", scanNumber);
232+
Log.WarnFormat("Spectrum #{0} is outside of file boundries", scanNumber);
231233
queryParameters.NewWarn();
232234
}
233235
else
@@ -238,6 +240,8 @@ public List<ProxiSpectrum> Retrieve()
238240
}
239241
}
240242

243+
Log.Info($"Finished processing {queryParameters.rawFilePath}");
244+
241245
return resultList;
242246
}
243247
}

RawFileParser.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ private static void ProcessFile(ParseInput parseInput)
103103
// Check for any errors in the RAW file
104104
if (rawFile.IsError)
105105
{
106-
throw new RawFileParserException($"Error opening ({rawFile.FileError}) - {parseInput.RawFilePath}");
106+
throw new RawFileParserException($"RAW file cannot be processed because of an error - {rawFile.FileError}");
107107
}
108108

109109
// Check if the RAW file is being acquired
110110
if (rawFile.InAcquisition)
111111
{
112-
throw new RawFileParserException("RAW file still being acquired - " + parseInput.RawFilePath);
112+
throw new RawFileParserException("RAW file cannot be processed since it is still being acquired");
113113
}
114114

115115
// Get the number of instruments (controllers) present in the RAW file and set the

Writer/MetadataWriter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public void WriteMetadata(IRawDataPlus rawFile, int firstScanNumber, int lastSca
9393
catch (ArgumentOutOfRangeException)
9494
{
9595
Log.Warn("No reaction found for scan " + scanNumber);
96+
_parseInput.NewWarn();
9697
}
9798

9899
// trailer extra data list

Writer/MgfSpectrumWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public override void Write(IRawDataPlus rawFile, int firstScanNumber, int lastSc
242242

243243
Writer.WriteLine("END IONS");
244244

245-
Log.Debug("Spectrum written to file -- SCAN " + scanNumber);
245+
Log.Debug("Spectrum written to file -- SCAN# " + scanNumber);
246246
}
247247
}
248248

Writer/MzMlSpectrumWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,7 @@ private SpectrumType ConstructMSSpectrum(int scanNumber)
13621362
case PolarityType.Any:
13631363
break;
13641364
default:
1365-
throw new ArgumentOutOfRangeException();
1365+
throw new ArgumentOutOfRangeException("PolarityType is Unknown");
13661366
}
13671367

13681368
// Total ion current

XIC/XicExecutor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static void Run(XicParameters parameters)
5555
directory = Path.GetDirectoryName(rawFile);
5656
}
5757

58-
var outputFileName = Path.Combine(directory ?? throw new NoNullAllowedException(),
58+
var outputFileName = Path.Combine(directory ?? throw new NoNullAllowedException("Output directory cannot be null"),
5959
Path.GetFileNameWithoutExtension(rawFile) + ".json");
6060

6161
OutputXicData(dataInstance, outputFileName);

XIC/XicReader.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ public static void ReadXic(string rawFilePath, bool base64, XicData xicData, ref
2121
IRawDataPlus rawFile;
2222
using (rawFile = RawFileReaderFactory.ReadFile(rawFilePath))
2323
{
24+
Log.Info($"Started parsing {rawFilePath}");
25+
2426
if (!rawFile.IsOpen)
2527
{
2628
throw new RawFileParserException("Unable to access the RAW file using the native Thermo library.");
@@ -30,13 +32,13 @@ public static void ReadXic(string rawFilePath, bool base64, XicData xicData, ref
3032
if (rawFile.IsError)
3133
{
3234
throw new RawFileParserException(
33-
$"Error opening ({rawFile.FileError}) - {rawFilePath}");
35+
$"RAW file cannot be processed because of an error - {rawFile.FileError}");
3436
}
3537

3638
// Check if the RAW file is being acquired
3739
if (rawFile.InAcquisition)
3840
{
39-
throw new RawFileParserException("RAW file still being acquired - " + rawFilePath);
41+
throw new RawFileParserException("RAW file cannot be processed since it is still being acquired");
4042
}
4143

4244
// Get the number of instruments (controllers) present in the RAW file and set the
@@ -124,14 +126,14 @@ public static void ReadXic(string rawFilePath, bool base64, XicData xicData, ref
124126
Math.Abs(data.PositionsArray[0][0] - endTime) < 0.001))
125127
{
126128
Log.Warn(
127-
$"Only the minimum or maximum retention time was returned. This is an indication that the provided retention time range [{xicUnit.Meta.RtStart}-{xicUnit.Meta.RtEnd}] lies outside the max. window [{startTime}-{endTime}]");
129+
$"Only the minimum or maximum retention time was returned. Does the provided retention time range [{xicUnit.Meta.RtStart}-{xicUnit.Meta.RtEnd}] lies outside the max. window [{startTime}-{endTime}]?");
128130
parameters.NewWarn();
129131
}
130132
}
131133
else
132134
{
133135
Log.Warn(
134-
$"No scans found in retention time range [{xicUnit.Meta.RtStart}-{xicUnit.Meta.RtEnd}]. This is an indication that the provided retention time window lies outside the max. window [{startTime}-{endTime}]");
136+
$"No scans found in retention time range [{xicUnit.Meta.RtStart}-{xicUnit.Meta.RtEnd}]. Does the provided retention time window lies outside the max. window [{startTime}-{endTime}]");
135137
parameters.NewWarn();
136138
}
137139
}
@@ -172,6 +174,8 @@ public static void ReadXic(string rawFilePath, bool base64, XicData xicData, ref
172174
}
173175
}
174176
}
177+
178+
Log.Info($"Finished parsing {rawFilePath}");
175179
}
176180
}
177181

0 commit comments

Comments
 (0)