mzx package¶
Submodules¶
mzx.cli module¶
Module contents¶
- mzx.convert_raw_file(params: TConfig) str[source]¶
Convert the raw file to mzML format based on the vendor.
- mzx.exclusion_string(x: int) str[source]¶
Return a string representing “all positive integers except x,” using “start-end” ranges. By convention, “N-” means “N through ∞.”
- Examples:
exclude 5 → “1-4 6-” exclude 1 → “2-” exclude 2 → “1 3-” exclude 3 → “1-2 4-”
- mzx.export_chromatograms(raw_dir, chrom_info)[source]¶
Extract and export all chromatogram channels from a Waters .raw directory to CSV.
Output files are written to the parent directory of the .raw folder, named {raw_name}_{channel_name}.csv.
- Args:
raw_dir: Path to the Waters .raw directory. chrom_info: Channel metadata from get_chromatogram_info().
- Returns:
List of output CSV file paths.
- mzx.extract_tic_from_mzml(mzml_path, output_csv=None)[source]¶
Extract the Total Ion Current (TIC) from an mzML file and write to CSV.
Parses each spectrum element for scan start time and total ion current. Times are converted from minutes to seconds.
- Args:
mzml_path: Path to the mzML file. output_csv: Output CSV path. Defaults to {mzml_base}_TIC.csv.
- Returns:
Path to the output CSV file.
- mzx.get_chromatogram_info(raw_dir)[source]¶
Locate and parse _CHROMS.INF from a Waters .raw directory.
- Args:
raw_dir: Path to the Waters .raw directory.
- Returns:
List of chromatogram channel metadata from parse_chroinf.
- mzx.parse_chrodat(path)[source]¶
Parse a Waters _CHRO*.DAT binary file.
Each sample is 8 bytes: two little-endian 32-bit floats (time, intensity). Data starts at offset 0x80.
- Args:
path: Path to the _CHRO*.DAT file.
- Returns:
Tuple of (times, intensities) as lists of floats, or None if empty.
- mzx.parse_chroinf(path)[source]¶
Parse a Waters _CHROMS.INF file.
Reads channel metadata (name and unit) for each analog data file.
- Args:
path: Path to the _CHROMS.INF file.
- Returns:
List of [name, unit] pairs for each chromatogram channel.