Skip to content

Difference bewteen quantms results and DIANN GUI results #481

Closed

Description

@an-altosian

Description of the bug

Dear quantms developers,

First of all, thank you very much for providing such a useful pipeline!

Recently I am trying to update my workflow from DIANN GUI to quantms. To ensure that I can get consistent results, I processed an internal dataset using quantms and DIANN windows GUI with exactly the same reference database.

The result is surprising: in short, I got 7,756 rows in my gg_matrix from quantms, while 9,771 rows from DIANN GUI. I got 7,676 rows in my unique_genes_matrix from quantms, while 8305 rows from DIANN GUI. The NA values in the matrices are also very different.

sum(is.na(gg_cli) & is.na(gg_gui))
> [1] 13976 
sum(is.na(gg_cli) & !is.na(gg_gui))
> [1] 7564
sum(!is.na(gg_cli) & is.na(gg_gui))
> [1] 3182

As I believe your team had evaluated DIANN intensively, have you ever encountered or noticed this kind of differences?

Best,
Dongze

Command used and terminal output

Relevant files

No response

System information

No response

Activity

  1. added
    bug
    on Feb 15, 2025
  2. self-assigned this
    on Feb 15, 2025
  3. ypriverol commented on Feb 15, 2025

    @ypriverol
    Contributor

    Dear @an-altosian which versions of DIANN GUI are you using and what version of DIANN in quantms are you using.

  4. daichengxin commented on Feb 15, 2025

    @daichengxin
    Collaborator

    Hi @an-altosian, another possible reason is whether MBR is enabled or not. Did you enable MBR in GUI?

  5. jpfeuffer commented on Feb 15, 2025

    @jpfeuffer
    Collaborator

    Also, in case the preliminary analysis is performed on a subset of the files the results will be different.

  6. an-altosian commented on Feb 18, 2025

    @an-altosian
    ContributorAuthor

    Wow you guys are really responsive! Thanks a lot!

    which versions of DIANN GUI are you using and what version of DIANN in quantms are you using.

    So the log shows I used DIANN v1.8 in GUI, and for quantms, I used the 1.8.1 version.

    another possible reason is whether MBR is enabled or not. Did you enable MBR in GUI?

    I believe MBR is enabled automatically in quantms because it has two rounds of analysis. For GUI, here are the parameters. Based on my understanding, --reanalyse approximately means MBR

    --lib  --threads 64 --verbose 1 --out  --qvalue 0.01 --matrices 
    --out-lib speclib.tsv --gen-spec-lib --predictor --fasta Human_uniprot.fasta --fasta contaminants.fasta 
    --fasta-search --min-fr-mz 200 --max-fr-mz 1800 --met-excision --cut K*,R* 
    --missed-cleavages 1 --min-pep-len 7 --max-pep-len 30 --min-pr-mz 300 --max-pr-mz 1800 
    --min-pr-charge 1 --max-pr-charge 4 --unimod4 --var-mods 1 
    --var-mod UniMod:35,15.994915,M --double-search --reanalyse --smart-profiling
    

    I also pasted the logs from different steps below. If there are anything lese you would need, please let me know.

    • diann_config.cfg
      --cut K*,R*,!*P --fixed-mod Carbamidomethyl,57.021464,C --var-mod Oxidation,15.994915,M
      
    • silicolibrarygeneration.log
    In silico digest will involve cuts at K*,R*
    But excluding cuts at *P
    Modification Carbamidomethyl with mass delta 57.0215 at C will be considered as fixed
    Modification Oxidation with mass delta 15.9949 at M will be considered as variable
    Library-free search enabled
    Min precursor m/z set to 300
    Max precursor m/z set to 1800
    Min fragment m/z set to 200
    Max fragment m/z set to 1800
    Maximum number of missed cleavages set to 1
    Min peptide length set to 7
    Max peptide length set to 30
    Min precursor charge set to 1
    Max precursor charge set to 4
    Maximum number of variable modifications set to 1
    Thread number set to 12
    Deep learning will be used to generate a new in silico spectral library from peptides provided
    A spectral library will be generated
    N-terminal methionine excision enabled
    Exclusion of fragments shared between heavy and light peptides from quantification is not supported in FASTA digest mode - disabled; to enable, generate an in silico predicted spectral library and analyse with this library
    
    • assemble_empirical_library.log
    The spectral library (if generated) will retain the original spectra but will include empirically-aligned RTs
    Existing .quant files will be used
    A fast algorithm will be used to select the MS2 mass accuracy setting
    Mass accuracy will be determined separately for different runs
    Scan windows will be inferred separately for different runs
    A spectral library will be generated
    DIA-NN will optimise the mass accuracy separately for each run in the experiment. This is useful primarily for quick initial analyses, when it is not yet known which mass accuracy setting works best for a particular acquisition scheme.
    
    12 files will be processed
    [0:00] Loading spectral library lib.predicted.speclib
    [0:09] Library annotated with sequence database(s): Human_uniprot.fasta
    [0:09] Gene names missing for some isoforms
    [0:09] Library contains 20604 proteins, and 20386 genes
    [0:11] Spectral library loaded: 20604 protein isoforms, 28986 protein groups and 5369783 precursors in 1670466 elution groups.
    [0:11] Initialising library
    
    [0:16] Cross-run analysis
    [0:16] Reading quantification information: 12 files
    [0:24] Averaged recommended settings for this experiment: Mass accuracy = 11ppm, MS1 accuracy = 5ppm, Scan window = 5
    [0:24] Quantifying peptides
    [0:44] Assembling protein groups
    [0:46] Quantifying proteins
    [0:49] Calculating q-values for protein and gene groups
    [0:50] Calculating global q-values for protein and gene groups
    [0:50] Writing report
    [1:42] Report saved to report.tsv.
    [1:42] Stats report saved to report.stats.tsv
    [1:42] Generating spectral library:
    [1:42] Saving spectral library to empirical_library.tsv
    [1:55] 149810 precursors saved
    [1:55] Loading the generated library and saving it in the .speclib format
    [1:55] Loading spectral library empirical_library.tsv
    [1:58] Spectral library loaded: 10848 protein isoforms, 11911 protein groups and 149810 precursors in 126651 elution groups.
    [1:58] Protein names missing for some isoforms
    [1:58] Gene names missing for some isoforms
    [1:58] Library contains 0 proteins, and 0 genes
    [1:58] Saving the library to empirical_library.tsv.speclib
    [1:59] Log saved to report.log.txt
    Finished
    
    • diannsummary.log
    Scan windows will be inferred separately for different runs
    A fast algorithm will be used to select the MS2 mass accuracy setting
    Mass accuracy will be determined separately for different runs
    Highly heuristic protein grouping will be used, to reduce the number of protein groups obtained; this mode is recommended for benchmarking protein ID numbers; use with caution for anything else
    Implicit protein grouping: protein names; this determines which peptides are considered 'proteotypic' and thus affects protein FDR calculation
    Existing .quant files will be used
    Precursor/protein x samples expression level matrices will be saved along with the main report
    Output will be filtered at 0.01 FDR
    DIA-NN will optimise the mass accuracy separately for each run in the experiment. This is useful primarily for quick initial analyses, when it is not yet known which mass accuracy setting works best for a particular acquisition scheme.
    
    12 files will be processed
    [0:00] Loading spectral library empirical_library.tsv
    [0:03] Spectral library loaded: 10848 protein isoforms, 11911 protein groups and 149810 precursors in 126651 elution groups.
    [0:03] Loading protein annotations from FASTA Human_uniprot.fasta
    [0:03] Annotating library proteins with information from the FASTA database
    [0:04] Gene names missing for some isoforms
    [0:04] Library contains 10848 proteins, and 10815 genes
    [0:04] Initialising library
    [0:04] Saving the library to empirical_library.tsv.speclib
    
    [0:04] Cross-run analysis
    [0:04] Reading quantification information: 12 files
    [0:08] Averaged recommended settings for this experiment: Mass accuracy = 11ppm, MS1 accuracy = 5ppm, Scan window = 5
    [0:08] Quantifying peptides
    [0:28] Assembling protein groups
    [0:29] Quantifying proteins
    [0:29] Calculating q-values for protein and gene groups
    [0:30] Calculating global q-values for protein and gene groups
    [0:30] Writing report
    [1:33] Report saved to diann_report.tsv.
    

    Thank you all very much!

  7. an-altosian commented on Feb 21, 2025

    @an-altosian
    ContributorAuthor

    Updates:

    1. I ran DIANN windows GUI (same database) using .raw files and the corresponding .mzML files generated by quantms. There are ~100 genes' difference in the resulting unique genes matrices. Do you think there is any way to reduce this difference? Maybe by switching to msconvert, as it is recommended in DIANN README?
    2. When generating predicted speclib, I found the following lines in the DIANN log that were not in the quantms insilicolibrarygeneration log. Do you think it is necessary to add --rt-profiling in this command?
      [1:07] Encoding peptides for spectra and RTs prediction
      [1:34] Predicting spectra and IMs
      [6:40] Predicting RTs
      [6:59] Decoding predicted spectra and IMs
      [7:04] Decoding RTs
      
    3. In diann_preliminary_analysis, I found some extra parameters, namely --min-corr 2.0, --corr-diff 1.0, --quick-mass-acc, --individual-mass-acc and --time-corr-only. Upon testing, these parameters account for most of the missing genes. Have you ever evaluated the necessity of these parameters? Is the reason these parameters are used because of improved performance?
  8. jpfeuffer commented on Feb 21, 2025

    @jpfeuffer
    Collaborator
    1. I think quantms should be running on the raw files as well. Mzml is only for statistics.
    2. and 3. Quantms was mainly designed for large scale studies. We are favoring fast parameters. For large studies we don't even take the full set of files into account for preliminary analysis since it is infeasible. We are happy to include additional parameters but they might not become the default. I am not sure if we have the time for extensive parameter optimization ourselves but gladly include suggestions based on experiences from advanced users like you. How many files do you have? What size are those in bytes and #spectra? What difference do the settings you suggest have on the runtime and memory usage for you tested run?
  9. ypriverol commented on Feb 21, 2025

    @ypriverol
    Contributor

    @an-altosian First, thanks for the detailed benchmark! As @jpfeuffer mentioned, multiple factors are at play here, and we need to explore several of them. Let me clarify a few key points:

    Your benchmark uses RAW data, whereas we convert it to mzML (as @jpfeuffer pointed out). Has anyone observed differences due to this? @vdemichev, your input would be valuable here. Also, we can’t use msconvert since there's no Conda package, Docker image, etc. If anyone is interested in helping with that, let me know!

    Let’s discuss the key parameters contributing to differences:

    --min-corr 2.0: Requires DIA-NN to consider only peak group candidates with correlation scores ≥ X.
    --corr-diff 1.0: ❓ (Needs clarification)
    --quick-mass-acc: (Experimental) Uses a heuristic algorithm instead of optimizing ID numbers for automatic MS2 mass accuracy settings.
    --individual-mass-acc: Determines mass accuracies independently for different runs if set to automatic.
    --time-corr-only: Restricts machine learning during calibration.
    --rt-profiling: Sets empirical library generation mode to IDs, RT, and IM profiling.

    Are these parameters new in 2.0? @daichengxin, could you list the parameters currently used in diann_preliminary and discuss with @vdemichev whether additional parameters could improve results?

    @jpfeuffer I suspect that the preliminary analysis on a subset of RAW files is only being applied to datasets with more than 200 RAW files, so I doubt this is the main source of the discrepancies.

    @an-altosian quantms is an open-source software. Please feel free to contribute to the code, perform benchmarks and improve the current algorithms. We are really happy and rigth now this is a great moment to have this discussion because we are upgrading quantms for latest DIANN 2.0.2.

  10. jpfeuffer commented on Feb 21, 2025

    @jpfeuffer
    Collaborator

    Why are we converting?? I thought we pass it through like for bruker data? We should definitely not convert if it is not necessary. Probably it's faster for Diann to read the raw files also.

  11. ypriverol commented on Feb 21, 2025

    @ypriverol
    Contributor

    I agree we shouldn't convert; however, it would be good to know the source of the differences. BTW, we need to convert anyway for the statistics component but it make sense for the DIANN steps to work with the original RAW files.

  12. daichengxin commented on Feb 21, 2025

    @daichengxin
    Collaborator

    When running on Linux (native builds, not Wine), only .d, .mzML, and .dia data are supported for DIA-NN.

  13. jpfeuffer commented on Feb 21, 2025

    @jpfeuffer
    Collaborator

    Ah ok. That explains it.

  14. vdemichev commented on Feb 21, 2025

    @vdemichev

    Hi All,

    Some comments:

    • .raw and .mzML analysis results will be different no matter how converted, overall performance will be comparable if converted with recommended settings. Reason is unknown, i.e. the converter does not output exact same data as DIA-NN reads from the .raw.
    • --min-corr 2.0 may increase speed, also reduce RAM usage. I would re-evaluate if you want to keep it, it may reduce IDs noticeably.
    • --corr-diff 1.0 has little effect, you probably would want to replace with --corr-diff 2.0 or completely remove.
    • --quick-mass-acc automatic mass accuracy inference if you don't want to fix it. But if you know it's a timsTOF dataset, can as well just set all mass accs to 15 ppm.
    • --individual-mass-acc makes sense for the first pass in combination with the above.
    • --time-corr-only may reduce IDs but will decrease RAM usage on challenging runs.
    • --rt-profiling makes sense.

    Best,
    Vadim

  15. ypriverol commented on Feb 21, 2025

    @ypriverol
    Contributor

    Thanks, @vdemichev, for your quick response. For converting, we use ThermoRawFileParser, which I think we can try to explore and improve for DIANN and DIA analysis. From your experience what is the data that is missing from RAW to mzML conversion, intesity, masses precisions?

  16. 27 remaining items

  17. ypriverol commented on Mar 13, 2025

    @ypriverol
    Contributor

    First of all @an-altosian, thanks for doing all this great work and benchmark quantms. While we did a lot of bench testing and development of the workflow, the entire idea of an open-source workflow is that more people can benchmark it, test it, and adapt it accordingly. Thanks also to @styanova and @DanItzhak

    Here my ideas about each topic. And what would be good to follow-up.

    First of all, thanks everyone for your patience over the past few weeks and for answering all my questions. I’d like to summarize what I’ve gathered so far with the help from my colleagues, @styanova and @DanItzhak.

    While I understand that quantms is designed for processing large-scale datasets, it has also been incredibly useful for CLI users like me who want to follow best-practice DIANN workflows without deep knowledge of the underlying algorithms. Given this, it would be great to have an additional built-in mode in quantms that disables certain DIA-NN flags to better mimic how users typically interact with DIA-NN in standard GUI-based "mouse-clicking" scenarios.

    On point, the idea is to make DIANN easy to configure in cloud infrastructures and try to use the power of distributed compute.

    Here are some key thoughts from my exploration. Step 1 to 5 are taken from Vadim comment in #164. If y'all think these make sense, I can create a PR with those changes.

    Switching Between rt-profiling and smart-profiling

    Both are recommended by Vadim, but for different use cases. rt-profiling is suggested for quantms (from #164), while smart-profiling is strongly recommended for most workflows (from DIA-NN v1.8 README). It might be useful to introduce a Nextflow parameter to toggle between the two, or @vdemichev could provide guidance on which is best for quantms specifically.

    Furthermore, I saw from DIANN GUI log that --rt-profiling is also used in Step 1. So it might be useful to set it in both Step 1 and Step 3.

    For the dataset I used, I got 9126 rows in gg_matrix with all desired changes below with --rt-profiling, and 9138 rows with --smart-profiling.

    I think we can make --rt-profiling default, and the user can change it to --smart-profiling. While in your results, the changes are marginal, @vdemichev do you think this could be switched to --smart-profiling as default? We need to keep in mind that if --smart-profiling is used, the documentation suggests using it in combination with --full-profiling.

    Exporting DIA-NN’s Report Log

    Instead of capturing and saving stdout logs, it would be more useful to export the report.log.txt file generated by DIA-NN. This file includes the exact DIA-NN command used, making it easier for users to reproduce and debug their analyses.

    Agree, we should include this in the new version of quantms, great idea.

    Removing --individual-window and --individual-mass-acc from Step 2

    Conceptually, because each task of Step 2 processes a single instrument file, and by default, DIA-NN predicts mass-acc using the first encountered file, and mass-acc-ms1 and window for each file, there is no need to specify these two flags in this step. I have tested that DIANN returned the same results if removing these two. Two fewer flags to worry about ;).

    Similarly, there is no need to set --quick-mass-acc in Step 3, as the prediction doesn't happen in this step.

    @daichengxin @vdemichev Can we remove these flags? I will vote for doing them if they don't produce any effect.

    Unifying min-corr, corr-diff, and time-corr-only into a Single Parameter

    These three parameters together define the "Low RAM & High Speed Mode". Instead of managing them separately, it might be more convenient to control them with a single Nextflow parameter, so that if this parameter is set as true, then we set --min-corr 2 --corr-diff 1 --time-corr-only, otherwise we give DIANN an empty string.

    Furthermore, the default value (if they are not set) of min-corr and corr-diff are not zero and zero. I was wrong above. Maybe @vdemichev can tell us what the default values of them are.

    From the dataset I used for benchmarking, I gained 92 rows in the gg_matrix.tsv, from 9033 to 9125, by disabled the three parameters all together, and 109 rows if setting min-corr and corr-diff as zero.

    I do like the idea of combining parameters into want parameters, we need to document everywhere what the parameter means for users of DIANN in commandline, can translate from the parameter to the combination easily in their mind.

    Flexible Handling of Optional Parameters

    Parameters like quick-mass-acc, --relaxed-prot-inf, and --no-ifs-removal are optional but can significantly impact results. A more flexible approach might be to specify them via ext.args in the modules.config file, allowing users to disable them as needed.

    The predicted mass-acc increased from 15 ppm to 18 ppm after removed --quick-mass-acc. The dataset was generated using Orbitrap Ascend, IMO 18 ppm is more reasonable (correct me if I am wrong).

    Actually, this makes total sense, I like the idea of using modules for enabling and disabling the parameters.

    I gained more than 1,000 rows in gg_martrix.tsv if I remove --relaxed-prot-inf from step 4 and 5 and --no-ifs-removal from step 4. It sounds not correct because these two parameters indicate a more relaxed filtering strategy, as the name and definition suggest, so I was expecting that I would get less IDs by removing them. Maybe @vdemichev can comments on here.

    @vdemichev can you give us some input here.

    Without the direct access to DIA-NN's codebase, I guess these are the best I can do. Again, thank you all very much for bearing with me.

    Some finals ideas:

    • @an-altosian We can make all these changes as you suggested. However, it would be great if your team could do the PR yourself, and we could review it. It is nice to have multiple teams and groups contributing to the same codebase and make people more involved in the project 😉. If you don't have the time, we will work on it as soon as we find some time.

    • I think we can start with the changes that don't need extreme thinking or agreement. That your team has proved the impact. For those issues that we need @vdemichev input and some more discussion like the last issue related to filtering relaxation, we can wait a bit.

    • @an-altosian We will be probably releasing quantms 1.4.0 this week with support for 2.0.2 and other changes in DDA TMT analysis. However, these changes should be the priority for the next release. As soon as you get access to 2.0.2 one of the things we should explore is how the original parameters (designed for 1.8.1) could be changed for 2.0.2.

  18. vdemichev commented on Mar 13, 2025

    @vdemichev

    Hi Dongze,

    It might be useful to introduce a Nextflow parameter to toggle between the two, or @vdemichev could provide guidance on which is best for quantms specifically.

    Smart-profiling used to be recommended as a much better alternative to Full-profiling. Since then, we haven't seen any dataset on which it would be better than IDs, RTs and IMs profiling, i.e. the latter is recommended and is best for quantms.

    Furthermore, the default value (if they are not set) of min-corr and corr-diff are not zero and zero. I was wrong above. Maybe @vdemichev can tell us what the default values of them are.

    I think 0.5 for --min-corr and 3.0 for --corr-diff.

    From the dataset I used for benchmarking, I gained 92 rows in the gg_matrix.tsv, from 9033 to 9125, by disabled the three parameters all together, and 109 rows if setting min-corr and corr-diff as zero.

    This can be a 'statistical fluke', i.e. with that few proteins the exact number at 1% FDR may be very random.

    I gained more than 1,000 rows in gg_martrix.tsv if I remove --relaxed-prot-inf from step 4 and 5 and --no-ifs-removal from step 4.

    The first is essential for correct protein count, the second is critically important for correct DIA-NN analysis in general, especially in 1.8.1 which does not have other mechanisms which complement this, it should not be removed.

    Best,
    Vadim

  19. vdemichev commented on Mar 13, 2025

    @vdemichev

    Hi Yasset,

    @vdemichev do you think this could be switched to --smart-profiling as default?

    Huge time overhead in older DIA-NNs, while in all versions no known benefit, so would not recommend.

    @daichengxin @vdemichev Can we remove these flags? I will vote for doing them if they don't produce any effect.

    I would suggest not to. What if you want to process several runs per node? Also, --quick-mass-acc really saves a lot of time.

    Best,
    Vadim

  20. jpfeuffer commented on Mar 13, 2025

    @jpfeuffer
    Collaborator

    Thank you all so much for your input.
    Just some input regarding nextflow to make you aware that we do not necessarily need to list/expose all parameters (if that is a goal).
    With a small nextflow config like

    process{
      withName("DIANN_PRELIMINARY_ANALYSIS"){
         ext.args = "--param 1 --param 2"
      }
    }
    

    Everyone can overwrite and add parameters. Yes it is a little bit more advanced but in the end some of those parameters might only be necessary for advanced users.
    But I agree on most of the carefully selected default parameter suggestions and would be happy to change and simplify unnecessary ones.

  21. added a commit that references this issue on Mar 13, 2025
  22. added a commit that references this issue on Mar 26, 2025
  23. ypriverol commented on Mar 26, 2025

    @ypriverol
    Contributor

    @an-altosian now that we merged the PR #495 Should we close this issue and wait until you get the license for 2.0.X to do the extra benchmark.

  24. an-altosian commented on Mar 26, 2025

    @an-altosian
    ContributorAuthor

    Thank you @ypriverol ! Although I still have concerns regarding DIA phospho data, it is relatively independent to this thread, so I will create a separate issue for that. This thread is already too loooooooong.

    I appreciate the prompt actions and commits from other members, and the thoughtful discussions. Thank you, @ypriverol @jpfeuffer @daichengxin, and @vdemichev.

    Best,
    Dongze

  25. ypriverol commented on Apr 20, 2026

    @ypriverol
    Contributor

    @an-altosian The new quantmsdiann has been release https://github.com/bigbio/quantmsdiann/releases/tag/v2.0.0 take a look and let me know if you need anything from our side.

  26. an-altosian commented on Apr 20, 2026

    @an-altosian
    ContributorAuthor

    Thank you for letting me know. I will explore it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions