@@ -21,17 +21,28 @@ use fragment::FragmentType;
2121use itertools:: Itertools ;
2222use mzdata:: {
2323 io:: { MZFileReader , SpectrumSource } ,
24- mzpeaks:: { peak_set:: PeakSetVec , PeakCollection } ,
24+ mzpeaks:: { PeakCollection , peak_set:: PeakSetVec } ,
2525 mzsignal:: PeakPicker ,
2626 spectrum:: { SignalContinuity , SpectrumLike } ,
2727} ;
2828use rayon:: prelude:: * ;
2929use rustyms:: {
3030 annotation:: {
31- model:: { parse_custom_models, FragmentationModel , MatchingParameters } , AnnotatableSpectrum , AnnotatedPeak , Score , Scores
32- } , chemistry:: MassMode , fragment:: { DiagnosticPosition , Fragment } , glycan:: MonoSaccharide , identification:: { csv:: write_csv, BasicCSVData , IdentifiedPeptidoformSource } , quantities:: Tolerance , sequence:: {
33- parse_custom_modifications, AminoAcid , GnoComposition , SequencePosition , SimpleModificationInner
34- } , spectrum:: PeakSpectrum , system:: MassOverCharge , *
31+ AnnotatableSpectrum , AnnotatedPeak , Score , Scores ,
32+ model:: { FragmentationModel , MatchingParameters , parse_custom_models} ,
33+ } ,
34+ chemistry:: MassMode ,
35+ fragment:: { DiagnosticPosition , Fragment } ,
36+ glycan:: MonoSaccharide ,
37+ identification:: { BasicCSVData , IdentifiedPeptidoformSource , csv:: write_csv} ,
38+ quantities:: Tolerance ,
39+ sequence:: {
40+ AminoAcid , GnoComposition , SequencePosition , SimpleModificationInner ,
41+ parse_custom_modifications,
42+ } ,
43+ spectrum:: PeakSpectrum ,
44+ system:: MassOverCharge ,
45+ * ,
3546} ;
3647
3748/// The command line interface arguments
@@ -224,16 +235,16 @@ fn main() {
224235 // USI spectra are mostly loaded as the binary array maps instead of peaks regardless of the signal continuity level
225236 spectrum. peaks = spectrum. arrays . as_ref ( ) . map ( Into :: into) ;
226237 }
227- if let Some ( threshold) = args. tic_noise_threshold && let Some ( peaks) = spectrum. peaks . as_mut ( ) {
238+ if let Some ( threshold) = args. tic_noise_threshold && let Some ( peaks) = spectrum. peaks . as_mut ( ) {
228239 let threshold = peaks. total_ion_current ( ) * threshold;
229- peaks. peaks . retain ( |p : & mzdata:: mzpeaks:: CentroidPeak | p. intensity > threshold) ;
240+ peaks. peaks . retain ( |p : & mzdata:: mzpeaks:: CentroidPeak | p. intensity > threshold) ;
230241 }
231- if let Some ( threshold) = args. basepeak_noise_threshold && let Some ( peaks) = spectrum. peaks . as_mut ( ) {
242+ if let Some ( threshold) = args. basepeak_noise_threshold && let Some ( peaks) = spectrum. peaks . as_mut ( ) {
232243 let threshold = peaks. base_peak ( ) . map_or ( 0.0 , |v| v. intensity * threshold) ;
233- peaks. peaks . retain ( |p : & mzdata:: mzpeaks:: CentroidPeak | p. intensity > threshold) ;
244+ peaks. peaks . retain ( |p : & mzdata:: mzpeaks:: CentroidPeak | p. intensity > threshold) ;
234245 }
235- if let Some ( threshold) = args. absolute_noise_threshold && let Some ( peaks) = spectrum. peaks . as_mut ( ) {
236- peaks. peaks . retain ( |p : & mzdata:: mzpeaks:: CentroidPeak | p. intensity > threshold) ;
246+ if let Some ( threshold) = args. absolute_noise_threshold && let Some ( peaks) = spectrum. peaks . as_mut ( ) {
247+ peaks. peaks . retain ( |p : & mzdata:: mzpeaks:: CentroidPeak | p. intensity > threshold) ;
237248 }
238249 let fragments = line. sequence . generate_theoretical_fragments ( line. z , selected_model) ;
239250 let annotated = spectrum. annotate (
0 commit comments