How to open an Agilent ChemStation .MS file (GC-MS) and view the mass spectra
A GC-MS or single-quadrupole LC-MS run in ChemStation stores its mass spectra in data.ms (or MSD1.MS) inside the .D folder. Without MSD ChemStation you cannot open it directly, but the file can be decoded elsewhere.
What the file contains
One scan per time point. Each scan is a list of m/z and abundance pairs. The m/z values are stored in steps of 0.05 Da; for unit-resolution quadrupole data they are grouped to whole masses for display. SIM runs store only the ions that were monitored.
In your browser
- Open Nagura Lab and drop the
.Dfolder, or the.msfile on its own. - The main chart shows the total ion chromatogram (TIC): the summed abundance of all ions in each scan.
- Click Explore spectra next to the
.msfile in the list (it opens by itself when it is the only multi-channel file). Then click a peak in the chromatogram to see the mass spectrum at that time. - Type an m/z and a window (for example 57 ± 0.5) and press Add chromatogram to get the extracted ion chromatogram (XIC). Add several to compare ions.
- Export the plotted chromatograms with Download CSV, or every scan with Download spectra matrix (one row per scan, one column per m/z).
Nothing is uploaded; the file is decoded on your computer.
In Python
import rainbow as rb
ms = rb.read("sample.D").get_file("data.ms")
tic = ms.data.sum(axis=1) # total ion chromatogram
xic = ms.extract_traces(57)[0] # extracted ion chromatogram, m/z 57
times, mz = ms.xlabels, ms.ylabels # minutes, m/z
What this does not replace
- Library search. Identifying compounds against the NIST library needs NIST MS Search or AMDIS; export the spectrum and search it there.
- MassHunter data. Q-TOF and triple-quad runs from MassHunter use a different
.dlayout (anAcqDatafolder). Nagura Lab does not read those yet.