Skip to main content

Python wrapper for ProteoWizard msconvert with Docker support and preset configs

Project description

msconvert-cli

A Python wrapper around the ProteoWizard msconvert Docker image for converting mass spectrometry files.

Installation

uv pip install msconvert-cli

Or install from source:

git clone https://github.com/pgarrett-scripps/msconvert-cli.git
cd msconvert-cli
uv pip install -e .

Quick Start

Basic conversion with a preset config:

# Convert files using Sage preset (mzML, 32-bit, compressed)
mscli /path/to/raw/files/ -o /output/dir --sage

# Convert with multiple workers (runs 1 file per worker due to Wine limitations)
mscli /data/*.raw -o /output --blitzff --workers 4

# Verbose logging
mscli /data/*.raw -o /output --casanovo -v

Available Presets

  • --sage: mzML, 32-bit, zlib/gzip compression
  • --biosaur: mzML format
  • --blitzff: mzML, MS1 only, 32-bit, zlib/gzip
  • --casanovo: mzML, MS2 only, m/z [50-2500], denoised, top 200 peaks
  • --casanovo_mgf: Same as casanovo but MGF format

Usage Examples

# Convert all RAW files in a directory
mscli /data/raw_files/ -o /output --sage

# Convert specific files with custom config
mscli file1.raw file2.raw -o /output -c my_config.txt

# Parallel conversion (4 workers, 1 file per worker)
mscli /data/*.raw -o /output --blitzff --workers 4

# Parallel conversion with resource limits
mscli /data/*.raw -o /output --sage --workers 4 --worker-cores 2.0 --worker-memory 4g

# Limit memory and disable swap
mscli /data/*.raw -o /output --sage --worker-memory 4g --worker-swap 4g

# Increase shared memory for large files
mscli /data/*.raw -o /output --sage --worker-shm-size 2g

# Verbose logging to custom file
mscli /data/*.raw -o /output --sage -v --log conversion.log

# Use a specific Docker image version
mscli /data/*.raw -o /output --sage --docker-image proteowizard/pwiz-skyline-i-agree-to-the-vendor-licenses:3.0.23310

# Pass additional msconvert arguments
mscli data.raw -o /output --filter "peakPicking vendor msLevel=1"

Docker Resource Limits

You can control resource allocation for each worker container:

  • --worker-cores: CPU cores per container (e.g., 2.0, 0.5)
  • --worker-memory: RAM limit (e.g., 4g, 2048m)
  • --worker-swap: Swap limit (e.g., 1g). Set equal to memory to disable swap.
  • --worker-shm-size: Shared memory size (default: 512m). Increase for large files.

Example with all limits:

mscli /data/*.raw -o /output --sage \
  --workers 4 \
  --worker-cores 2.0 \
  --worker-memory 4g \
  --worker-swap 4g \
  --worker-shm-size 1g

Logging

Logs are automatically created in the output directory when using -v (verbose mode):

# Auto-generates: /output/msconvert_20251023_144550.log
mscli /data/*.raw -o /output --sage -v

# Or specify a custom log file
mscli /data/*.raw -o /output --sage -v --log my_run.log

Log files include:

  • Full command details
  • Processing progress for each file
  • stdout/stderr from msconvert
  • Error details when conversions fail

Notes

  • Requires Docker to be installed and running
  • Uses proteowizard/pwiz-skyline-i-agree-to-the-vendor-licenses Docker image
  • Multi-worker mode processes 1 file per worker
  • Supports: .raw, .wiff, .d, .baf, and other vendor formats

Development

# Install with dev dependencies
uv sync

# Run pre-commit hooks
uv run pre-commit run -a

# Run the CLI locally
uv run mscli --help

Repository initiated with fpgmaas/cookiecutter-uv.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

msconvert_cli-0.6.0.tar.gz (32.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

msconvert_cli-0.6.0-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file msconvert_cli-0.6.0.tar.gz.

File metadata

  • Download URL: msconvert_cli-0.6.0.tar.gz
  • Upload date:
  • Size: 32.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for msconvert_cli-0.6.0.tar.gz
Algorithm Hash digest
SHA256 6527ad83ef04be114a0c6cc90f52d6e8b0f98cd554260df8c67ced847b8d3fd1
MD5 54963fbb9c3936606d85a06f9fbcea39
BLAKE2b-256 419c342c620560f492bdeea4f735431fe03f44c77ea62497b6e26ecff73c7a56

See more details on using hashes here.

File details

Details for the file msconvert_cli-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: msconvert_cli-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for msconvert_cli-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a02228fe328675c182ff888b532d7ba0f7600d8803068303449923e551d7277c
MD5 1b5d10ddddb2ae9a3ff3328dae21ca93
BLAKE2b-256 5a1aae165c13f0920c99d2df9d5f1f2d57e588be18450360603a00aebb562aa8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page