Skip to main content
Topic: MS-DIAL on Supercomputer Failed to Annotate Metabolite (Read 317 times) previous topic - next topic

MS-DIAL on Supercomputer Failed to Annotate Metabolite

Greetings:

I was trying to use supercomputer to run MS-DIAL, it successfully produced a peak table, but no peak was annotated even though locations of libraries were provided in the parameter file (i.e., all rows of column "Metabolite name" are "Unknown"). Has any one used command-line version to annotate metabolites successfully? I will very much appreciate it if anyone can help me out.

Following is the content of the parameter file I used:

```
MS-DIAL ver. 4.48

#Project
MS1 Data type   Centroid
MS2 Data type   Centroid
Ion mode   Positive
Target   Metablomics
Mode   ddMSMS

#Data collection parameters
Retention time begin   0
Retention time end   100
Mass range begin   0
Mass range end   2000
MS2 mass range begin   0
MS2 mass range end   2000

#Centroid parameters
MS1 tolerance   0.01
MS2 tolerance   0.025

#Isotope recognition
Maximum charged number   2

#Data processing
Number of threads   10

#Peak detection parameters
Smoothing method   LinearWeightedMovingAverage
Smoothing level   3
Minimum peak width   5
Minimum peak height   1000

#Peak spotting parameters
Mass slice width   0.1
Exclusion mass list (mass & tolerance)

#Deconvolution parameters
Sigma window value   0.5
MS2Dec amplitude cut off   0
Exclude after precursor   True
Keep isotope until   0.5
Keep original precursor isotopes   False

#MSP file and MS/MS identification setting
MSP file   /blue/djlemas/xinsongdu/jupyter_notebook/projects/milkmetabolomics-humanbovine/data/design_files/MSMS-Pos-MassBank.msp
Retention time tolerance   100
Accurate mass tolerance (MS1)   0.01
Accurate mass tolerance (MS2)   0.05
Identification score cut off   70
Using retention time for scoring   False
Using retention time for filtering   False

#Text file and post identification (retention time and accurate mass based) setting
Text file   /blue/djlemas/xinsongdu/jupyter_notebook/projects/milkmetabolomics-humanbovine/pos_msdial.txt
Retention time tolerance   0.1
Accurate mass tolerance   0.01
Identification score cut off   85

#Advanced setting for identification
Relative abundance cut off   0
Top candidate report   False

#Adduct ion setting
[M+H]+

#Alignment parameters setting
Reference file   /blue/djlemas/xinsongdu/jupyter_notebook/data/metabolomics/Human_Bovine/mzML/demo/QE2_jdg_242_Lemas_1[NeatQC]p.mzML
Retention time tolerance   0.05
MS1 tolerance   0.015
Retention time factor   0.5
MS1 factor   0.5
Peak count filter   20
N% detected in at least one group   0
Remove feature based on peak height fold-change   True
Sample max / blank average   5
Sample average / blank average   5
Keep identified and annotated metabolites   True
Keep removable features and assign the tag for checking   True
Gap filling by compulsion   True

#Tracking of isotope labels
Tracking of isotopic labels   FALSE

#Ion mobility
Ion mobility data   FALSE

```

Re: MS-DIAL on Supercomputer Failed to Annotate Metabolite

Reply #1
I just started using MSDIALConsoleApp also and you should replace tabs with colons.  There are some older demo files here (http://prime.psc.riken.jp/compms/msdial/download/demo/MsdialConsoleApp%20demo%20files.zip) but the row names seem to have changed in recent updates.

So what you what you have now is:
#Project
MS1 Data type   Centroid
MS2 Data type   Centroid
Ion mode   Positive
Target   Metablomics
Mode   ddMSMS

#Adduct ion setting
[M+H]+

This should become:
#Project
MS1 Data type: Centroid
MS2 Data type: Centroid
Ion mode: Positive
Target: Metablomics
Mode: ddMSMS

#Adduct ion setting
Adduct list: [M+H]+,[M+NH4]+,[M+Na]+

As a note I am not able to reproduce the results I have in the GUI with the mac consoleApp (GUI produced 2x more annotations and 2x more adduct types are found in the 4.38 GUI vs 4.48 mac console with parameters exported from the GUI), so there may be more differences with row names than using colons that I am unaware of.

Anyone who could clarify this would be greatly appreciated.

Re: MS-DIAL on Supercomputer Failed to Annotate Metabolite

Reply #2
Hi,

I was also confusing... Maybe, the following source code for parsing parameter settings in the command line application is helpful for you?

Code: [Select]
private static void lcmsParamUpdate(AnalysisParametersBean param, string method, string value)
        {
            var f = 0.0F;
            var i = 0;
            switch (method)
            {
                //Data correction
                case "Retention time begin": if (float.TryParse(value, out f)) param.RetentionTimeBegin = f; return;
                case "Retention time end": if (float.TryParse(value, out f)) param.RetentionTimeEnd = f; return;
                case "Mass range begin": if (float.TryParse(value, out f)) param.MassRangeBegin = f; return;
                case "Mass range end": if (float.TryParse(value, out f)) param.MassRangeEnd = f; return;
                case "MS2 mass range begin": if (float.TryParse(value, out f)) param.Ms2MassRangeBegin = f; return;
                case "MS2 mass range end": if (float.TryParse(value, out f)) param.Ms2MassRangeEnd = f; return;

                //Centroid parameters
                case "MS1 tolerance for centroid": if (float.TryParse(value, out f)) param.CentroidMs1Tolerance = f; return;
                case "MS2 tolerance for centroid": if (float.TryParse(value, out f)) param.CentroidMs2Tolerance = f; return;

                //Retentiontime correction
                case "Excute RT correction": if (value == "TRUE" || value == "FALSE") param.RetentionTimeCorrectionCommon.RetentionTimeCorrectionParam.ExcuteRtCorrection = bool.Parse(value); return;
                case "RT correction with smoothing for RT diff": if (value == "TRUE" || value == "FALSE") param.RetentionTimeCorrectionCommon.RetentionTimeCorrectionParam.doSmoothing = bool.Parse(value); return;
                case "User setting intercept": if (float.TryParse(value, out f)) param.RetentionTimeCorrectionCommon.RetentionTimeCorrectionParam.UserSettingIntercept = f; return;
                case "RT diff calc method": if (value == "SampleMinusSampleAverage" || value == "SampleMinusReference")
                        param.RetentionTimeCorrectionCommon.RetentionTimeCorrectionParam.RtDiffCalcMethod = (Rfx.Riken.OsakaUniv.RetentionTimeCorrection.RtDiffCalcMethod)Enum.Parse(typeof(Rfx.Riken.OsakaUniv.RetentionTimeCorrection.RtDiffCalcMethod), value, true);
                    return;
                case "Interpolation Method":
                    if (value == "Linear")
                        param.RetentionTimeCorrectionCommon.RetentionTimeCorrectionParam.InterpolationMethod = Rfx.Riken.OsakaUniv.RetentionTimeCorrection.InterpolationMethod.Linear;
                    return;
                case "Extrapolation method (begin)":
                    if (value == "UserSetting" || value == "FirstPoint" || value == "LinearExtrapolation")
                        param.RetentionTimeCorrectionCommon.RetentionTimeCorrectionParam.ExtrapolationMethodBegin = (Rfx.Riken.OsakaUniv.RetentionTimeCorrection.ExtrapolationMethodBegin)Enum.Parse(typeof(Rfx.Riken.OsakaUniv.RetentionTimeCorrection.ExtrapolationMethodBegin), value, true);
                    return;
                case "Extrapolation method (end)":
                    if (value == "LastPoint" || value == "LinearExtrapolation")
                        param.RetentionTimeCorrectionCommon.RetentionTimeCorrectionParam.ExtrapolationMethodEnd = (Rfx.Riken.OsakaUniv.RetentionTimeCorrection.ExtrapolationMethodEnd)Enum.Parse(typeof(Rfx.Riken.OsakaUniv.RetentionTimeCorrection.ExtrapolationMethodEnd), value, true);
                    return;
                case "iSTD file":
                    if (System.IO.File.Exists(value)) {
                        var error = string.Empty;
                        param.RetentionTimeCorrectionCommon.StandardLibrary = TextLibraryParcer.StandardTextLibraryReader(value, out error);
                        if (error != string.Empty) {
                            Console.WriteLine(error);
                        }
                    }
                    return;

                //Peak detection param
                case "Smoothing method":
                    if (value == "SimpleMovingAverage" || value == "LinearWeightedMovingAverage" || value == "SavitzkyGolayFilter" || value == "BinomialFilter")
                        param.SmoothingMethod = (SmoothingMethod)Enum.Parse(typeof(SmoothingMethod), value, true);
                    return;
                case "Smoothing level": if (int.TryParse(value, out i)) param.SmoothingLevel = i; return;
                case "Minimum peak width": if (int.TryParse(value, out i)) param.MinimumDatapoints = i; return;
                case "Minimum peak height": if (int.TryParse(value, out i)) param.MinimumAmplitude = i; return;
                case "Mass slice width": if (float.TryParse(value, out f)) param.MassSliceWidth = f; return;

                //Deconvolution
                case "Sigma window value": if (float.TryParse(value, out f)) param.SigmaWindowValue = f; return;
                case "Amplitude cut off": if (float.TryParse(value, out f)) param.AmplitudeCutoff = f; return;
                case "Exclude after precursor": if (value.ToUpper() == "FALSE") param.RemoveAfterPrecursor = false; return;

                //Identification
                case "Retention time tolerance for identification": if (float.TryParse(value, out f)) param.RetentionTimeLibrarySearchTolerance = f; return;
                case "Accurate ms1 tolerance for identification": if (float.TryParse(value, out f)) param.Ms1LibrarySearchTolerance = f; return;
                case "Accurate ms2 tolerance for identification": if (float.TryParse(value, out f)) param.Ms2LibrarySearchTolerance = f; return;
                case "Identification score cut off": if (float.TryParse(value, out f)) param.IdentificationScoreCutOff = f; return;
                case "Use retention information for identification scoring": if (value == "TRUE" || value == "FALSE") param.IsUseRetentionInfoForIdentificationScoring = bool.Parse(value); return;
                case "Use retention information for identification filtering": if (value == "TRUE" || value == "FALSE") param.IsUseRetentionInfoForIdentificationFiltering = bool.Parse(value); return;

                //Post identification
                case "Retention time tolerance for post identification": if (float.TryParse(value, out f)) param.RetentionTimeToleranceOfPostIdentification = f; return;
                case "Accurate ms1 tolerance for post identification": if (float.TryParse(value, out f)) param.AccurateMassToleranceOfPostIdentification = f; return;
                case "Post identification score cut off": if (float.TryParse(value, out f)) param.PostIdentificationScoreCutOff = f; return;

                //Alignment parameters setting
                case "Retention time tolerance for alignment": if (float.TryParse(value, out f)) param.RetentionTimeAlignmentTolerance = f; return;
                case "MS1 tolerance for alignment": if (float.TryParse(value, out f)) param.Ms1AlignmentTolerance = f; return;
                case "Retention time factor for alignment": if (float.TryParse(value, out f)) param.RetentionTimeAlignmentFactor = f; return;
                case "MS1 factor for alignment": if (float.TryParse(value, out f)) param.Ms1AlignmentFactor = f; return;
                case "Peak count filter": if (float.TryParse(value, out f)) param.PeakCountFilter = f; return;
                case "QC at least filter": if (value == "TRUE" || value == "FALSE") param.QcAtLeastFilter = bool.Parse(value); return;
                case "Alignment reference file ID": if (int.TryParse(value, out i)) param.AlignmentReferenceFileID = i; return;
                case "Remove feature based on peak height fold-change": if (value == "TRUE" || value == "FALSE") param.IsRemoveFeatureBasedOnPeakHeightFoldChange = bool.Parse(value); return;
                case "Sample max / blank average": if (float.TryParse(value, out f)) param.SampleMaxOverBlankAverage = f; return;
                case "Sample average / blank average": if (float.TryParse(value, out f)) param.SampleAverageOverBlankAverage = f; return;
                case "Keep identified and annotated metabolites": if (value == "TRUE" || value == "FALSE") param.IsKeepIdentifiedMetaboliteFeatures = bool.Parse(value); return;
                case "Replace true zero values with 1/2 of minimum peak height over all samples": if (value == "TRUE" || value == "FALSE") param.IsReplaceTrueZeroValuesWithHalfOfMinimumPeakHeightOverAllSamples = bool.Parse(value); return;

                //Isotope tracking setting
                case "Tracking isotope label": if (value == "TRUE" || value == "FALSE") param.TrackingIsotopeLabels = bool.Parse(value); return;
                case "Set fully labeled reference file": if (value == "TRUE" || value == "FALSE") param.SetFullyLabeledReferenceFile = bool.Parse(value); return;
                case "Non labeled reference ID": if (int.TryParse(value, out i)) param.NonLabeledReferenceID = i; return;
                case "Fully labeled reference ID": if (int.TryParse(value, out i)) param.FullyLabeledReferenceID = i; return;
                case "Isotope tracking dictionary ID": if (int.TryParse(value, out i)) param.IsotopeTrackingDictionary.SelectedID = i; return;

                //CorrDec settings
                case "CorrDec excute":
                    if (value.ToUpper() == "FALSE") {
                        if (param.AnalysisParamOfMsdialCorrDec == null) param.AnalysisParamOfMsdialCorrDec = new AnalysisParamOfMsdialCorrDec();
                        param.AnalysisParamOfMsdialCorrDec.CanExcute = false;
                    }
                    return;                   
                case "CorrDec MS2 tolerance": if (param.AnalysisParamOfMsdialCorrDec == null) param.AnalysisParamOfMsdialCorrDec = new AnalysisParamOfMsdialCorrDec();
                    if (float.TryParse(value, out f)) param.AnalysisParamOfMsdialCorrDec.MS2Tolerance = f; return;
                case "CorrDec minimum MS2 peak height":
                    if (param.AnalysisParamOfMsdialCorrDec == null) param.AnalysisParamOfMsdialCorrDec = new AnalysisParamOfMsdialCorrDec();
                    if (int.TryParse(value, out i)) param.AnalysisParamOfMsdialCorrDec.MinMS2Intensity = i; return;
                case "CorrDec minimum number of detected samples":
                    if (param.AnalysisParamOfMsdialCorrDec == null) param.AnalysisParamOfMsdialCorrDec = new AnalysisParamOfMsdialCorrDec();
                    if (int.TryParse(value, out i)) param.AnalysisParamOfMsdialCorrDec.MinNumberOfSample = i; return;
                case "CorrDec exclude highly correlated spots":
                    if (param.AnalysisParamOfMsdialCorrDec == null) param.AnalysisParamOfMsdialCorrDec = new AnalysisParamOfMsdialCorrDec();
                    if (float.TryParse(value, out f)) param.AnalysisParamOfMsdialCorrDec.MinCorr_MS1 = f; return;
                case "CorrDec minimum correlation coefficient (MS2)":
                    if (param.AnalysisParamOfMsdialCorrDec == null) param.AnalysisParamOfMsdialCorrDec = new AnalysisParamOfMsdialCorrDec();
                    if (float.TryParse(value, out f)) param.AnalysisParamOfMsdialCorrDec.MinCorr_MS2 = f; return;
                case "CorrDec margin 1 (target precursor)":
                    if (param.AnalysisParamOfMsdialCorrDec == null) param.AnalysisParamOfMsdialCorrDec = new AnalysisParamOfMsdialCorrDec();
                    if (float.TryParse(value, out f)) param.AnalysisParamOfMsdialCorrDec.CorrDiff_MS1 = f; return;
                case "CorrDec margin 2 (coeluted precursor)":
                    if (param.AnalysisParamOfMsdialCorrDec == null) param.AnalysisParamOfMsdialCorrDec = new AnalysisParamOfMsdialCorrDec();
                    if (float.TryParse(value, out f)) param.AnalysisParamOfMsdialCorrDec.CorrDiff_MS2 = f; return;
                case "CorrDec minimum detected rate":
                    if (param.AnalysisParamOfMsdialCorrDec == null) param.AnalysisParamOfMsdialCorrDec = new AnalysisParamOfMsdialCorrDec();
                    if (float.TryParse(value, out f)) param.AnalysisParamOfMsdialCorrDec.MinDetectedPercentToVisualize = f; return;
                case "CorrDec minimum MS2 relative intensity":
                    if (param.AnalysisParamOfMsdialCorrDec == null) param.AnalysisParamOfMsdialCorrDec = new AnalysisParamOfMsdialCorrDec();
                    if (float.TryParse(value, out f)) param.AnalysisParamOfMsdialCorrDec.MinMS2RelativeIntensity = f; return;
                case "CorrDec remove peaks larger than precursor":
                    if (param.AnalysisParamOfMsdialCorrDec == null) param.AnalysisParamOfMsdialCorrDec = new AnalysisParamOfMsdialCorrDec();
                    if (value == "TRUE" || value == "FALSE") param.AnalysisParamOfMsdialCorrDec.RemoveAfterPrecursor = bool.Parse(value); return;

            }
        }

Code: [Select]
private static void projectPropertyUpdate(ProjectPropertyBean projectProp, string method, string value)
        {
            switch (method) {
                //Data type
                case "MS1 data type":
                    if (value == "Centroid" || value == "Profile")
                        projectProp.DataType = (DataType)Enum.Parse(typeof(DataType), value, true);
                    return;

                case "MS2 data type":
                    if (value == "Centroid" || value == "Profile")
                        projectProp.DataTypeMS2 = (DataType)Enum.Parse(typeof(DataType), value, true);
                    return;

                case "Ion mode":
                    if (value == "Positive" || value == "Negative")
                        projectProp.IonMode = (IonMode)Enum.Parse(typeof(IonMode), value, true);
                    return;

                //File paths
                case "DIA file": projectProp.ExperimentFilePath = value; return;
                case "MSP file": projectProp.LibraryFilePath = value; return;
                case "Text file": projectProp.PostIdentificationLibraryFilePath = value; return;
                case "Target compound file": projectProp.CompoundListInTargetModePath = value; return;

                // Private version
                case "Is private version of Tada":
                    if (value.ToUpper() == "TRUE")
                        projectProp.IsLabPrivateVersionTada = true;                   
                    return;
            }
        }

Re: MS-DIAL on Supercomputer Failed to Annotate Metabolite

Reply #3
Hi,

Thank you, this code was very useful! I was able to redo my comparison, but I am not able to get the same number of MS/MS matched between the console and GUI

There are the same number of peaks detected(2,028), but there are different MS/MS matched peaks.
GUI MS/MS matched: 125
console MS/MS matched: 78
overlap between GUI and console: 56

Are there parameters only tunable from the GUI for lcmsdda related to isotopes/adducts/neutral loss that are not available in the console maybe? I attached an excel file comparing my gui parameters vs console config.