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
82 changes: 13 additions & 69 deletions Cargo.lock

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

9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ members = ["crates/parser", "crates/cli", "crates/xtask"]
resolver = "3"

[workspace.package]
version = "0.1.1"
version = "0.1.2"
license = "MIT"
authors = [
"Javier Osorio M <javier.osorio.mosquera@gmail.com>",
"Julien Wist <julien.wist@correounivalle.edu.co>",
"Jorge Osorio M <joheosmo@gmail.com>"
]
edition = "2024"
rust-version = "1.85"
repository = "https://github.com/phenological/ionic"
homepage = "https://github.com/phenological/ionic"

[workspace.dependencies]
base64 = "0.22.1"
Expand All @@ -19,8 +23,7 @@ quick-xml = "0.40.1"
serde = { version = "1", features = ["derive"] }
serde_json = "1.0"
clap = "4.6.1"
zstd = "0.13.3"
ruzstd = "0.8.3"
cosmoz = { version = "0.1.0", features = ["std"] }
regex = "1.12.4"
rayon = "1.12.0"
itoa = "1.0"
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ output.flush()?;

```rust
pub struct WriteOptions {
pub compression_level: u8, // 0 = off, 1..=22 zstd; default 22
pub compression_level: u8, // 0 = off, 1..=22 zstd; default 12
pub force_f32: bool, // narrow f64 arrays to f32 (lossy); default false
pub block_size: usize, // target uncompressed block bytes; default 1 MiB
pub parallel: bool, // default true
Expand All @@ -138,9 +138,10 @@ A fixed 1024-byte header stores the byte offset of every section. A reader uses
## Portability

The library depends only on standard byte operations: no HDF5, no storage engine, nothing
to install alongside a file. On `wasm32-unknown-unknown` the build swaps `zstd` for the
pure-Rust `ruzstd` and drops `rayon` and `memmap2`, so the same reader compiles into a
browser bundle. That is what [ion-beam](https://github.com/phenological/ion-beam) runs on.
to install alongside a file. Compression uses the pure-Rust [cosmoz](https://crates.io/crates/cosmoz)
on every target, so native and `wasm32-unknown-unknown` share the same zstd code. The wasm build
drops `rayon` and `memmap2`, and browser conversions use compression level 1. That is what
[ion-beam](https://github.com/phenological/ion-beam) runs on.

## Related projects

Expand Down
8 changes: 8 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
[
{
"package": "0.1.2",
"format": {
"current": 1,
"min_supported": 0,
"max_supported": 1
}
},
{
"package": "0.1.1",
"format": {
Expand Down
7 changes: 4 additions & 3 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
name = "cli"
version.workspace = true
license.workspace = true
edition = "2024"
edition.workspace = true
publish = false

[dependencies]
serde = { workspace = true }
serde_json = { workspace = true }
clap = { workspace = true, features = ["derive"] }
ionic = { path = "../parser" }
ionic = { package = "ionic-rs", path = "../parser", version = "0.1.2" }
regex = { workspace = true }
rayon = { workspace = true }
mimalloc = { version = "0.1.48" }
crc32fast = "1.5.0"
memmap2 = "0.9"
zstd = { workspace = true }
cosmoz = { workspace = true }

[[bin]]
name = "ionic"
Expand Down
4 changes: 2 additions & 2 deletions crates/cli/src/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ the relative folder structure under `--output-path`.

- `--level <0..22>`
- zstd compression level for the data blocks. `0` disables compression.
Default: `22`.
Default: `12`.

- `--mz-window <DA>`
- Width, in Da (m/z units), of the windowed layout. A spectrum's m/z and intensity
Expand Down Expand Up @@ -153,7 +153,7 @@ You may pass **at most one** of the following:

Defaults:

- `--level 22`, `--mz-window 250`, `--block-size 8`, `--storage disk`
- `--level 12`, `--mz-window 250`, `--block-size 8`, `--storage disk`

Run (defaults):

Expand Down
6 changes: 2 additions & 4 deletions crates/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ struct ConvertArgs {
#[arg(
long = "level",
conflicts_with = "update",
default_value_t = 22,
default_value_t = 12,
value_parser = clap::value_parser!(u8).range(0..=22),
help = "Compression level 0–22 (0 = off)"
)]
Expand Down Expand Up @@ -228,7 +228,6 @@ struct ConvertArgs {
which: ConvertWhich,
}


#[derive(Args)]
struct ConvertWhich {
#[arg(long = "mzml-to-ion", help = "Convert mzML to ion (default)")]
Expand Down Expand Up @@ -973,8 +972,7 @@ fn convert(cmd: ConvertArgs) -> Result<(), String> {

let t_all = Instant::now();

let default_mzml_to_ion =
!cmd.which.mzml_to_ion && !cmd.which.ion_to_mzml && !cmd.which.update;
let default_mzml_to_ion = !cmd.which.mzml_to_ion && !cmd.which.ion_to_mzml && !cmd.which.update;

let mzml_to_ion = cmd.which.mzml_to_ion || default_mzml_to_ion;
let ion_to_mzml = cmd.which.ion_to_mzml;
Expand Down
Loading
Loading