Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ members = [
]

[workspace.package]
version = "0.25.0"
version = "0.26.0"
edition = "2024"
authors = ["Sebastian Paez"]
license = "Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "timsseek-workspace"
version = "0.25.0"
version = "0.26.0"
requires-python = ">=3.11,<3.13"
dependencies = [
"jupyter[python]>=1.1.1",
Expand Down Expand Up @@ -55,7 +55,7 @@ packages = [
]

[tool.bumpver]
current_version = "0.25.0"
current_version = "0.26.0"
version_pattern = "MAJOR.MINOR.PATCH[-PYTAGNUM]"
tag_message = "v{new_version}"
commit_message = "chore: bump version to {new_version}"
Expand Down
2 changes: 1 addition & 1 deletion python/speclib_builder/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "speclib_builder"
version = "0.25.0"
version = "0.26.0"
requires-python = ">=3.11,<3.13"
dependencies = [
"rich",
Expand Down
2 changes: 1 addition & 1 deletion python/timsseek_rescore/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "timsseek_rescore"
version = "0.25.0"
version = "0.26.0"
requires-python = ">=3.11,<3.13"
dependencies = [
"polars",
Expand Down
2 changes: 1 addition & 1 deletion python/timsseek_rts_receiver/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "timsseek_rts_receiver"
version = "0.25.0"
version = "0.26.0"
requires-python = ">=3.11,<3.13"
description = "Add your description here"
dependencies = [
Expand Down
1 change: 1 addition & 0 deletions rust/timsquery/src/models/aggregators/spectrum_agg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,4 @@ impl Add for MzMobilityStatsCollector {
}
}
}

52 changes: 52 additions & 0 deletions rust/timsquery/src/models/indexed_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@

use crate::models::aggregators::{
ChromatogramCollector,
MzMobilityStatsCollector,
PointIntensityAggregator,
SpectralCollector,
};
Expand Down Expand Up @@ -453,3 +454,54 @@ impl<FH: KeyLike> QueriableData<ChromatogramCollector<FH, f32>> for IndexedPeaks
}
}
}

impl<FH: KeyLike> QueriableData<SpectralCollector<FH, MzMobilityStatsCollector>> for IndexedPeaksHandle {
fn add_query(
&self,
aggregator: &mut SpectralCollector<FH, MzMobilityStatsCollector>,
tolerance: &Tolerance,
) {
match self {
IndexedPeaksHandle::Eager(eager) => eager.add_query(aggregator, tolerance),
IndexedPeaksHandle::Lazy(lazy) => {
let ranges = QueryRanges::from_elution_group(aggregator, tolerance, |rt| {
lazy.rt_ms_to_cycle_index(rt)
});

let cycle_range_u32 = match ranges.ms1_cycle_range {
Restricted(x) => Restricted(
TupleRange::try_new(x.start().as_u32(), x.end().as_u32()).unwrap(),
),
Unrestricted => Unrestricted,
};

aggregator
.iter_mut_precursors()
.for_each(|((_idx, mz), ion)| {
let mz_range = tolerance.mz_range_f32(mz as f32);
lazy.query_peaks_ms1(mz_range, cycle_range_u32, ranges.im_range)
.for_each(|peak| {
*ion += peak;
});
});

aggregator
.iter_mut_fragments()
.for_each(|((_idx, mz), ion)| {
let mz_range = tolerance.mz_range_f32(*mz as f32);
let results = lazy.query_peaks_ms2(
ranges.quad_range,
mz_range,
cycle_range_u32,
ranges.im_range,
);
for (_isolation_scheme, peaks) in results {
for peak in peaks {
*ion += peak;
}
}
});
}
}
}
}
17 changes: 17 additions & 0 deletions rust/timsquery/src/models/tolerance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,4 +406,21 @@ impl Tolerance {
..self
}
}

/// Scale the mobility tolerance by `factor` (e.g. 2.0 to double the window).
pub fn with_wider_mobility(self, factor: f32) -> Self {
let wider = match self.mobility {
MobilityTolerance::Absolute((low, high)) => {
MobilityTolerance::Absolute((low * factor, high * factor))
}
MobilityTolerance::Pct((low, high)) => {
MobilityTolerance::Pct((low * factor, high * factor))
}
MobilityTolerance::Unrestricted => MobilityTolerance::Unrestricted,
};
Self {
mobility: wider,
..self
}
}
}
10 changes: 3 additions & 7 deletions rust/timsquery/src/traits/key_like.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,11 @@ pub trait KeyLike: Clone + Eq + Serialize + Hash + Send + Sync + Debug + Default
///
/// # Required Bounds
///
/// - `Copy`: Values must be trivially copyable (typically numeric types)
/// - `Clone`: Implied by `Copy`, but explicit for clarity
/// - `Clone`: Values must be cloneable
/// - `Serialize`: Values must be serializable for output and analysis
/// - `Send + Sync`: Values must be thread-safe for parallel aggregation
/// - `Debug`: Values must be debuggable for verification
///
/// Note: The `Copy` bound restricts values to small, stack-allocated types like
/// numeric primitives (`f32`, `f64`, `u32`, etc.) and small aggregates.
///
/// # Examples
///
/// Common value types include:
Expand All @@ -61,7 +57,7 @@ pub trait KeyLike: Clone + Eq + Serialize + Hash + Send + Sync + Debug + Default
/// use half::f16;
/// let _value: f16 = f16::from_f32(123.4);
/// ```
pub trait ValueLike: Copy + Clone + Serialize + Send + Sync + Debug {}
pub trait ValueLike: Clone + Serialize + Send + Sync + Debug {}

impl<T: Clone + Eq + Serialize + Hash + Send + Sync + Debug + Default> KeyLike for T {}
impl<T: Copy + Clone + Serialize + Send + Sync + Debug> ValueLike for T {}
impl<T: Clone + Serialize + Send + Sync + Debug> ValueLike for T {}
1 change: 1 addition & 0 deletions rust/timsquery_viewer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ egui_plot = "0.34"
egui_extras = { version = "0.33", features = ["serde"] }
egui_dock = { version = "0.18", features = ["serde"] }
rfd = "0.16" # File dialogs dependency
image = { version = "0.25", default-features = false, features = ["png"] }
ron = "0.12.0" # Yet another serialization format ...

# Workspace-inherited deps
Expand Down
Loading