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

Added new SkylineCmd arguments for building ion mobility libraries: -… #2301

Merged
merged 16 commits into from Oct 4, 2022

Conversation

bspratt
Copy link
Member

@bspratt bspratt commented Sep 23, 2022

…-ionmobility-create-library and --ionmobility-create-library-name

…-ionmobility-create-library and --ionmobility-create-library-name
@bspratt
Copy link
Member Author

bspratt commented Sep 23, 2022

Here's an example script:

REM Tidy up any previous run first
del BSPTest.*
REM Load the template, import the .d, create CCS values library and report
C:\Dev\imsdbCommandLine\pwiz_tools\Skyline\bin\x64\Release\SkylineCmd --in="D:\data\Aries\Scripps_IMS_Template.sky" --out="D:\data\Aries\BSPTest.sky" --import-transition-list="D:\data\Aries\test_run_1_transition_list.csv" --import-file="D:\data\Aries\010521_Enamine_U6601911_A1_f100_pos_1_1_1086.d" --ionmobility-create-library="D:\data\Aries\BSPTest.imsdb" --ionmobility-create-library-name=BSPTest --report-name="Precursor CCS" --report-file="D:\data\Aries\BSPTest.csv"
REM Remove current chromatograms so we can reimport using our new CCS library, for ease of visual inspection later. Writing to a temporary .sky file so there's no risk of Skyline reusing previous extraction
C:\Dev\imsdbCommandLine\pwiz_tools\Skyline\bin\x64\Release\SkylineCmd --in="D:\data\Aries\BSPTest.sky" --remove-all --out="D:\data\Aries\BSPTest_tmp.sky"
REM Reimport the .d, this time using the CCS values, for ease of visual inspection later
C:\Dev\imsdbCommandLine\pwiz_tools\Skyline\bin\x64\Release\SkylineCmd --in="D:\data\Aries\BSPTest_tmp.sky" --out="D:\data\Aries\BSPTest.sky" --import-file="D:\data\Aries\010521_Enamine_U6601911_A1_f100_pos_1_1_1086.d" --ims-library-res=20000
del D:\data\Aries\BSPTest_tmp.sky

@bspratt
Copy link
Member Author

bspratt commented Sep 23, 2022

Here's the new documentation:

image

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.

Nice start. Great that it came together so quickly. Some thoughts on improving the code and some required changes.

@@ -337,6 +348,8 @@ private bool ValidateMinimizeResultsArgs()
return true;
}

public MsDataFileUri IMSDbFile { get; private set; }
Copy link
Contributor

Choose a reason for hiding this comment

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

Too many capitals in the naming. Use ImsDb or Imsdb instead, like MsDataFile. We prefer title-case even for acronyms.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, will fix

@@ -362,6 +375,11 @@ private bool ValidateMinimizeResultsArgs()
public double? LockmassTolerance { get; private set; }
public LockMassParameters LockMassParameters { get { return new LockMassParameters(LockmassPositive, LockmassNegative, LockmassTolerance); } }

private void CreateIMSDB(NameValuePair pair)
{
IMSDbFile = new MsDataFilePath(pair.ValueFullPath);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not an MsDataFile so strange to be using MsDataFilePath.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup, I'll fix that, thanks.

@@ -387,6 +393,9 @@
<data name="CommandArgs_GROUP_IMPORT_Importing_results_replicates" xml:space="preserve">
<value>Importing results replicates</value>
</data>
<data name="CommandArgs_GROUP_CREATE_IMSDB_Ion_Mobility_Library" xml:space="preserve">
<value>Creating an ion mobility library</value>
Copy link
Contributor

Choose a reason for hiding this comment

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

What about adding to an existing IMSDB? Seems like that should also be possible.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed, that just wasn't the immediate requirement. If you agree I'll just open an issue for that and return my attention to Feature Finding.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is at least worth thinking through now how you would support that within the command argument group you have created. Maybe making this title something more generic like:

Ion mobility library support

And arguments maybe:

--ionmobility-library-add=path/to/file.imsdb
--ionmobility-library-create=path/to/file.imsdb
--ionmobility-library-name=name

And eventually:

--ionmobility-library-addresults

create assumes addresults, obviously. Though, a user might use the combination:

--ionmobility-library-add=path/to/file.imsdb --ionmobility-library-name=name --ionmobility-library-addresults

which might ultimately be what Scripps wants to do to create a single .imsdb with all of their compounds in it for sharing with other Skyline users.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed, the hierarchy should be --ionmobility-library-XXX rather than --ionmobility-create-XXX for best extensibility.

Copy link
Member Author

Choose a reason for hiding this comment

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

image

pwiz_tools/Skyline/CommandLine.cs Outdated Show resolved Hide resolved
pwiz_tools/Skyline/CommandArgs.cs Outdated Show resolved Hide resolved
pwiz_tools/Skyline/CommandLine.cs Outdated Show resolved Hide resolved
pwiz_tools/Skyline/CommandLine.cs Outdated Show resolved Hide resolved
pwiz_tools/Skyline/TestPerf/PerfMeasuredInverseK0.cs Outdated Show resolved Hide resolved
pwiz_tools/Skyline/CommandArgs.cs Show resolved Hide resolved
 --ionmobility-create-library and --ionmobility-create-library-name
are changed to
 --ionmobility-library-create and --ionmobility-library-name

added a proper test

various code tweaks to conform to our conventions
…library name argument. Also convert from AbstractFunctionalTestEx to AbstractUnitTestEx
…t directory

Add more test conditions for commandline imsdb creation - now tests:
  normal operation
  support for not specifying "--ionmobility-library-name"
  error handling for illegal characters in imsdb filename
  error handling for non-existent subdirectories in imsdb file path
  error handling for specifying "--ionmobility-library-name" without "--ionmobility-library-create"
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.

Thanks for adding the new testing and the fix. I would like to see you try re-writing the test not to use a loop like the ones we were just discussing yesterday. These produce code that is unusual to most other developers and therefore harder to read and maintain. As a general concept, they allow more tightly coupled code to grow over time.

pwiz_tools/Skyline/TestUtil/AssertEx.cs Outdated Show resolved Hide resolved
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.

Some thoughts. And I gave the test some effort to serve as another example of the potential for abstraction when repeating highly similar steps to perform a set of different tests.

pwiz_tools/Skyline/Test/UtilTest.cs Outdated Show resolved Hide resolved
pwiz_tools/Skyline/Util/Extensions/Text.cs Outdated Show resolved Hide resolved
pwiz_tools/Skyline/Util/Extensions/Text.cs Outdated Show resolved Hide resolved
pwiz_tools/Skyline/Util/Extensions/Text.cs Outdated Show resolved Hide resolved
pwiz_tools/Skyline/TestUtil/AssertEx.cs Outdated Show resolved Hide resolved
bspratt and others added 3 commits October 3, 2022 12:21
In particular move the DSV separator detection to the test support namespace and make it clear in comments that it isn't robust enough for general use.
- add optional expectedSuccess parameter to RunCommand which reports a mismatch with the logged output
- added more testing to PerfCommandlineCreateImsDbTest mostly as another example of inspecting the output SrmDocument from a command-line run
@brendanx67 brendanx67 merged commit ce48b3c into master Oct 4, 2022
@brendanx67 brendanx67 deleted the Skyline/work/20220923_automate_imsb_creation branch October 4, 2022 20:50
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

2 participants