Repository navigation
Description
Description of the bug
@WangHong007 @zprobot @daichengxin:
I have been recently testing multiple USIs generated by quantms for DIA experiments. A little background about the problem, USIs are a way to reference directly to the scan and spectrum that was used to identify the spectrum, in someway is the fundamental evidence on DDA identification; here is an example.
All DDA search engines keep track of the scan that was used to identify the spectrum. However, in DIA experiments other features are also relevant and DIANN do not trace in the output files of the scan number that was used to identify the peptide. In quantms, we have implemented a logic to "find" for every peptide the scan number used to identify the peptide. @zprobot provided all the USIs for reanalysis PXD019909; however, when we were doing a visualization of multiple USIs they look like random USI meaning the spectrum looks like do not correspond to the given peptide, see example.
I propose the following follow up:
- @WangHong007 can you explain in a comment on this thread in details how the scan are retrieved. Probably @vdemichev can double-check that our logic is correct.
- @zprobot can you provide for other reanalyses the corresponding USIs and the Posterior error probabilities. The idea is that we can check for the best IDs (lower PEP) in their USIs. It is important to have the USIs and PEP for other projects (reanalyses) to see if the problems are related with the specific project.
- Double check that for this project PXD019909 the USIs are well annotated @WangHong007 @zprobot. If they are well annotated, and we check USIs for good IDs (lower PEP) we can try to discuss with @vdemichev what is the problem on this project.
Please let me know if you need more discussion.
Additional examples that looks wrong:
- https://www.ebi.ac.uk/pride/archive/usi?usi=mzspec:PXD019909:20180914_QE8_nLC0_BDA_SA_DIA_Keratinocytes_NN002:scan:7150:GKQEEEKPGEEK/2&resultType=FULL
- https://www.ebi.ac.uk/pride/archive/usi?usi=mzspec:PXD019909:20180914_QE8_nLC0_BDA_SA_DIA_Keratinocytes_NN002:scan:6918:HSQAGQGQSEGSR/2&resultType=FULL
Command used and terminal output
No response
Relevant files
No response
System information
No response
Activity
vdemichev commentedon Jan 25, 2024
In non-tims data the apex RT reported by DIA-NN should uniquely identify the scan.
Why do those examples look wrong? They have some fragments annotated.
ypriverol commentedon Jan 25, 2024
Thanks, @vdemichev, for responding. We were having a look to some of them and saw not to many fragments, for example https://www.ebi.ac.uk/pride/archive/usi?usi=mzspec%3APXD019909%3A20180914_QE8_nLC0_BDA_SA_DIA_Keratinocytes_NN002%3Ascan%3A7150%3AGKQEEEKPGEEK%2F2&resultType=FULL. If you use in the viewer mass type mono and 40 ppm you will see only 4 b-ions and 2 y-ions, the Proline for example is not even identified. I'm not used to see DIA spectra in viz tools, my question is:
USIs and viz of spectra in DDA is quite common, see this https://www.ebi.ac.uk/pride/archive/usi?usi=mzspec:PXD000561:Adult_Frontalcortex_bRP_Elite_85_f09:scan:17555:VLHPLEGAVVIIFK/2 we are exploring and checking if this may sense for DIA to write some guidelines about DIA USIs. Your feedback is more than welcome. BTW, we are the only one's generating USIs for DIA & DIANN experiments.
jpfeuffer commentedon Jan 25, 2024
Hi all,
I am currently looking into similar visualizations from quantms DIA-NN output.
I think DIA-NN uses much more than just a single MS2 spectrum for identification.
What you ideally want to display is a view as in Skyline or OpenSWATH, where you visualize the co-elution of fragment ions for a peptide along RT (potentially with competing groups from other peptides). This means for every found fragment you would want start and end RT. I am in the process of checking if this information is available and how to extract it.
DDA-like PSM visualization at the apex can be a supplementary view but might be very convoluted.
Looking forward to more input from @vdemichev, though!
WangHong007 commentedon Jan 25, 2024
Here the logic how we match diann report to ms_info.tsv:
quantms/bin/diann_convert.py
Lines 838 to 858 in fd20331
Basically, we choose
'RT.Start'(seconds as unit) as reteintion time in the report and changed seconds to minutes, at last we merge report and ms_info on column 'RT.start' to make sure matching nearest reteintion times.vdemichev commentedon Jan 25, 2024
I would suggest to use RT instead of RT.Start
ypriverol commentedon Jan 25, 2024
@jpfeuffer can you provide some ideas and visualization about examples it. I don't have access to Skyline?
jpfeuffer commentedon Jan 25, 2024
Me neither but this is from their tutorial:

The top right is I think similar to what you are currently trying to do (probably at the RT apex [= RT] not RT.start or RT.end).
You can also compare with the actual expected library intensities in a mirror plot or something.
The left charts are XICs from precursor isotopes and fragment ions. Those will require a range of MS2 spectra to extract from.
I guess for the use-case of a USI, your approach may be enough if you switch to RT instead of RT.start.
WangHong007 commentedon Jan 25, 2024
Hi @jpfeuffer @vdemichev, in the discussion above, you mentioned using
apex RTto match theRTcolumn in the diann report, and I have an additional question: When we use pyopenms to process mass spectrometry files (such as mzMLs), thegetRT()function takes the scan start time in the mzml file as the retention time and converts it to seconds. The retention time here is start RT not apex RT, right? How do we get apex RT of peaks?jpfeuffer commentedon Jan 25, 2024
I think there might be a confusion between "scan start time" of a spectrum and "elution start time" of a peptide or peptide fragment.
I think you have to compare "RT" (= apex of peptide elution) from DIA-NN with "getRT()" (="scan [start] time") from pyopenms.
Correct me if I am wrong.
6 remaining items
WangHong007 commentedon Feb 23, 2024
Hi @vdemichev, thanks for your comment and suggestion above all!
When matching
the RT of MS2 in the mass spectrumwiththe RT of ions in the DIA-NN report, what error threshold do you suggest should be set to match? In the past, we looked for the closest one, but there was no error threshold.vdemichev commentedon Feb 23, 2024
What is expected is an ideal match (RT in minutes). What should also be the case is that the corresponding isolation window contians the precursor mass.
WangHong007 commentedon Feb 26, 2024
Hi @jpfeuffer @vdemichev, here we use the following method to obtain the PSM:
https://github.com/WangHong007/quantms/blob/74c3cd0de07f89e108ac84c6e02159ecd222b501/bin/diann_convert.py#L867-L888
In general, for each ion in report, we find the ions of MS2 that have precursor isolation window which contains the ion's precursor mz, and perform RT matching. Such traversal is extremely time consuming and would be appreciated if you have a more suitable method.
@ypriverol We have added
--generate_psmas an option, do we need to keep RT matching the old way, or do we just leave PSM out of mztab?vdemichev commentedon Feb 26, 2024
@WangHong007 what if you just create an RT index for each run (RT bin -> file position mapping), and then query the spectrum corresponding to the closest RT?
ypriverol commentedon Feb 26, 2024
@WangHong007 can you generate one example DIA output if USIs. for all of us to test and visualize how they look.
WangHong007 commentedon Feb 26, 2024
@ypriverol mztab and USIs are here: https://github.com/WangHong007/Data-Folder/tree/main/quantms/DIA-NN_USIs/PXD026600
ypriverol commentedon Feb 28, 2024
@WangHong007 I have searched in PRIDE Archive USI two of the USIs from the file:
Both of these spectra and peptide combination do not have a single ion annotated. Can you lookup how those USI were created, basically look for the scan in the mzML, the RT and the DIANN output. Check How the USI was created.
WangHong007 commentedon Feb 29, 2024
Hi all! Here are the several important indicators of these two USIs:
daichengxin commentedon Mar 18, 2024
Hi all, there are still very few ion matches in some PSMs when taking RT from DIA-NN report, and match it to closest the scan RT in mzML. 20ppm and 40 ppm fragment tolerence are used respectively. regardless of anything in MS1 data. The PXD026600 ions annotation are follow and sorted by Q.Value and PEP. Neutral Loss are considered.
PXD026600_USI_ions_matched_20PPM.zip
PXD026600_USI_ions_matched_40PPM.zip
More ions are matched in PSMs when increasing to 40 ppm. But there are still very few ion matches. A few examples:
So Is this kind of number of fragment annotations normally? if the spectra MS2 we matched is the one that it suppose to be? @ypriverol @vdemichev @jpfeuffer
jpfeuffer commentedon Mar 18, 2024
Can you share an example project as small as possible, with the mzmls, diann_report, and whatever goes into your scripts (e.g. your mzml_statistics/summary files)?
vdemichev commentedon Mar 18, 2024
One possibility: ions can be missing from specific scans. DIA-NN looks at the entire XICs around the apex, not just at the apex spectrum, and hence the latter does not necessarily include all ions, although this is most often the case. Also of course any issues with mass calibration can play a role here. You can always verify what exactly DIA-NN is matching to identify the peptide using the --vis command.
ypriverol commentedon Mar 18, 2024
@vdemichev:
What you are saying is that you can probably have more than one MS2 for a given Peptide, where some ions are in one MS2 and others in another one?
ypriverol commentedon Sep 11, 2024
Done in #419