# OpenSZRaw
[](https://github.com/Sigilweaver/OpenSZRaw/actions/workflows/ci.yml)
[](https://crates.io/crates/openszraw)
[](https://pypi.org/project/openszraw/)
[](https://docs.rs/openszraw)
[](LICENSE)
[](https://www.rust-lang.org)
Rust and Python reader for Shimadzu LabSolutions mass spectrometry raw
data (`.lcd` LC-MS, `.qgd` GCMS, `.gcd` GC), with no Shimadzu SDK or
software dependency. Covers `.qgd` GC-MS (full-scan profile and
MRM/targeted) and `.lcd` LC-MS across IT-TOF (profile) and QTOF
(centroid) acquisitions.
Documentation: [sigilweaver.app/openszraw/docs](https://sigilweaver.app/openszraw/docs)
> Sibling readers in the same stack:
> [OpenTFRaw](https://github.com/Sigilweaver/OpenTFRaw) (Thermo),
> [OpenWRaw](https://github.com/Sigilweaver/OpenWRaw) (Waters),
> [OpenTimsTDF](https://github.com/Sigilweaver/OpenTimsTDF) (Bruker),
> [OpenARaw](https://github.com/Sigilweaver/OpenARaw) (Agilent),
> [OpenSXRaw](https://github.com/Sigilweaver/OpenSXRaw) (SCIEX).
## Install
**Prefer [`openmassspec-io`](https://github.com/Sigilweaver/OpenMassSpec)
with the `shimadzu` feature/extra** unless you need this parser standalone
(minimal dependencies, or building your own abstraction) - the umbrella
gives you format auto-detection, mzML conversion, and Arrow streaming
across all wired-in vendors for free:
```sh
cargo add openmassspec-io --features shimadzu
```
```sh
pip install openmassspec[shimadzu]
```
Standalone:
Rust:
```sh
cargo add openszraw
```
Python:
```sh
pip install openszraw
```
## Quickstart
Rust:
```rust
use openszraw::reader::Reader;
use openmassspec_core::SpectrumSource;
let mut reader = Reader::open("sample.lcd")?;
for spectrum in reader.iter_spectra() {
println!("{}: {} peaks", spectrum.native_id, spectrum.mz.len());
}
```
Python:
```python
import openszraw
reader = openszraw.RawReader("sample.lcd")
spectrum = reader.read_spectrum(0)
print(spectrum.ms_level, spectrum.retention_time_sec, len(spectrum.mz))
```
`Reader::open` (and `RawReader`) auto-detects `.qgd` vs `.lcd` IT-TOF vs
`.lcd` QTOF from the file's internal CFBF stream layout, never from the
filename or extension alone.
See the [docs site](https://sigilweaver.app/openszraw/docs) for the full
guide, format specification, and API reference.
## License
Apache-2.0. See [LICENSE](LICENSE).
The format specification was developed by binary analysis of public
mass-spectrometry datasets (PRIDE, MassIVE, and MetaboLights accessions).
See [CORPUS.md](CORPUS.md) and [ATTRIBUTION.md](ATTRIBUTION.md).