Skip to content

Koina Consolidation and Refactor#3

Open
trishorts wants to merge 7 commits into
pcruzparri:Koina_RT_and_Flyabilityfrom
trishorts:KoinaConsolidatin
Open

Koina Consolidation and Refactor#3
trishorts wants to merge 7 commits into
pcruzparri:Koina_RT_and_Flyabilityfrom
trishorts:KoinaConsolidatin

Conversation

@trishorts
Copy link
Copy Markdown

This pull request introduces a new shared abstract base class, KoinaModelBase, to unify and simplify the implementation of Koina prediction models. It refactors the existing model classes (PFly2024FineTuned and Prosit2019iRT) to inherit from this base class, centralizing validation, batching, and HTTP inference logic. As a result, model-specific classes are now more concise and maintainable, with common functionality abstracted away. Additionally, the IKoinaModelIO interface is updated to support the new base class features.

Core infrastructure improvements:

  • Added new abstract base class KoinaModelBase that provides common validation, batching, and HTTP inference logic for all Koina models, including methods for sequence validation, request batching, HTTP requests, and response deserialization. (mzLib/Predictions/Koina/SupportedModels/KoinaModelBase.cs)
  • Updated the IKoinaModelIO interface to include a new MaxPeptideLength property and improved XML documentation for all members, supporting the requirements of the new base class. (mzLib/Predictions/Koina/Interfaces/IKoinaModelIO.cs)

Model refactoring and simplification:

  • Refactored PFly2024FineTuned to inherit from KoinaModelBase, removing redundant code and delegating validation and batching to the base class. Model-specific logic is now limited to detectability class definitions and response parsing. (mzLib/Predictions/Koina/SupportedModels/PFly2024FineTuned.cs)
  • Refactored Prosit2019iRT to inherit from a new PrositModelBase (not shown here, but implied), streamlining validation, batching, and response handling by using shared base class methods. (mzLib/Predictions/Koina/SupportedModels/Prosit2019iRT.cs)

These changes make the codebase easier to extend and maintain, ensuring consistent validation and prediction workflows across all Koina models.

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.

1 participant