-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c0aa08d
commit 6e5848d
Showing
19 changed files
with
641 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use std::fs; | ||
use mzdata::prelude::*; | ||
use mzpeaks::{Tolerance, prelude::*}; | ||
use mzdata::io::MzMLReader; | ||
use mzdata::spectrum::SignalContinuity; | ||
|
||
|
||
fn main() { | ||
let mut ms1_count = 0; | ||
let mut msn_count = 0; | ||
let reader = MzMLReader::new(fs::File::open("./test/data/small.mzML").unwrap()); | ||
for spectrum in reader { | ||
if spectrum.ms_level() == 1 { | ||
ms1_count += 1; | ||
} else { | ||
msn_count += 1; | ||
} | ||
println!("Scan {} => BP {}", spectrum.id(), spectrum.peaks().base_peak().mz); | ||
if spectrum.signal_continuity() < SignalContinuity::Profile { | ||
let peak_picked = spectrum.into_centroid().unwrap(); | ||
println!("Matches for 579.155: {:?}", peak_picked.peaks.all_peaks_for(579.155, Tolerance::Da(0.02))); | ||
} | ||
} | ||
println!("MS1 Count: {}\nMSn Count: {}", ms1_count, msn_count); | ||
assert_eq!(ms1_count, 14); | ||
assert_eq!(msn_count, 34); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
mod infer_format; | ||
pub mod mgf; | ||
pub mod mzml; | ||
#[cfg(feature = "mzmlb")] | ||
pub mod mzmlb; | ||
mod offset_index; | ||
pub mod traits; | ||
mod utils; | ||
mod infer_format; | ||
|
||
pub(crate) mod compression; | ||
|
||
pub use crate::io::utils::{DetailLevel, PreBufferedStream}; | ||
pub use crate::io::mgf::{MGFReader, MGFError, MGFWriter}; | ||
pub use crate::io::mzml::{MzMLReader, MzMLParserError, MzMLWriter}; | ||
pub use crate::io::infer_format::{ | ||
infer_format, infer_from_path, infer_from_stream, open_file, MassSpectrometryFormat, | ||
}; | ||
pub use crate::io::mgf::{MGFError, MGFReader, MGFWriter}; | ||
#[cfg(feature = "async")] | ||
pub use crate::io::mzml::AsyncMzMLReaderType; | ||
pub use crate::io::mzml::{MzMLParserError, MzMLReader, MzMLWriter}; | ||
#[cfg(feature = "mzmlb")] | ||
pub use crate::io::mzmlb::{MzMLbReader, MzMLbError}; | ||
pub use crate::io::mzmlb::{MzMLbError, MzMLbReader}; | ||
pub use crate::io::offset_index::OffsetIndex; | ||
pub use crate::io::traits::{RandomAccessSpectrumIterator, ScanAccessError, SpectrumIterator, ScanSource}; | ||
pub use crate::io::infer_format::{open_file, infer_format, infer_from_path, MassSpectrometryFormat}; | ||
pub use crate::io::traits::{ | ||
RandomAccessSpectrumIterator, ScanAccessError, ScanSource, SpectrumIterator, | ||
}; | ||
pub use crate::io::utils::{DetailLevel, PreBufferedStream}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.