Skip to content

Commit

Permalink
CHORE: grouped ms data together
Browse files Browse the repository at this point in the history
  • Loading branch information
sander-willems-bruker committed Apr 8, 2024
1 parent 0211d13 commit 8c39a9e
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/calibration.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
converters::{ConvertableDomain, Tof2MzConverter},
spectra::RawSpectrum,
data::spectra::RawSpectrum,
Precursor,
};

Expand Down
9 changes: 9 additions & 0 deletions src/data.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pub mod acquisition;
pub mod frames;
pub mod precursors;
pub mod spectra;

pub use acquisition::AcquisitionType;
pub use frames::{Frame, FrameType};
pub use precursors::{Precursor, QuadrupoleEvent};
pub use spectra::Spectrum;
1 change: 1 addition & 0 deletions src/acquisition.rs → src/data/acquisition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
pub enum AcquisitionType {
DDAPASEF,
DIAPASEF,
PRMPASEF,
Unknown,
}
2 changes: 1 addition & 1 deletion src/frames.rs → src/data/frames.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::acquisition::AcquisitionType;
use crate::AcquisitionType;

/// A frame with all unprocessed data as it was acquired.
#[derive(Debug, PartialEq, Default)]
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions src/spectra.rs → src/data/spectra.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use crate::{
converters::{ConvertableDomain, Tof2MzConverter},
precursors::QuadrupoleEvent,
vec_utils::{filter_with_mask, find_sparse_local_maxima_mask},
Precursor,
Precursor, QuadrupoleEvent,
};

pub struct RawSpectrumProcessor {
Expand Down
3 changes: 1 addition & 2 deletions src/file_readers/frame_readers/tdf_reader.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use {
crate::{
acquisition::AcquisitionType,
converters::{
ConvertableDomain, Frame2RtConverter, Scan2ImConverter,
Tof2MzConverter,
Expand All @@ -12,7 +11,7 @@ use {
},
ReadableFrames,
},
Frame, FrameType,
AcquisitionType, Frame, FrameType,
},
rayon::prelude::*,
std::path::Path,
Expand Down
7 changes: 3 additions & 4 deletions src/file_readers/spectrum_readers/dda_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ mod precursors;
use crate::{
calibration::Tof2MzCalibrator,
converters::Tof2MzConverter,
data::spectra::RawSpectrum,
data::spectra::{self, RawSpectrumProcessor},
file_readers::{
frame_readers::{tdf_reader::TDFReader, ReadableFrames},
ReadableSpectra,
},
frames::Frame,
spectra::RawSpectrum,
spectra::{self, RawSpectrumProcessor},
vec_utils::group_and_sum,
Spectrum,
Frame, Spectrum,
};

use rayon::prelude::*;
Expand Down
3 changes: 1 addition & 2 deletions src/file_readers/spectrum_readers/mini_tdf_reader.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::file_readers::FileFormatError;
use crate::{file_readers::FileFormatError, QuadrupoleEvent};
use std::fs;
use {
crate::{
Expand All @@ -9,7 +9,6 @@ use {
},
ReadableSpectra,
},
precursors::QuadrupoleEvent,
Precursor, Spectrum,
},
rayon::prelude::*,
Expand Down
12 changes: 4 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,20 @@
//! * *.ms2spectrum.bin
//! * *.ms2spectrum.parquet
mod acquisition;
mod calibration;
mod converters;
mod data;
mod errors;
mod file_readers;
mod frames;
mod precursors;
mod spectra;
mod vec_utils;

pub use crate::{
acquisition::AcquisitionType,
converters::{
ConvertableDomain, Frame2RtConverter, Scan2ImConverter, Tof2MzConverter,
},
data::{
AcquisitionType, Frame, FrameType, Precursor, QuadrupoleEvent, Spectrum,
},
errors::*,
file_readers::FileReader,
frames::{Frame, FrameType},
precursors::{Precursor, QuadrupoleEvent},
spectra::Spectrum,
};

0 comments on commit 8c39a9e

Please sign in to comment.