Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the GNPS export functionality by introducing a new interface-based metadata access system. The changes improve code organization by replacing the concrete MulticlassFileMetaAccessor with an interface approach.
- Removes the
fileMetaparameter fromAlignmentGnpsExportModelconstructors across all method models - Introduces
IFileClassMetaAccessorinterface andGnpsFileClassMetaAccessorimplementation for GNPS-specific metadata handling - Updates export methods to use the new interface-based approach and adds dedicated MGF export functionality
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Multiple MethodModel files | Remove fileMeta parameter from AlignmentGnpsExportModel constructor calls |
| AlignmentGnpsExportModel.cs | Remove AccessFileMeta property and use GnpsFileClassMetaAccessor directly |
| IFileClassMetaAccessor.cs | New interface defining metadata access methods |
| GnpsFileClassMetaAccessor.cs | New GNPS-specific implementation of the metadata accessor interface |
| MulticlassFileMetaAccessor.cs | Update to implement the new interface |
| AlignmentGnpsExporter.cs | Refactor export logic with new accessor and separate MGF export method |
| AlignmentCSVExporter.cs | Update to use interface instead of concrete class |
| SpectraExport.cs | Add new MGF export method for individual spot properties |
| AlignmentMgfExporter.cs | Remove unnecessary namespace braces |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| metaAccessor, | ||
| quantAccessor, | ||
| stats); | ||
| []); |
There was a problem hiding this comment.
Passing an empty array literal [] for stats parameter suggests this parameter may no longer be needed. Consider removing the stats parameter from the method signature if it's not being used.
| IReadOnlyList<MSDecResult> msdecResults, | ||
| IReadOnlyList<AnalysisFileBean> files, | ||
| MulticlassFileMetaAccessor fileMetaAccessor, | ||
| GnpsFileClassMetaAccessor fileMetaAccessor, |
There was a problem hiding this comment.
The method parameter should use the interface type IFileClassMetaAccessor instead of the concrete implementation GnpsFileClassMetaAccessor to maintain consistency with the interface-based design pattern used elsewhere in the codebase.
| GnpsFileClassMetaAccessor fileMetaAccessor, | |
| IFileClassMetaAccessor fileMetaAccessor, |
| } | ||
|
|
||
| private void ExportGnpsTable(Stream stream, IReadOnlyList<AnalysisFileBean> files, MulticlassFileMetaAccessor fileMetaAccessor, IMetadataAccessor metaAccessor, IQuantValueAccessor quantAccessor, IReadOnlyList<StatsValue> stats, List<AlignmentSpotProperty> flattenedSpots, IReadOnlyList<MSDecResult> alignedMsdecResults) { | ||
| private void ExportGnpsTable(Stream stream, IReadOnlyList<AnalysisFileBean> files, GnpsFileClassMetaAccessor fileMetaAccessor, IMetadataAccessor metaAccessor, IQuantValueAccessor quantAccessor, List<AlignmentSpotProperty> flattenedSpots, IReadOnlyList<MSDecResult> alignedMsdecResults) { |
There was a problem hiding this comment.
The fileMetaAccessor parameter should use the interface type IFileClassMetaAccessor instead of the concrete implementation GnpsFileClassMetaAccessor for consistency with the interface-based design.
PR Classification
Refactor and enhancement of file metadata handling in the export process.
PR Summary
This pull request introduces a new metadata access structure for GNPS file exports, replacing existing classes and interfaces to improve code organization and functionality. Key changes include:
AlignmentCSVExporter: Updated to useIFileClassMetaAccessorinstead ofMulticlassFileMetaAccessor.AlignmentGnpsExporter: ReplacedMulticlassFileMetaAccessorwithGnpsFileClassMetaAccessorand added logic for GNPS format export.GnpsFileClassMetaAccessor: Implemented to provide metadata access for GNPS file classes.IFileClassMetaAccessor: Defined to standardize methods for retrieving headers and content for analysis files.AlignmentMgfExporter: Updated to implement theExportmethod directly, enhancing its functionality.