Add mztab-M Exporter and GUI Integration#613
Conversation
Introduced a new property `DataBaseSourceFilePath` to store the original path of the database file for output purposes, such as mzTab-M. Added XML documentation to clarify its purpose and noted that no additional information beyond the original file location is retained. The property is initialized to an empty string and marked with a `[Key(3)]` attribute.
Removed redundant TextBlocks and updated bindings for axis titles. Retained the layout and style for the existing GraphLabel binding.
Updated the constructors of the `MoleculeDataBase` class to include a new `dataBaseSourceFilePath` parameter for better tracking of database sources. This change affects multiple files and contexts, including the `MsScanCompoundSearchUsecase`, `MsfinderSearcherFactory`, and `DataBaseSettingModel` classes, ensuring consistent usage of the new parameter. The `CommonProcess` class has also been modified to reflect these changes in output types. Additionally, various test classes have been updated to maintain consistency with the new constructor requirements.
Updated the MoleculeDataBase constructor to include a new parameter, `dataBaseSourceFilePath`, for specifying the database source file path. Adjusted all relevant test files to instantiate MoleculeDataBase with the new parameter, ensuring consistency across the codebase. This change enhances the handling of database source paths in application logic and tests.
…cslab/MsdialWorkbench into Add_MztabFormatExport
- Changed namespace from `MsdialCoreTests.Export` to `CompMs.MsdialCore.Export.Tests`. - Added `[TestClass]` attribute to `MztabFormatExportTests` and changed its access modifier to public. - Removed several unused using directives for cleanup. - Introduced a new constant `smallMoleculeIdentificationReliability`. - Defined a read-only property `Separator`. - Retained the private field `_annotatorID2DataBaseID`.
Changed `WriteMtdSection` from `protected` to `internal` in `MztabFormatExport.cs` to broaden its accessibility within the assembly. Updated formatting of `<InternalsVisibleTo Include="MsdialCoreTests" />` in `MsdialCore.csproj` for consistency while maintaining functionality.
Updated `MztabFormatExportTests.cs` to improve the `MztabWriteMtdSectionTest` method by implementing asynchronous data loading and processing. Added new using directives and deployment items for necessary resources. Modified `MsdialCoreTests.csproj` to include resource copying from the `Resources\Export` directory. Added several binary files for alignment results and datasets, along with a new `small_test_project.mdproject` file for testing resources.
Updated `MztabFormatExportTests.cs` to include additional using directives and new test methods, specifically `MztabFormatExporterTest`, to validate the `MztabFormatExporter` functionality. Introduced `StubMetadataAccessor` for improved metadata handling. Added binary file `AlignmentResult_2025_07_31_12_33_06.dcl` for testing purposes. Modified `test_mztab.mzTab.txt` to include new metadata entries, ensuring compliance with mzTab specifications.
Introduces the `AlignmentMztabMExportViewModel` class in the `CompMs.App.Msdial.ViewModel.Export` namespace. This class implements `IAlignmentResultExportViewModel` and manages properties for selection and export capabilities using Reactive Extensions. It includes a private model field, reactive properties for `IsSelected` and `CanExport`, and exposes a read-only collection of export types.
Introduced a new `DataTemplate` for `AlignmentMztabMExportViewModel` featuring an `Expander` labeled "mztab-M". The template includes a `Grid` with a `CheckBox` for selection and an `ItemsControl` that displays a collection of `Types` using a `WrapPanel`. Each item in the `ItemsControl` is represented by a `CheckBox`, allowing for individual selection and enabling/disabling based on item properties.
Added a new case in the switch statement to handle `AlignmentMztabMExportModel`, returning an instance of `AlignmentMztabMExportViewModel` when this model type is encountered.
Refactored the `peakGroup` initialization in `LcmsMethodModel.cs` to use a consolidated `List<ExportType>` for improved readability and maintainability. Introduced a new `AlignmentMztabMExportModel` instance to the `exportGroups` list, enhancing the export functionality for MZTab format.
# Conflicts: # src/MSDIAL5/MsdialGuiApp/Model/Lcms/LcmsMethodModel.cs # src/MSDIAL5/MsdialGuiApp/ViewModel/Export/AlignmentResultExportViewModel.cs
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces the implementation of the mztab-M Exporter and its integration into the GUI. The changes add support for exporting data in the mztab-M format and include both the exporter implementation and the user interface integration.
- Added MztabFormatExporter class to handle mztab-M format export functionality
- Created AlignmentMztabMExportModel and AlignmentMztabMExportViewModel for GUI integration
- Updated test files to include additional constructor parameter for MoleculeDataBase
Reviewed Changes
Copilot reviewed 44 out of 53 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/MSDIAL5/MsdialGuiApp/Model/Export/AlignmentMztabMExportModel.cs | New model class for managing mztab-M export functionality |
| src/MSDIAL5/MsdialGuiApp/ViewModel/Export/AlignmentMztabMExportViewModel.cs | New view model for mztab-M export UI integration |
| src/MSDIAL5/MsdialGuiApp/View/Export/AlignmentResultExportWin.xaml | Added UI template for mztab-M export option |
| Multiple test files | Updated MoleculeDataBase constructor calls to include new file path parameter |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| Style="{StaticResource FormalItalicAxisTitle}" | ||
| Grid.Row="2" Grid.Column="2"/> | ||
| <TextBlock Text="{Binding Labels.VerticalTitle}" | ||
| <TextBlock Text="{Binding Path=SelectedVerticalAxisItem.Value.GraphLabel}" |
There was a problem hiding this comment.
The Text binding appears to be swapped with line 158. This change binds Labels.HorizontalTitle to what appears to be a vertical axis label position based on the Grid.Row and Grid.Column placement.
| Style="{StaticResource FormalItalicAxisTitle}" | ||
| Grid.Row="2" Grid.Column="2"/> | ||
| <TextBlock Text="{Binding Labels.VerticalTitle}" | ||
| <TextBlock Text="{Binding Path=SelectedVerticalAxisItem.Value.GraphLabel}" |
There was a problem hiding this comment.
The Text binding appears to be swapped with line 155. This change binds SelectedVerticalAxisItem.Value.GraphLabel to what appears to be a horizontal axis label position, which seems incorrect.
| <TextBlock Text="{Binding Path=SelectedVerticalAxisItem.Value.GraphLabel}" | |
| <TextBlock Text="{Binding Path=Labels.VerticalTitle}" |
This pull request introduces the implementation of the mztab-M Exporter and its integration into the GUI. The changes include:
mztab-M Exporter Implementation
• Developed the MztabFormatExporter class to handle the export of data in the mztab-M format.
• Added support for writing metadata, small molecule data, and other sections required by the mztab-M specification.
Model and ViewModel for mztab-M Export
• Created AlignmentMztabMExportModel to manage the export logic and integrate with the application's data structures.