Metadata-Version: 2.1
Name: LibViz
Version: 0.2.0
Summary: App to visualize MS library spectra
Author-Email: Matteo Miotto <miotsdata@gmail.com>
License: MIT
Requires-Python: <3.14,>=3.13
Requires-Dist: sqlalchemy>=2.0.46
Requires-Dist: alembic>=1.18.4
Requires-Dist: pandas>=3.0.0
Requires-Dist: numpy>=2.4.2
Requires-Dist: pyteomics>=4.7.5
Requires-Dist: tqdm>=4.67.3
Requires-Dist: lxml>=6.0.2
Provides-Extra: gui
Requires-Dist: pyside6-essentials>=6.12.0; extra == "gui"
Requires-Dist: pyside6-addons>=6.12.0; extra == "gui"
Provides-Extra: all
Requires-Dist: libviz[gui]; extra == "all"
Description-Content-Type: text/markdown

# LibViz

Build, inspect and curate MS/MS spectral libraries.

- **Build** libraries from mzML files (DDA, DIA, imaging) and a target list: one spectrum per compound/adduct/CE, you pick the best scan.
- **Import** MSP libraries (MoNA, MS-DIAL, NIST-style exports).
- **Inspect** libraries: search compounds, view spectra and metadata, even with 500k+ spectra.
- **Curate**: edit/delete compounds, spectra and metadata; export MSP; merge libraries.
- **QC & search**: library overview with quality checks, spectrum comparison (cosine), spectral/analog search.

## Install

```bash
pdm install -G gui          # or: pip install "libviz[gui]"
pdm run libviz-gui
pdm run libviz build targets.csv run.mzML -o standards.db   # headless
```

Python 3.13, PySide6 ≥ 6.12.

## Use as a library

```python
from pathlib import Path
from libviz.core.library import Library

lib = Library.load_from_msp(Path("MoNA.msp"))
lib.save_as_db(Path("mona.db"))
lib = Library.load_from_db(Path("mona.db"))
lib.get_spectra_in_mz_range(195.08, 195.09, "POSITIVE")
```

## Development

```bash
pdm install -G :all
pdm run pytest
```

CI runs the tests on every push/PR to `develop`/`master`. Standalone builds (Windows installer, Linux AppImage) and the PyPI upload come from `release-builds.yml`; see [releasing](docs/release.md).

Docs: [user guide](docs/user-guide.md), [architecture](docs/architecture.md), [decisions](docs/adr/), [releasing](docs/release.md), [changelog](CHANGELOG.md).
