@@ -943,30 +943,7 @@ private SpectrumType ConstructSpectrum(int scanNumber)
943943 accession = "MS:1000285" ,
944944 value = scan . ScanStatistics . TIC . ToString ( CultureInfo . InvariantCulture ) ,
945945 cvRef = "MS"
946- } ) ;
947-
948- // Scan type, centroid or profile
949- switch ( scanEvent . ScanData )
950- {
951- case ScanDataType . Centroid :
952- spectrumCvParams . Add ( new CVParamType
953- {
954- accession = "MS:1000127" ,
955- cvRef = "MS" ,
956- name = "centroid spectrum" ,
957- value = ""
958- } ) ;
959- break ;
960- case ScanDataType . Profile :
961- spectrumCvParams . Add ( new CVParamType
962- {
963- accession = "MS:1000128" ,
964- cvRef = "MS" ,
965- name = "profile spectrum" ,
966- value = ""
967- } ) ;
968- break ;
969- }
946+ } ) ;
970947
971948 double ? basePeakMass = null ;
972949 double ? basePeakIntensity = null ;
@@ -981,6 +958,14 @@ private SpectrumType ConstructSpectrum(int scanNumber)
981958 var centroidStream = _rawFile . GetCentroidStream ( scanNumber , false ) ;
982959 if ( scan . CentroidScan . Length > 0 )
983960 {
961+ spectrumCvParams . Add ( new CVParamType
962+ {
963+ accession = "MS:1000127" ,
964+ cvRef = "MS" ,
965+ name = "centroid spectrum" ,
966+ value = ""
967+ } ) ;
968+
984969 basePeakMass = centroidStream . BasePeakMass ;
985970 basePeakIntensity = centroidStream . BasePeakIntensity ;
986971 lowestObservedMz = centroidStream . Masses [ 0 ] ;
@@ -1001,6 +986,28 @@ private SpectrumType ConstructSpectrum(int scanNumber)
1001986 var segmentedScan = _rawFile . GetSegmentedScanFromScanNumber ( scanNumber , scanStatistics ) ;
1002987 if ( segmentedScan . Positions . Length > 0 )
1003988 {
989+ switch ( scanEvent . ScanData )
990+ {
991+ case ScanDataType . Centroid :
992+ spectrumCvParams . Add ( new CVParamType
993+ {
994+ accession = "MS:1000127" ,
995+ cvRef = "MS" ,
996+ name = "centroid spectrum" ,
997+ value = ""
998+ } ) ;
999+ break ;
1000+ case ScanDataType . Profile :
1001+ spectrumCvParams . Add ( new CVParamType
1002+ {
1003+ accession = "MS:1000128" ,
1004+ cvRef = "MS" ,
1005+ name = "profile spectrum" ,
1006+ value = ""
1007+ } ) ;
1008+ break ;
1009+ }
1010+
10041011 lowestObservedMz = segmentedScan . Positions [ 0 ] ;
10051012 highestObservedMz = segmentedScan . Positions [ segmentedScan . Positions . Length - 1 ] ;
10061013 masses = segmentedScan . Positions ;
0 commit comments