BinderScriptNotebook

MzMLToMzLiteIonMobility

MzMLToMzLiteIonMobility converts mzML files from ion mobility instruments such as the Bruker timsTOF into mzlite files. In these files every peak carries an ion mobility value next to its m/z and intensity, and the tool keeps that value in the mzlite. It is the ion mobility counterpart of MzMLToMzLite, which also explains how to get mzML from raw files and what mzlite is. The tool reads the same parameter record as MzMLToMzLite. The spectra are written with their m/z, intensity and ion mobility arrays as they are in the mzML, and Compress decides how those arrays are stored.

Inputs and outputs

Flag

Meaning

Comes from

-i

one or more mzML files with ion mobility data per peak, or a directory that is searched for *.mzML and *.mzml (not recursive)

msconvert

-o

the output directory, created when missing

-p

the parameter file in JSON, by default TIMsMzMLtoMzLiteParams.json

this page

-c

number of files converted at the same time, default 1

-f

switch: rewrite every input file in place and remove &quot

The reader fails on mzML without ion mobility data. -f rewrites every input file in place and removes the string &quot, for mzML exports where that string breaks the XML reader.

The tool writes one <run>.mzlite per input into the output directory. Spectra with an MS level other than 1 or 2 stop the conversion with an error. Scan times are stored in minutes. The mzlite is read by MsFraggerToPSM and PSMBasedQuantificationTIMs. The output directory also receives MzMLToMzLite_log.txt and one <run>_log.txt per input.

Parameters

Parameter

Default

Meaning

Compress

Compression.NoCompression

Compression of the peak arrays in the mzlite. Compression.ZLib and Compression.NumPress are the other options, Compression.NumPressZLib combines both.

StartRetentionTime

None

Same field as in MzMLToMzLite. Keep None, the spectra are copied as they are.

EndRetentionTime

None

Same field as in MzMLToMzLite. Keep None.

MS1PeakPicking

PeakPicking.Centroid (CentroidizationMode.Wavelet ms1Wavelet)

Same field as in MzMLToMzLite. The default file carries the wavelet record shown in the script below, and the MS1 peaks are copied as they are.

MS2PeakPicking

PeakPicking.Centroid (CentroidizationMode.Wavelet ms2Wavelet)

Same field as in MzMLToMzLite, with padding settings in the default file. The MS2 peaks are copied as they are.

The wavelet parameters are explained on the MzMLToMzLite page. The default file is TIMsMzMLtoMzLiteParams.json.

Writing a parameter file

open ProteomIQon
open ProteomIQon.Domain

let ms1Wavelet : WaveletPeakPickingParams =
    {
        NumberOfScales       = 3
        YThreshold           = YThreshold.Fixed 1.0
        Centroid_MzTolerance = 0.1
        SNRS_Percentile      = 95.0
        MinSNR               = 1.0
        RefineMZ             = false
        SumIntensities       = false
        PaddingParams        = None
    }

let ms2Padding : PaddingParams =
    {
        MaximumPaddingPoints = Some 7
        Padding_MzTolerance  = 0.05
        WindowSize           = 150
        SpacingPerc          = 95.0
    }

let ms2Wavelet : WaveletPeakPickingParams =
    {
        NumberOfScales       = 10
        YThreshold           = YThreshold.MinSpectrumIntensity
        Centroid_MzTolerance = 0.1
        SNRS_Percentile      = 95.0
        MinSNR               = 1.0
        RefineMZ             = false
        SumIntensities       = false
        PaddingParams        = Some ms2Padding
    }

let timsMzMLToMzLiteParams : Dto.MzMLtoMzLiteParams =
    {
        Compress           = Compression.NoCompression
        StartRetentionTime = None
        EndRetentionTime   = None
        MS1PeakPicking     = PeakPicking.Centroid (CentroidizationMode.Wavelet ms1Wavelet)
        MS2PeakPicking     = PeakPicking.Centroid (CentroidizationMode.Wavelet ms2Wavelet)
    }

// Replace the temp folder with your project folder.
let outputPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "TIMsMzMLtoMzLiteParams.json")

Json.serializeAndWrite outputPath timsMzMLToMzLiteParams

Running the tool

Install the tool with dotnet tool install --global ProteomIQon.MzMLToMzLiteIonMobility, then convert one run:

proteomiqon-mzmltomzliteionmobility -i path/to/run.mzML -o path/to/output -p path/to/TIMsMzMLtoMzLiteParams.json

Several runs, three of them converted at the same time:

proteomiqon-mzmltomzliteionmobility -i path/to/run1.mzML path/to/run2.mzML path/to/run3.mzML -o path/to/output -p path/to/TIMsMzMLtoMzLiteParams.json -c 3

A file that fails to parse because of a stray &quot:

proteomiqon-mzmltomzliteionmobility -i path/to/run.mzML -o path/to/output -p path/to/TIMsMzMLtoMzLiteParams.json -f

All flags:

proteomiqon-mzmltomzliteionmobility --help
namespace ProteomIQon
module Domain from ProteomIQon
val ms1Wavelet: WaveletPeakPickingParams
type WaveletPeakPickingParams = { NumberOfScales: int YThreshold: YThreshold Centroid_MzTolerance: float SNRS_Percentile: float MinSNR: float RefineMZ: bool SumIntensities: bool PaddingParams: PaddingParams option } member Equals: WaveletPeakPickingParams * IEqualityComparer -> bool
type YThreshold = | Fixed of float | MinSpectrumIntensity member Equals: YThreshold * IEqualityComparer -> bool member IsFixed: bool member IsMinSpectrumIntensity: bool
union case YThreshold.Fixed: float -> YThreshold
type PaddingParams = { MaximumPaddingPoints: int option Padding_MzTolerance: float WindowSize: int SpacingPerc: float } member Equals: PaddingParams * IEqualityComparer -> bool
union case Option.None: Option<'T>
val ms2Padding: PaddingParams
union case Option.Some: Value: 'T -> Option<'T>
type WindowSize = | Fixed of int | EstimateUsingAutoCorrelation of float member Equals: WindowSize * IEqualityComparer -> bool member IsEstimateUsingAutoCorrelation: bool member IsFixed: bool
val ms2Wavelet: WaveletPeakPickingParams
union case YThreshold.MinSpectrumIntensity: YThreshold
val timsMzMLToMzLiteParams: Dto.MzMLtoMzLiteParams
module Dto from ProteomIQon
Multiple items
module MzMLtoMzLiteParams from ProteomIQon.Dto

--------------------
type MzMLtoMzLiteParams = Dto.PreprocessingParams
Multiple items
module Compression from ProteomIQon.Common

--------------------
[<Struct>] type Compression = | NoCompression = 0 | ZLib = 1 | NumPress = 2 | NumPressZLib = 3
Compression.NoCompression: Compression = 0
type PeakPicking = | ProfilePeaks | Centroid of CentroidizationMode member Equals: PeakPicking * IEqualityComparer -> bool member IsCentroid: bool member IsProfilePeaks: bool
union case PeakPicking.Centroid: CentroidizationMode -> PeakPicking
type CentroidizationMode = | Manufacturer | Wavelet of WaveletPeakPickingParams member Equals: CentroidizationMode * IEqualityComparer -> bool member IsManufacturer: bool member IsWavelet: bool
union case CentroidizationMode.Wavelet: WaveletPeakPickingParams -> CentroidizationMode
val outputPath: string
namespace System
namespace System.IO
type Path = static member ChangeExtension: path: string * extension: string -> string static member Combine: path1: string * path2: string -> string + 4 overloads static member EndsInDirectorySeparator: path: ReadOnlySpan<char> -> bool + 1 overload static member Exists: path: string -> bool static member GetDirectoryName: path: ReadOnlySpan<char> -> ReadOnlySpan<char> + 1 overload static member GetExtension: path: ReadOnlySpan<char> -> ReadOnlySpan<char> + 1 overload static member GetFileName: path: ReadOnlySpan<char> -> ReadOnlySpan<char> + 1 overload static member GetFileNameWithoutExtension: path: ReadOnlySpan<char> -> ReadOnlySpan<char> + 1 overload static member GetFullPath: path: string -> string + 1 overload static member GetInvalidFileNameChars: unit -> char array ...
<summary>Performs operations on <see cref="T:System.String" /> instances that contain file or directory path information. These operations are performed in a cross-platform manner.</summary>
System.IO.Path.Combine(paths: System.ReadOnlySpan<string>) : string
System.IO.Path.Combine([<System.ParamArray>] paths: string array) : string
System.IO.Path.Combine(path1: string, path2: string) : string
System.IO.Path.Combine(path1: string, path2: string, path3: string) : string
System.IO.Path.Combine(path1: string, path2: string, path3: string, path4: string) : string
System.IO.Path.GetTempPath() : string
module Json from ProteomIQon
val serializeAndWrite: path: string -> obj: 'a -> unit