Issue 798: When missing chromatograms but we have a RT prediction, we should graph that

Assigned To:Nick Shulman
Opened:2021-05-06 by Brendan MacLean
Changed:2022-07-20 by Brendan MacLean
2021-05-06 Brendan MacLean
Title»When missing chromatograms but we have a RT prediction, we should graph that
Assigned To»Nick Shulman
I had a document where the iRT predictor got messed up and suddenly many peptides had no chromatograms, which I eventually decided was because the retention times were being predicted beyond the end of the chromatography. But, this was really not that easy to figure out from the UI just saying the peptide had no chromatograms. I first considered other options like the precursor m/z somehow not matching any DIA isolation window, etc.

It seems like we could still graph the predicted RT and zoom to it even when there are no chromatograms, and that might have helped me figure this out more quickly.

2021-05-21 Brendan MacLean
Here is an example file I just created from the DIA-TTOF tutorial using SkylineTester. And I discovered a bug in how we deal with a retention time predictor that uses the combination of a fixed linear equation and an iRT calculator. So, I will fix that too. Double-bonus!

2021-05-21 Brendan MacLean
Not sure why yet, but the audit log for this file seems to have been corrupted, even with my fix, and once you get the file loaded without my fix it just auto-calculates the iRT regression and you end up with a normal predictor that doesn't really reflect what I did with the fixed equation. So, I guess I have to keep working on this. It appears that we have broken the ability to use a fixed linear equation with an iRT calculator pretty badly.

2021-05-21 Brendan MacLean
Why don't you figure this one out as well. I need to get back to other things. Here is what I hoped would work:

1. Run the DIA-TTOF tutorial test in pause for screenshot mode.
2. When you get to the mProphet model, OK the form.
3. View > Retention Times > Regression > Score to Run
4. In Peptide Settings - Prediction choose Edit current... on the RT predictor.
5. Uncheck auto-calculate regression and enter 2x the slope and the y-intercept from the plot. OK the form for this fixed equation.
6. Edit > Manage Results, remove all but the first run and Re-import that one.

I was able to make a fix that got this to work and produce messed up predictions way beyond the end of the run, which was this:

            // If iRT standards have changed, reset auto-calculated conversion to make sure they are
            // updated on a background thread
            if (!ReferenceEquals(Settings.GetPeptideStandards(StandardType.IRT),
                docClone.Settings.GetPeptideStandards(StandardType.IRT)) &&
                docClone.Settings.PeptideSettings.Prediction.RetentionTime != null &&
+ docClone.Settings.PeptideSettings.Prediction.RetentionTime.AutoCalcRegression)
                docClone.Settings = docClone.Settings.ChangePeptidePrediction(p =>

But this apparently also broke the audit log, and it is not a change that persists in an unfixed version of the code.

Please get this scenario working and make the graphing fix suggested in this issue.

2021-05-24 Brendan MacLean
I think the if above actually needs to be:

            if (!ReferenceEquals(Settings.GetPeptideStandards(StandardType.IRT),
                docClone.Settings.GetPeptideStandards(StandardType.IRT)) &&
                docClone.Settings.PeptideSettings.Prediction.RetentionTime != null &&
+ docClone.Settings.PeptideSettings.Prediction.RetentionTime.IsAutoCalculated)

Probably IsAutoCalculated would be a better property for the [Track] as well, since it will remain constantly true or false with the state of the auto-calculate checkbox. Whereas, AutoCalculateRegression is a temporal property that tells whether auto-calculation is necessary sometime in the future. It happens to be the desired state at the time of the ModifyDocument() call, but as soon as the auto-calculation is completed then it becomes false, making it impossible to use to differentiate between a RetentionTime object with a fixed or auto-calculated linear equation.

2022-02-16 Nick Shulman

2022-07-20 Brendan MacLean