Skip to content

mmmddd98/XCaliburMethodReader

 
 

Repository files navigation

XCaliburMethodReader

Read Thermo XCalibur .meth method files from Python or the command line.

This fork focuses on read-only method inspection. It keeps the original ability to list and export streams from XCalibur method files, and adds a small Python API for extracting LC gradients as tables and plots.

Features

  • list streams inside a Thermo .meth OLE container
  • read Text and Data streams as text, XML, or dictionaries
  • extract LC gradient points into a pandas.DataFrame
  • plot solvent B gradients with matplotlib
  • command-line interface plus importable Python functions

The project does not write or modify .meth files.

Installation

For development from this repository:

python -m pip install -e .

Python Usage

from xcalibur_method_reader import read_method, extract_gradients, plot_gradient

method = read_method("example.meth")
print(method.stream_names())

instrument = method.read_dict("Thermo Exactive")
gradient = extract_gradients("example.meth")

print(gradient)

Plot the gradient:

ax = plot_gradient("example.meth")
ax.figure.savefig("gradient.png", dpi=160, bbox_inches="tight")

The gradient table uses one row per pump and time point when the method format contains pump-specific information:

time_min,pump,percent_b,flow_ul_min,curve
0.0,NC_Pump,1.0,0.5,5.0
29.0,NC_Pump,25.0,0.5,5.0
41.0,NC_Pump,44.0,0.5,5.0

Older EASY-nLC style methods are also supported when their gradient is stored in the XML gradients/methodgradient section.

Command Line

List streams:

xcalibur-method-reader example.meth

Export one stream:

xcalibur-method-reader example.meth --stream "Thermo Exactive" --to json

Print gradient points as CSV:

xcalibur-method-reader example.meth --gradients

Write a gradient plot:

xcalibur-method-reader example.meth --gradients --plot-gradient gradient.png

Limit output to one pump:

xcalibur-method-reader example.meth --gradients --pump NC_Pump

Compatibility

The historical console command XCaliburMethodReader and module import import XCaliburMethodReader are still available. New code should prefer the package import:

import xcalibur_method_reader

Notes

Thermo method files vary by instrument and LC system. This reader currently handles the stream/XML patterns covered by the included test method and by Chromeleon/SII-style text summaries where pump gradients are written as timed PumpModule...%B.Value steps. Unsupported streams are skipped during gradient extraction rather than being modified or guessed.

About

A Thermo XCalibur Method (.meth) file reader, extracter, and converter command-line program for mass spectrometry researchers.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Jupyter Notebook 70.9%
  • Python 29.1%