@@ -72,8 +72,6 @@ public List<ProxiSpectrum> Retrieve()
7272 // Get the scan event for this scan number
7373 var scanEvent = rawFile . GetScanEventForScanNumber ( scanNumber ) ;
7474
75- var isCentroid = true ;
76-
7775 IReaction reaction = null ;
7876 if ( scanEvent . MSOrder != MSOrderType . Ms )
7977 {
@@ -161,7 +159,7 @@ public List<ProxiSpectrum> Retrieve()
161159 proxiSpectrum . AddAttribute ( accession : "MS:10000512" , name : "filter string" ,
162160 value : scanEvent . ToString ( ) ) ;
163161
164- if ( ! queryParameters . noPeakPicking )
162+ if ( ! queryParameters . noPeakPicking ) //centroiding requested
165163 {
166164 proxiSpectrum . AddAttribute ( accession : "MS:1000525" , name : "spectrum representation" ,
167165 value : "centroid spectrum" , valueAccession : "MS:1000127" ) ;
@@ -175,9 +173,8 @@ public List<ProxiSpectrum> Retrieve()
175173 proxiSpectrum . AddIntensities ( scan . CentroidScan . Intensities ) ;
176174 }
177175 }
178- else // otherwise take the profile data
176+ else // otherwise take the low res segmented data
179177 {
180- // Get the segmented (low res and profile) scan data
181178 // if the spectrum is profile perform centroiding
182179 var segmentedScan = scanEvent . ScanData == ScanDataType . Profile
183180 ? Scan . ToCentroid ( scan ) . SegmentedScan
@@ -187,11 +184,21 @@ public List<ProxiSpectrum> Retrieve()
187184 proxiSpectrum . AddIntensities ( segmentedScan . Intensities ) ;
188185 }
189186 }
190- else // use the profile data as is
187+ else // use the segmented data as is
191188 {
192- proxiSpectrum . AddAttribute ( accession : "MS:1000525" , name : "spectrum representation" ,
193- value : "profile spectrum" , valueAccession : "MS:1000128" ) ;
194-
189+ switch ( scanEvent . ScanData ) //check if the data is centroided already
190+ {
191+ case ScanDataType . Centroid :
192+ proxiSpectrum . AddAttribute ( accession : "MS:1000525" , name : "spectrum representation" ,
193+ value : "centroid spectrum" , valueAccession : "MS:1000127" ) ;
194+ break ;
195+
196+ case ScanDataType . Profile :
197+ proxiSpectrum . AddAttribute ( accession : "MS:1000525" , name : "spectrum representation" ,
198+ value : "profile spectrum" , valueAccession : "MS:1000128" ) ;
199+ break ;
200+ }
201+
195202 // Get the segmented (low res and profile) scan data
196203 proxiSpectrum . AddMz ( scan . SegmentedScan . Positions ) ;
197204 proxiSpectrum . AddIntensities ( scan . SegmentedScan . Intensities ) ;
0 commit comments