30 releases (7 stable)
new 1.0.7 | Feb 11, 2025 |
---|---|
1.0.1 | Dec 24, 2024 |
0.23.0 | Nov 10, 2024 |
0.17.0 | Jul 12, 2024 |
0.1.0 | Jul 31, 2021 |
#203 in Data structures
1,371 downloads per month
Used in 9 crates
(7 directly)
345KB
9K
SLoC
mzpeaks
mzpeaks
implements the building blocks and machinery for representing peaks
in a mass spectrum.
It's meant to be used as a building block for other tools and does not provide any I/O machinery for peak lists
Usage
use mzpeaks::{CentroidPeak, PeakSet, PeakCollection, Tolerance};
let peaks = PeakSet::new(vec![
CentroidPeak::new(186.04, 522.0, 0),
CentroidPeak::new(204.07, 9800.0, 1),
CentroidPeak::new(205.07, 150.0, 2)
]);
assert_eq!(peaks.search(204.05, Tolerance::Da(0.02)).unwrap(), 1);
let peak = match peaks.has_peak(204.05, Tolerance::Da(0.02)) {
Some(p) => p,
None => panic!("Failed to retrieve peak!")
};
assert!((peak.mz - 204.07).abs() < 1e-6);
lib.rs
:
mzpeaks
implements the building blocks and machinery for representing peaks
in a mass spectrum.
It's meant to be used as a building block for other tools and does not provide
any I/O machinery for peak lists. For that, consider mzdata
use mzpeaks::{CentroidPeak, PeakSet, PeakCollection, Tolerance};
let peaks = PeakSet::new(vec![
CentroidPeak::new(186.04, 522.0, 0),
CentroidPeak::new(204.07, 9800.0, 1),
CentroidPeak::new(205.07, 150.0, 2)
]);
assert_eq!(peaks.search(204.05, Tolerance::Da(0.02)).unwrap(), 1);
let peak = match peaks.has_peak(204.05, Tolerance::Da(0.02)) {
Some(p) => p,
None => panic!("Failed to retrieve peak!")
};
assert!((peak.mz - 204.07).abs() < 1e-6);
Dependencies
~92–570KB
~11K SLoC