Skip to main content

Show Posts

This section allows you to view all Show Posts made by this member. Note that you can only see Show Posts made in areas you currently have access to.

Messages - Xinsong Du

1
MS-DIAL / Re: MS-DIAL on Supercomputer Failed to Annotate Metabolite
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;
            }
        }

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.



Thank you Hiroshi and drdoctor, the annotation appeared on my side after changing tabs to colons. I was wondering if the peak table is the only output when using command-line? Is there a output file like .mtd2 to allow us to import back to MS-DIAL to manually check peak shapes?
2
MS-DIAL / Re: How MS-DIAL calculates the "fill"
Hi Sukis,

as you can read it here (http://prime.psc.riken.jp/Metabolomics_Software/MS-DIAL/index3.html),
the fill % means the "gap-filled" sample % (but 1 means 100% in the output). If you analyzed 10 samples, and if a metabolite is detected in eight samples of them, the fill % value becomes 0.8.

However, the S/N value is re-calculated in the gap-filling process. If you wanna check "which samples really contain that component", I recommend like this:

(after opened an alignment result in MS-DIAL)
1. Go to "EIC of aligned spot" tab (top panel of MS-DIAL).
2. Right click, and click "Table viewer for curating each chromatogram"
3. Here, you can check which sample has the component in the "Annotation" column.

Does it make sense for you?
Please let me know if it's helpful for you or not.

Hiroshi

Hi Hiroshi:

I was wondering how the S/N was calculated. It seems not related to blank subtraction. Thank you!

Best,
Xinsong
3
MS-DIAL / Re: Unselected adduct appears in MS-DIAL peak table
Hi Xinsong,

maybe, there are several opinions to handle the multiple ions from one metabolite.
ESI will generate >10 ions (including isotopes) from one chemical actually. Therefore, some of software programs will "integrate" these ion's peak area/height. However, I do not like this because there is a possibility that not all of ions from the metabolite is grasped by the data processing step. Therefore, I am using the highest/robust/reliable adduct type to quantify a metabolite in the scan mode analysis. For instance, in your case, I will remove [M+2H]2+ for further analysis.
Thanks,

Hiroshi




Hi Dr. Tsugawa:

Many thanks! Your answer is very helpful!

Xinsong
4
MS-DIAL / Re: Unselected adduct appears in MS-DIAL peak table
Because the double charge is recognized in the isotope tracking function independently, it will be generated in the result tables even though you only select [M+H]+ in the adduct type setting.

Hiroshi

Thank you for your reply! It is very helpful! So if my adduct list doesn't contain [M+2H]2+, do I still need to remove all peaks with [M+2H]2+ from the list after getting the output from MS-DIAL? I am not very good at chemistry so I am not sure if only using [M+H]+ will also produce peaks with [M+2H]2+ automatically. Thanks!
5
MS-DIAL / 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

```
7
MS-DIAL / Unselected adduct appears in MS-DIAL peak table
Greetings:

I selected only [M+H]+ for MS-DIAL data processing, but the produced table also contains other adducts such as [M+2H]2+, etc. I will very much appreciate it if anyone can help explain it.

Thanks!