@@ -152,7 +152,9 @@ private void WriteJsonMetada(IRawDataPlus rawFile, int firstScanNumber, int last
152152 var metadata = new Metadata ( ) ;
153153
154154 // File Properties
155- metadata . addFileProperty ( new CVTerm ( "NCIT:C47922" , "NCIT" , "Pathname" , rawFile . FileName ) ) ;
155+ string filePath = rawFile . FileName ;
156+ metadata . addFileProperty ( new CVTerm ( "NCIT:C47922" , "NCIT" , "Pathname" , filePath ) ) ;
157+ metadata . addFileProperty ( new CVTerm ( "NCIT:*****************" , "NCIT" , "File Name" , filePath . Substring ( 0 , filePath . LastIndexOf ( "." ) ) . Remove ( 0 , filePath . LastIndexOf ( "\\ " ) + 1 ) ) ) ;
156158 metadata . addFileProperty ( new CVTerm ( "NCIT:C25714" , "NCIT" , "Version" ,
157159 rawFile . FileHeader . Revision . ToString ( ) ) ) ;
158160 metadata . addFileProperty ( new CVTerm ( "NCIT:C69199" , "NCIT" , "Content Creation Date" ,
@@ -280,6 +282,53 @@ private void WriteJsonMetada(IRawDataPlus rawFile, int firstScanNumber, int last
280282 rawFile . SampleInformation . DilutionFactor . ToString ( CultureInfo . InvariantCulture ) ) ) ;
281283 }
282284
285+ if ( ! rawFile . SampleInformation . Path . IsNullOrEmpty ( ) )
286+ {
287+ metadata . addSampleProperty ( new CVTerm ( "AFQ:**********************" , "AFO" , "Path" , rawFile . SampleInformation . Path ) ) ;
288+ }
289+
290+ if ( ! rawFile . SampleInformation . InstrumentMethodFile . IsNullOrEmpty ( ) )
291+ {
292+ metadata . addSampleProperty ( new CVTerm ( "AFQ:******************" , "AFO" , "Instrument Method" , rawFile . SampleInformation . InstrumentMethodFile ) ) ;
293+ }
294+
295+ if ( rawFile . SampleInformation . IstdAmount != 0 )
296+ {
297+ metadata . addSampleProperty ( new CVTerm ( "AFQ:****************" , "AFO" , "Istd Amount" , rawFile . SampleInformation . IstdAmount . ToString ( ) ) ) ;
298+ }
299+
300+ if ( ! rawFile . SampleInformation . CalibrationLevel . IsNullOrEmpty ( ) )
301+ {
302+ metadata . addSampleProperty ( new CVTerm ( "AFQ:****************" , "AFO" , "Calibration Level" , rawFile . SampleInformation . CalibrationLevel ) ) ;
303+ }
304+
305+ if ( ! rawFile . SampleInformation . ProcessingMethodFile . IsNullOrEmpty ( ) )
306+ {
307+ metadata . addSampleProperty ( new CVTerm ( "AFQ:****************" , "AFO" , "Processing Method" , rawFile . SampleInformation . ProcessingMethodFile ) ) ;
308+ }
309+
310+ if ( rawFile . SampleInformation . SampleWeight != 0 )
311+ {
312+ metadata . addSampleProperty ( new CVTerm ( "AFQ:****************" , "AFO" , "Processing Method" , rawFile . SampleInformation . SampleWeight . ToString ( ) ) ) ;
313+ }
314+
315+ string [ ] userLabels = rawFile . UserLabel ;
316+ string [ ] userTexts = rawFile . SampleInformation . UserText ;
317+ if ( ! userLabels . IsNullOrEmpty ( ) && ! userTexts . IsNullOrEmpty ( ) )
318+ {
319+ if ( userLabels . Length > userTexts . Length )
320+ {
321+ throw new RawFileParserException ( ) ;
322+ }
323+ for ( int i = 0 ; i < userLabels . Length ; i ++ )
324+ {
325+ if ( ! userTexts [ i ] . IsNullOrEmpty ( ) )
326+ {
327+ metadata . addSampleProperty ( new CVTerm ( "AFQ:****************" , "AFO" , userLabels [ i ] , userTexts [ i ] ) ) ;
328+ }
329+ }
330+ }
331+
283332
284333 // Write the meta data to file
285334 var json = JsonConvert . SerializeObject ( metadata ) ;
@@ -305,8 +354,8 @@ private void WriteTextMetadata(IRawDataPlus rawFile, int firstScanNumber, int la
305354 var output = new List < string >
306355 {
307356 "#FileProperties" ,
308- "RAW file path=" + rawFile . FileName ,
309- "RAW file name=" + rawFile . FileName . Substring ( 0 , rawFile . FileName . LastIndexOf ( "." ) ) . Remove ( 0 , rawFile . FileName . LastIndexOf ( "\\ " ) + 1 ) ,
357+ "RAW file path=" + filePath ,
358+ "RAW file name=" + filePath . Substring ( 0 , filePath . LastIndexOf ( "." ) ) . Remove ( 0 , filePath . LastIndexOf ( "\\ " ) + 1 ) ,
310359 "RAW file version=" + rawFile . FileHeader . Revision ,
311360 "Creation date=" + rawFile . FileHeader . CreationDate
312361 } ;
0 commit comments