@@ -176,43 +176,40 @@ private void WriteJsonMetada(IRawDataPlus rawFile, int firstScanNumber, int last
176176 metadata . addInstrumentProperty ( new CVTerm ( "AFR:0001259" , "AFO" , "firmware version" ,
177177 rawFile . GetInstrumentData ( ) . HardwareVersion ) ) ;
178178 }
179- }
180-
181179
182- // MS Data
183- foreach ( KeyValuePair < string , int > entry in msTypes )
184- {
185- if ( entry . Key . Equals ( MSOrderType . Ms . ToString ( ) ) )
186- metadata . addMSData ( new CVTerm ( "PRIDE:0000481" , "PRIDE" , "Number of MS1 spectra" ,
187- entry . Value . ToString ( ) ) ) ;
188- if ( entry . Key . Equals ( MSOrderType . Ms2 . ToString ( ) ) )
189- metadata . addMSData ( new CVTerm ( "PRIDE:0000482" , "PRIDE" , "Number of MS2 spectra" ,
190- entry . Value . ToString ( ) ) ) ;
191- if ( entry . Key . Equals ( MSOrderType . Ms3 . ToString ( ) ) )
192- metadata . addMSData ( new CVTerm ( "PRIDE:0000483" , "PRIDE" , "Number of MS3 spectra" ,
193- entry . Value . ToString ( ) ) ) ;
194- }
195-
196- metadata . addMSData ( new CVTerm ( "PRIDE:0000472" , "PRIDE" , "MS min charge" ,
197- minCharge . ToString ( CultureInfo . InvariantCulture ) ) ) ;
198- metadata . addMSData ( new CVTerm ( "PRIDE:0000473" , "PRIDE" , "MS max charge" ,
199- maxCharge . ToString ( CultureInfo . InvariantCulture ) ) ) ;
200-
201- metadata . addMSData ( new CVTerm ( "PRIDE:0000474" , "PRIDE" , "MS min RT" ,
202- minTime . ToString ( CultureInfo . InvariantCulture ) ) ) ;
203- metadata . addMSData ( new CVTerm ( "PRIDE:0000475" , "PRIDE" , "MS max RT" ,
204- maxTime . ToString ( CultureInfo . InvariantCulture ) ) ) ;
205-
206- metadata . addMSData ( new CVTerm ( "PRIDE:0000476" , "PRIDE" , "MS min MZ" ,
207- minMz . ToString ( CultureInfo . InvariantCulture ) ) ) ;
208- metadata . addMSData ( new CVTerm ( "PRIDE:0000477" , "PRIDE" , "MS max MZ" ,
209- maxMz . ToString ( CultureInfo . InvariantCulture ) ) ) ;
210-
211- // Scan Settings
212- // Get the start and end time from the RAW file
213-
214- if ( rawFile . SelectMsData ( ) )
215- {
180+
181+
182+ // MS Data
183+ foreach ( KeyValuePair < string , int > entry in msTypes )
184+ {
185+ if ( entry . Key . Equals ( MSOrderType . Ms . ToString ( ) ) )
186+ metadata . addMSData ( new CVTerm ( "PRIDE:0000481" , "PRIDE" , "Number of MS1 spectra" ,
187+ entry . Value . ToString ( ) ) ) ;
188+ if ( entry . Key . Equals ( MSOrderType . Ms2 . ToString ( ) ) )
189+ metadata . addMSData ( new CVTerm ( "PRIDE:0000482" , "PRIDE" , "Number of MS2 spectra" ,
190+ entry . Value . ToString ( ) ) ) ;
191+ if ( entry . Key . Equals ( MSOrderType . Ms3 . ToString ( ) ) )
192+ metadata . addMSData ( new CVTerm ( "PRIDE:0000483" , "PRIDE" , "Number of MS3 spectra" ,
193+ entry . Value . ToString ( ) ) ) ;
194+ }
195+
196+ metadata . addMSData ( new CVTerm ( "PRIDE:0000472" , "PRIDE" , "MS min charge" ,
197+ minCharge . ToString ( CultureInfo . InvariantCulture ) ) ) ;
198+ metadata . addMSData ( new CVTerm ( "PRIDE:0000473" , "PRIDE" , "MS max charge" ,
199+ maxCharge . ToString ( CultureInfo . InvariantCulture ) ) ) ;
200+
201+ metadata . addMSData ( new CVTerm ( "PRIDE:0000474" , "PRIDE" , "MS min RT" ,
202+ minTime . ToString ( CultureInfo . InvariantCulture ) ) ) ;
203+ metadata . addMSData ( new CVTerm ( "PRIDE:0000475" , "PRIDE" , "MS max RT" ,
204+ maxTime . ToString ( CultureInfo . InvariantCulture ) ) ) ;
205+
206+ metadata . addMSData ( new CVTerm ( "PRIDE:0000476" , "PRIDE" , "MS min MZ" ,
207+ minMz . ToString ( CultureInfo . InvariantCulture ) ) ) ;
208+ metadata . addMSData ( new CVTerm ( "PRIDE:0000477" , "PRIDE" , "MS max MZ" ,
209+ maxMz . ToString ( CultureInfo . InvariantCulture ) ) ) ;
210+
211+ // Scan Settings
212+ // Get the start and end time from the RAW file
216213 var runHeaderEx = rawFile . RunHeaderEx ;
217214 var startTime = runHeaderEx . StartTime ;
218215 var endTime = runHeaderEx . EndTime ;
@@ -373,21 +370,21 @@ private void WriteTextMetadata(IRawDataPlus rawFile, int firstScanNumber, int la
373370 {
374371 output . Add ( "Firmware version=" + rawFile . GetInstrumentData ( ) . HardwareVersion ) ;
375372 }
376- }
377-
378- // MS Data
379- output . Add ( "#MsData" ) ;
380- foreach ( KeyValuePair < string , int > entry in msTypes )
381- {
382- if ( entry . Key . Equals ( MSOrderType . Ms . ToString ( ) ) )
383- output . Add ( "Number of MS1 spectra=" + entry . Value ) ;
384- if ( entry . Key . Equals ( MSOrderType . Ms2 . ToString ( ) ) )
385- output . Add ( "Number of MS2 spectra=" + entry . Value ) ;
386- if ( entry . Key . Equals ( MSOrderType . Ms3 . ToString ( ) ) )
387- output . Add ( "Number of MS3 spectra=" + entry . Value ) ;
388- }
389373
390- output . AddRange ( new List < string >
374+
375+ // MS Data
376+ output . Add ( "#MsData" ) ;
377+ foreach ( KeyValuePair < string , int > entry in msTypes )
378+ {
379+ if ( entry . Key . Equals ( MSOrderType . Ms . ToString ( ) ) )
380+ output . Add ( "Number of MS1 spectra=" + entry . Value ) ;
381+ if ( entry . Key . Equals ( MSOrderType . Ms2 . ToString ( ) ) )
382+ output . Add ( "Number of MS2 spectra=" + entry . Value ) ;
383+ if ( entry . Key . Equals ( MSOrderType . Ms3 . ToString ( ) ) )
384+ output . Add ( "Number of MS3 spectra=" + entry . Value ) ;
385+ }
386+
387+ output . AddRange ( new List < string >
391388 {
392389 $ "MS min charge={ minCharge . ToString ( CultureInfo . InvariantCulture ) } ",
393390 $ "MS max charge={ maxCharge . ToString ( CultureInfo . InvariantCulture ) } ",
@@ -396,11 +393,9 @@ private void WriteTextMetadata(IRawDataPlus rawFile, int firstScanNumber, int la
396393 $ "MS min MZ={ minMz . ToString ( CultureInfo . InvariantCulture ) } ",
397394 $ "MS max MZ={ maxMz . ToString ( CultureInfo . InvariantCulture ) } "
398395 }
399- ) ;
396+ ) ;
400397
401- // Scan Settings
402- if ( rawFile . SelectMsData ( ) )
403- {
398+ // Scan Settings
404399 // Get the start and end time from the RAW file
405400 var startTime = rawFile . RunHeaderEx . StartTime ;
406401 var endTime = rawFile . RunHeaderEx . EndTime ;
@@ -410,7 +405,7 @@ private void WriteTextMetadata(IRawDataPlus rawFile, int firstScanNumber, int la
410405 $ "Scan start time={ startTime . ToString ( CultureInfo . InvariantCulture ) } ",
411406 $ "Expected runtime={ rawFile . RunHeaderEx . ExpectedRunTime . ToString ( CultureInfo . InvariantCulture ) } ",
412407 $ "Mass resolution=[MS, MS:1000011, mass resolution, { rawFile . RunHeaderEx . MassResolution . ToString ( CultureInfo . InvariantCulture ) } ]",
413- "Units=" + rawFile . GetInstrumentData ( ) . Units ,
408+ $ "Units={ rawFile . GetInstrumentData ( ) . Units } " ,
414409 $ "Number of scans={ rawFile . RunHeaderEx . SpectraCount } ",
415410 $ "Scan range={ firstScanNumber } ;{ lastScanNumber } ",
416411 $ "Time range={ startTime . ToString ( CultureInfo . InvariantCulture ) } ;{ endTime . ToString ( CultureInfo . InvariantCulture ) } ",
@@ -419,6 +414,7 @@ private void WriteTextMetadata(IRawDataPlus rawFile, int firstScanNumber, int la
419414 }
420415 ) ;
421416 }
417+
422418 // Sample Data
423419 output . Add ( "#SampleData" ) ;
424420
0 commit comments