Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ion match tolerance unit transition setting (Issue 830) #2156

Merged
merged 54 commits into from Feb 15, 2023

Conversation

rita-gwen
Copy link
Contributor

No description provided.

@rita-gwen
Copy link
Contributor Author

Thank you, Nick! Should I also add Skyline_22_14.xsd at this point? Or it is done at the release time?

@nickshulman
Copy link
Contributor

Brendan will create the file "Skyline_22_14.xsd" when he releases the next Skyline-Daily.
The reason that we delay doing that is so that we don't increment the version number twice if two developers add features during the same Daily release cycle. The only .xsd file that you ever edit is "Skyline_Current.xsd". All of the numbered .xsd files should be considered immutable.
When Skyline-Daily is being released, the "IsOfficialBuild" part of "TestDocumentFormatSchemaFiles" reminds the person if the numbered .xsd file needs to be created.

/// <summary>returns true iff a is in (b-tolerance, b+tolerance)</summary>
public static bool IsWithinTolerance(double a, double b, MzTolerance tolerance)
public bool IsWithinTolerance(double a, double b)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a question. Why the inequality is non-inclusive here while it is inclusive for the method match tolerance?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question.
@chambm, is there a reason that this method is using an exclusive range?
I see that this C# method is not used anywhere but there is a C++ method in "MZTolerance.cpp" which has the same implementation.
Skyline always (as far as I know) interprets tolerances using an inclusive range so that if someone sets the tolerance to zero there will be one number which would still fall in the tolerance range.

rita-gwen and others added 19 commits December 5, 2022 11:24
- fix audit log format for MzTolerance to depend on RESX values Units_mz and Units_ppm
- add handler for combo change event on TransitionSettingsUI.comboToleranceUnits change Method match tolerance by a factor of 1000
…b.com:ProteoWizard/pwiz into Skyline/work/20210927_issue830HighResCheckbox
…TransitionLibraries from needing to test its values individually
…b.com:ProteoWizard/pwiz into Skyline/work/20210927_issue830HighResCheckbox
…controls consistent with the TransitionSettingsUI.Library tab
Copy link
Contributor

@brendanx67 brendanx67 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mostly applied myself the necessary changes I saw. However, it does not look as well tested as I would like to see, and there is one case were a label count is different on-screen vs. off-screen which should be fixed or explained.

SetZoom(false);
ClickChromatogram(33.11, 15.055, PaneKey.PRODUCTS);
WaitForGraphs();
Assert.AreEqual(Skyline.Program.SkylineOffscreen? 70 : 20, SkylineWindow.GraphFullScan.IonLabels.Count());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these numbers different on-screen vs. off-screen? This at least needs a comment explaining the issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The labels are not drawn in off-screen mode because it happens during Paint event. In the off-screen mode this tests total number of peaks matching the ion type filter. I'll add a comment in the code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another approach can be to implement a method that gets the ion labels that would be added if the graph were painted. But, looking for a good example, I just ran into another case where we simply look at the CurveList for TextObj items. And I can see some benefit to testing the text that actually ends up on the graph. So, I can live with this.

Settings.Default.ShowSpecialIons = false;
}

private void TestIonMatchToleranceUnitSetting()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To test this more thoroughly will require using the TransitionSettingsUI form and also a case of using PPM in the Import Peptide Search wizard to exercise the TransitionSettingsControl.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replaced the changing the settings with invocation of the Settings dialogue and added tolerance unit verification to the ImportPeptideSearchTest.

@@ -334,7 +338,7 @@ private void TestIonMatchToleranceUnitSetting()
});
WaitForGraphs();
var graphLabels = SkylineWindow.GraphFullScan.IonLabels;
Assert.AreEqual(Skyline.Program.SkylineOffscreen ? 49 : 1, graphLabels.Count());
Assert.AreEqual(Skyline.Program.SkylineOffscreen ? 48 : 1, graphLabels.Count());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This number has changed because calling the settings dialogue resets the special ion list and there was one reporter ion in this spectrum.

Copy link
Contributor

@brendanx67 brendanx67 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super close. Apply minor changes and then you can merge.

SetZoom(false);
ClickChromatogram(33.11, 15.055, PaneKey.PRODUCTS);
WaitForGraphs();
Assert.AreEqual(Skyline.Program.SkylineOffscreen? 70 : 20, SkylineWindow.GraphFullScan.IonLabels.Count());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another approach can be to implement a method that gets the ion labels that would be added if the graph were painted. But, looking for a good example, I just ran into another case where we simply look at the CurveList for TextObj items. And I can see some benefit to testing the text that actually ends up on the graph. So, I can live with this.

@@ -621,6 +622,8 @@ private void TestIrts()
Assert.IsTrue(importPeptideSearchDlg.CurrentPage == ImportPeptideSearchDlg.Pages.match_modifications_page);
Assert.IsTrue(importPeptideSearchDlg.ClickNextButton());
Assert.IsTrue(importPeptideSearchDlg.CurrentPage == ImportPeptideSearchDlg.Pages.transition_settings_page);
importPeptideSearchDlg.TransitionSettingsControl.IonMatchToleranceUnits = MzTolerance.Units.ppm;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test the prior value gets multiplied by 1000.

SkylineWindow.ModifyDocument("Set test settings",
doc => doc.ChangeSettings(newSettings));
transitionSettingsUI.IonMatchToleranceUnits = MzTolerance.Units.ppm;
transitionSettingsUI.IonMatchTolerance = 10.0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test the prior value gets multiplied by 1000 before changing it.

@rita-gwen rita-gwen merged commit 101cc96 into master Feb 15, 2023
@rita-gwen rita-gwen deleted the Skyline/work/20210927_issue830HighResCheckbox branch February 27, 2023 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants