From e35357de2981a61fd92110cf0e894eef8ca29919 Mon Sep 17 00:00:00 2001 From: Michael Lazear Date: Wed, 25 Oct 2023 19:20:29 -0700 Subject: [PATCH] Release v0.14.4 --- CHANGELOG.md | 8 ++++++++ Cargo.lock | 6 +++--- crates/sage-cli/Cargo.toml | 2 +- crates/sage-cloudpath/Cargo.toml | 2 +- crates/sage-cloudpath/src/lib.rs | 2 +- crates/sage-cloudpath/src/tdf.rs | 33 ++++++++----------------------- crates/sage-cloudpath/src/util.rs | 2 +- crates/sage/Cargo.toml | 2 +- 8 files changed, 24 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5819a8b..f78d5c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [v0.14.4] +### Added +- **Unstable feature**: Preliminary support for reading Bruker .d folders (ddaPASEF; no MS1/LFQ support yet) +### Changed +- Retention times are converted to minutes +### Fixed +- Fixed bug where charge state 1 would never be searched + ## [v0.14.3] ### Fixed - Hotfix for bug in parquet LFQ writer diff --git a/Cargo.lock b/Cargo.lock index 5ca4281..5859a1c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2081,7 +2081,7 @@ checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" [[package]] name = "sage-cli" -version = "0.14.3" +version = "0.14.4" dependencies = [ "anyhow", "clap", @@ -2102,7 +2102,7 @@ dependencies = [ [[package]] name = "sage-cloudpath" -version = "0.14.3" +version = "0.14.4" dependencies = [ "async-compression", "aws-config", @@ -2126,7 +2126,7 @@ dependencies = [ [[package]] name = "sage-core" -version = "0.14.3" +version = "0.14.4" dependencies = [ "dashmap", "fnv", diff --git a/crates/sage-cli/Cargo.toml b/crates/sage-cli/Cargo.toml index 01341fc..ec9ac45 100644 --- a/crates/sage-cli/Cargo.toml +++ b/crates/sage-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sage-cli" -version = "0.14.3" +version = "0.14.4" authors = ["Michael Lazear , file_id: usize, - ) -> Result, TdfError> { + ) -> Result, timsrust::Error> { let dda_spectra: Vec = - timsrust::FileReader::new(path_name.as_ref().to_string()) - .unwrap() - .read_all_spectra(); - let spectra: Vec = dda_spectra + timsrust::FileReader::new(path_name.as_ref())?.read_all_spectra(); + let spectra: Vec = (0..dda_spectra.len()) .into_par_iter() - .map(|dda_spectrum| { + .map(|index| { + let dda_spectrum = &dda_spectra[index]; let mut precursor: Precursor = Precursor::default(); let dda_precursor: timsrust::Precursor = dda_spectrum.precursor.unwrap_as_precursor(); @@ -28,10 +24,10 @@ impl TdfReader { precursor.intensity = Option::from(dda_precursor.intensity as f32); precursor.spectrum_ref = Option::from(dda_precursor.frame_index.to_string()); let spectrum: RawSpectrum = RawSpectrum { - file_id: file_id, + file_id, precursors: vec![precursor], representation: Representation::Centroid, - scan_start_time: dda_precursor.rt as f32, + scan_start_time: dda_precursor.rt as f32 / 60.0, ion_injection_time: dda_precursor.rt as f32, total_ion_current: 0.0, mz: dda_spectrum.mz_values.iter().map(|&x| x as f32).collect(), @@ -47,16 +43,3 @@ impl TdfReader { Ok(spectra) } } - -#[derive(thiserror::Error, Debug)] -pub enum TdfError { - Unreadable, -} - -impl Display for TdfError { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - match self { - TdfError::Unreadable => f.write_str("Tdf Error : Malformed data."), - } - } -} diff --git a/crates/sage-cloudpath/src/util.rs b/crates/sage-cloudpath/src/util.rs index b2ba4b3..1d6eb2f 100644 --- a/crates/sage-cloudpath/src/util.rs +++ b/crates/sage-cloudpath/src/util.rs @@ -16,7 +16,7 @@ pub fn read_mzml>( } pub fn read_tdf>(s: S, file_id: usize) -> Result, Error> { - let res = crate::tdf::TdfReader::default().parse(s, file_id); + let res = crate::tdf::TdfReader.parse(s, file_id); match res { Ok(t) => Ok(t), Err(e) => Err(Error::TDF(e)), diff --git a/crates/sage/Cargo.toml b/crates/sage/Cargo.toml index 55d2955..8339757 100644 --- a/crates/sage/Cargo.toml +++ b/crates/sage/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sage-core" -version = "0.14.3" +version = "0.14.4" authors = ["Michael Lazear