-
Notifications
You must be signed in to change notification settings - Fork 371
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
Refactoring #1868
Refactoring #1868
Conversation
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.
@LadDeep The changes to the metrics collection code in this PR cause tests to fail. It looks like there are now two copies of the histogram arrays, one set in AbstractWgsMetricsCollector, and another set in the new WgsHistogramCollector class, and some code is using the AbstractWgsMetricsCollector arrays, while other code is using the WgsHistogramCollector arrays. If you fix this we can revisit this PR.
Was this an AI-generated patch, out of curiosity?
@droazen Yes, I'm aware that the tests are failing and I'm working on that. About the data duplicacy of the histogram, thanks for bringing it to light. They seemed to be tighly coupled and that led me to split the responsibility. I'll once again look through the issue. No, these were done manually. I'm new to code refactoring and this is my first open source contribution. Can you me help me in better understanding the project so that I can contribute effectively? Some guidance/roadmap would be highly appreciated! |
@LadDeep Ah, I see -- well, the refactorings here are mostly clear improvements, it's just the changes to the metrics classes that are problematic. Many of the child classes of If you wish to learn more about this project, the best resources are the tool documentation here (search for "Picard" or for the tool you're interested in) and the tutorials here. This tutorial, for example, should give a good sense of the kinds of "data pre-processing" tasks in genomics for which Picard is typically used. There are also recordings of workshop videos such as this one, which discusses genomic data pre-processing in general, and the well-known Picard tool |
@droazen I'll try it out once to decouple both the classes considering all of the side effects that are occuring. Just wanted to know, if in case for merging without last commit, I should create another pull request after reverting it, right? Thanks for the resources 🙌. |
Hi @LadDeep, if you revert the metrics commit, it's fine to do so in this PR rather than opening a separate PR. |
Alright @droazen. I'll let you know once I'm done. |
This reverts commit c147cbb.
@droazen I've reverted last commit. I'll work on |
@droazen Pinging for review. |
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.
👍 Looks good now!
Thanks @droazen🙌🏼 |
Description
Commit Id: f691e4b
Extracted file writing redundant code from buildWriter() in IlluminaBasecallsToFastq. Performed following refactoring: Extract method and Introduce variables to enhance readability and reduce redundancy.
Commit Id: 50e9439
Extracted complex conditional to find out whether the adapters are present or not by introducing hasEitherAdapter() and hasBothAdapter() methods. Performed following refactoring: Decompose Conditional to enhance readability and understandability.
Commit Id: 2816540
MarkDuplicates and MarkDuplicatesForFlowHelper has method implementation for generateDuplicateIndexes() signatured in their super class. They have similar implementation and hence extracted common code is moved to MarkDuplicates and used directly from there. Performed following refactoring: Move Method to enhance readability, understandability and reduce redundancy.
Commit Id: c147cbb
AbstractWsgMetricsCollector has multiple responsibilities for collecting metrics and histograms which were seperated by creating WsgHistogramCollector class. Performed following refactoring: Extract Class to enhance readability, understandability and resolving Multifaceted Abstraction smell. **Note: Test case needs to be modified for this commit
Checklist (never delete this)
Never delete this, it is our record that procedure was followed. If you find that for whatever reason one of the checklist points doesn't apply to your PR, you can leave it unchecked but please add an explanation below.
Content
Review
For more detailed guidelines, see https://github.com/broadinstitute/picard/wiki/Guidelines-for-pull-requests