-
-
Notifications
You must be signed in to change notification settings - Fork 758
Master clean arch mutation endpoint with legacy query #11750
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
Master clean arch mutation endpoint with legacy query #11750
Conversation
| * @param fetchAllMetaMutationsInProfileUseCase | ||
| * @param fetchAllMutationsInProfileUseCase | ||
| */ | ||
| public record GetMutationUseCases( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this and usages to MutationUseCases
| import org.cbioportal.legacy.web.parameter.Direction; | ||
| import org.cbioportal.shared.enums.ProjectionType; | ||
|
|
||
| public record MutationSearchCriteria(ProjectionType projection, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good design to package parameters. Maybe rename to MutationQueryOptions since there's no search involved?
|
|
||
| public ClickhouseMutationRepository(ClickhouseMutationMapper clickhouseMutationMapper) { | ||
| this.mapper = clickhouseMutationMapper; | ||
| this.molecularProfileCaseIdentifierUtil = new MolecularProfileCaseIdentifierUtil(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this from new instance to injection (include it in the parameters)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, High-level modules should not depend on low-level modules
…s seperate method
… for grouping profiles and removing duplicates
…e information to clickhouse for faster processing and reducing the risk of doing redundant joins
7376578 to
80c981e
Compare
Signed-off-by: Zhaoyuan (Ryan) Fu <[email protected]>
80c981e to
7773b1f
Compare
fuzhaoyuan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Great job!
Fix #11640
Migrate Mutation to Clean Architecture with ClickHouse Support
This PR refactors mutation data endpoints from legacy architecture to clean architecture with ClickHouse support, as part of the broader backend migration to ClickHouse and clean architecture patterns
ARCHITECTURAL CHANGES
Usecase Layer
FetchAllMetaMutationsInProfileUseCase- Use case for retrieving MetaMutation data
FetchAllMutationsInProfileUseCase- Use case for retrieving Mutation data
GetMutationDataUseCases- provides a centralized way to access and utilize the use cases
Repository
MutationRepository- Interface that defines the methods for retrieving data from the repository
Infrastructure
ClickhouseMutationMapper- Maps the repository methods to the ClickhouseMutationMapper.xml file
ClickhouseMutationRepository- Implements the MutationRepository methods used to communicate with the database using ClickhouseMutationMapper.
Rest Layer
ColumnMutationController- New @Profile("clickhouse") rest controller supporting retrieval of Mutation and MutationMeta data
MapStruct Integration
###Simple Flow Diagram

Limitations
In the effort to reduce the number of joins and ensure the population of all required fields needed for the Mutation object in SUMMARY and DETAILED projections, I faced a cartesian effect due to no unique combination of values in genomic_event_derived. Please take a look at this draft PR for more details #11650
Reviewer Notes
Please feel free to review the overall structure and approach. Feedback on the direction, naming, or anything architectural is welcome, especially in the use case logic, queries and dependency setup.