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

EVA-3543 check if rs with same hash already exist before merging #441

Conversation

nitin-ebi
Copy link
Contributor

No description provided.

@nitin-ebi nitin-ebi self-assigned this Apr 24, 2024
Comment on lines 200 to 201
existingClusteredVariantEntity.getAccession()).accessionToKeep) {
merge(mergeDestination, existingClusteredVariantEntity, currentOperation);
Copy link
Member

Choose a reason for hiding this comment

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

The existingClusteredVariantEntity is also part of the mergees so we will likely have to remove it from the list

@@ -192,6 +193,18 @@ public void writeRSMerge(SubmittedVariantOperationEntity currentOperation)
getMergeDestinationAndMergees(mergeCandidates);
ClusteredVariantEntity mergeDestination = mergeDestinationAndMergees.getLeft();

// check if any variant with same hash as mergeDestination already exist in DB
Copy link
Member

Choose a reason for hiding this comment

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

This section is only relevant if the list of mergees has more than 2 elements. Can we test this before going through this ?

Copy link
Contributor

@apriltuesday apriltuesday Apr 25, 2024

Choose a reason for hiding this comment

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

Does it also work (and maybe make more sense) to actually just extract this removal into a method that's called before the for-loop, and modify it so it checks for all mergee accessions instead of just one?

I'm sure this implementation works, but I'm wary of essentially redo-ing merge detection and prioritisation logic rather than just trusting the candidates we have.

Comment on lines 202 to 204
} else {
merge(existingClusteredVariantEntity, mergeDestination, currentOperation);
mergeDestination = existingClusteredVariantEntity;
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this part is necessary. If the existing cluster variant entity document is the merge destination then the norm code bellow would work.

Copy link
Member

@tcezard tcezard left a comment

Choose a reason for hiding this comment

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

Looks good to me. Left optional comments.

@nitin-ebi nitin-ebi merged commit 0170913 into EBIvariation:master May 1, 2024
1 check passed
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

3 participants