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.
- list streams inside a Thermo
.methOLE container - read
TextandDatastreams 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.
For development from this repository:
python -m pip install -e .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.
List streams:
xcalibur-method-reader example.methExport one stream:
xcalibur-method-reader example.meth --stream "Thermo Exactive" --to jsonPrint gradient points as CSV:
xcalibur-method-reader example.meth --gradientsWrite a gradient plot:
xcalibur-method-reader example.meth --gradients --plot-gradient gradient.pngLimit output to one pump:
xcalibur-method-reader example.meth --gradients --pump NC_PumpThe historical console command XCaliburMethodReader and module import
import XCaliburMethodReader are still available. New code should prefer the
package import:
import xcalibur_method_readerThermo 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.