Skip to content

Commit

Permalink
feature: add referenceParamGroup inference for `instrumentConfigura…
Browse files Browse the repository at this point in the history
…tion` when writing mzML, and escape newlines in `Param` values
  • Loading branch information
mobiusklein committed May 5, 2024
1 parent 5632a2f commit eb5f4dc
Show file tree
Hide file tree
Showing 2 changed files with 300 additions and 34 deletions.
32 changes: 32 additions & 0 deletions examples/describe_instrument.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
use std::env;
use std::io;

use mzdata::prelude::*;
use mzdata::mz_read;

fn main() -> io::Result<()> {
env_logger::init();
let inpath = env::args().nth(1).unwrap_or_else(|| {
eprintln!("Please provide a path to read an MS data file from, or '-'");
std::process::exit(1)
});

let configs = mz_read!(inpath, reader => {
reader.instrument_configurations().clone()
})?;

for (k, config) in configs.iter() {
println!("Configuration ID: {k}");
for component in config.components.iter() {
println!("\t{:?} -> {}\n", component.component_type, component.order);
for p in component.params() {
println!("\t{p}");
}
}
for p in config.params() {
println!("{p}");
}
}

Ok(())
}
Loading

0 comments on commit eb5f4dc

Please sign in to comment.