Skip to content

Commit 1e216f9

Browse files
committed
Merge branch 'eubic2020hackathon' of https://github.com/compomics/ThermoRawFileParser into eubic2020hackathon
2 parents 303e41b + cc35247 commit 1e216f9

4 files changed

Lines changed: 22 additions & 8 deletions

File tree

Query/ProxiSpectrumReader.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ public List<PROXISpectrum> Retrieve()
7575
// Get the scan event for this scan number
7676
var scanEvent = rawFile.GetScanEventForScanNumber(scanNumber);
7777

78+
var isCentroid = true;
79+
7880
IReaction reaction = null;
7981
switch (scanFilter.MSOrder)
8082
{
@@ -87,7 +89,7 @@ public List<PROXISpectrum> Retrieve()
8789
{
8890
Log.Warn("No reaction found for scan " + scanNumber);
8991
}
90-
92+
9193
goto default;
9294
case MSOrderType.Ms3:
9395
{
@@ -195,6 +197,20 @@ public List<PROXISpectrum> Retrieve()
195197
rawFile.GetSegmentedScanFromScanNumber(scanNumber, scanStatistics);
196198
proxiSpectrum.AddMz(segmentedScan.Positions);
197199
proxiSpectrum.AddIntensities(segmentedScan.Intensities);
200+
201+
if (scanEvent.ScanData.Equals(ScanDataType.Profile))
202+
{
203+
isCentroid = false;
204+
}
205+
}
206+
207+
if (isCentroid)
208+
{
209+
proxiSpectrum.AddAttribute(accession: "MS:1000127", name: "centroid spectrum");
210+
}
211+
else
212+
{
213+
proxiSpectrum.AddAttribute(accession: "MS:1000128", name: "profile spectrum");
198214
}
199215

200216
resultList.Add(proxiSpectrum);

XIC/JSONParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static XicData ParseJSON(string jsonPath)
5353
}
5454
else
5555
{
56-
throw new Exception(String.Format("Unparsable JSON element:\n{0}", JsonConvert.SerializeObject(xic)));
56+
throw new Exception(String.Format("Unparsable JSON element:\n{0}", JsonConvert.SerializeObject(xic, Formatting.Indented)));
5757
}
5858
}
5959

XIC/XicExecutor.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,10 @@ public void StdOutputXicData(XicData outputData){
5151
Console.WriteLine(outputString);
5252
}
5353

54-
55-
5654
public void OutputXicData(XicData outputData, string outputFileName){
5755
string outputString = JsonConvert.SerializeObject(outputData);
5856
File.WriteAllText(outputFileName, outputString);
5957
}
6058

61-
public double PepseqToMass(String pep_seq){
62-
63-
throw new NotImplementedException();
64-
}
6559
}
6660
}

XIC/XicReader.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ public static void ReadXic(string rawFilePath, bool base64, XicData xicData)
5454
//var generator = new ChromatogramBatchGenerator();
5555
//ParallelChromatogramFactory.FromRawData(generator, rawFile);
5656

57+
//update global metadata
58+
xicData.outputmeta.base64 = base64;
59+
xicData.outputmeta.timeunit = "minutes";
60+
5761
foreach (var xicUnit in xicData.content)
5862
{
5963
IChromatogramSettings settings;

0 commit comments

Comments
 (0)