-
Notifications
You must be signed in to change notification settings - Fork 153
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
bamtools sort #7
base: master
Are you sure you want to change the base?
Conversation
modified: api/BamMultiReader.h deleted: api/BamSortCriteria.cpp~ deleted: api/BamSortCriteria.h~ modified: api/CMakeLists.txt modified: api/SamConstants.h modified: api/internal/BamMultiMerger_p.h modified: api/internal/BamMultiReader_p.cpp modified: api/internal/BamMultiReader_p.h modified: toolkit/bamtools_convert.h modified: toolkit/bamtools_sort.cpp modified: toolkit/bamtools_sort.h
Martin, However, as BamTools is primarily a library, I'd rather we not change the signature for the public BamMultiReader::SetSortOrder() API method if possible. I just pushed a source-breaking update last week and am wary to force another on clients so soon. Perhaps adding additional values to the SortOrder enum and then adding an optional boolean parameter (ascending?) to the SetSortOrder() method would capture the full range of current sort options for now. And then later on (maybe at BT 2.0), use your new BamSortCriteria object directly instead of these parameters. So it could look like this (for now): This method would internally handle setting up the proper BamSortCriteria object to use. Just about everything else could remain. It does look good, I just have to keep an eye on keeping the interface level as stable as possible. Feel free to give your response if you disagree or have other suggestions. Discussion is a good thing. ps - Just got your email. Can you update this request when you have those sorting bugs ironed out? And perhaps the change I proposed to the API-level method? Again, huge thanks. |
… x==x then false). Therefore one sorting criteria can not be flipped to offer sorting in the other direction
Hi Derek, I can understand you, that you want to hold your BamMultiReader as stable as What do you think of having two signatures: The advantage would be, that the bamtools_sort class could then use all the The error has been found in the Comparator functor used in the std::sort Regards and thanks for offering this library Martin P.S.: The API adjustment will have been concluded after I sent this mail. ----- Ursprüngliche Mail ---- Martin, However, as BamTools is primarily a library, I'd rather we not change the So it could look like this (for now): This method would internally handle setting up the proper BamSortCriteria object It does look good, I just have to keep an eye on keeping the interface level as ps - Just got your email. Can you update this request when you have those Reply to this email directly or view it on GitHub: |
…, const bool& ascending =true) and removing comments
Thanks for the update. I have no problem adding your new overloaded method with BamSortCriteria to BMR; just didn't want to remove/modify the existing one in a way that would break source-compatibility. The bamtools_sort tool can change as much as you want/need. There is no real API for it (so no code depends on it) and no user will "care" how the internals are implemented, as long as the utility works correctly. So yeah, thanks again. I'll do a detailed review and merge soon. |
…ion of the STL. Correction of using int32_t instead of uint32_t. This spoiled the order in files havin entries without POS/AS
Hi Derek now everything seems to work correctly.Even I could simplify the sourcecode Have fun with the review. I hope you haven't started to far. All the best ----- Ursprüngliche Mail ---- Thanks for the update. I have no problem adding your new overloaded method with BamSortCriteria to BMR; The bamtools_sort tool can change as much as you want/need. There is no real So yeah, thanks again. I'll do a detailed review and merge soon. Reply to this email directly or view it on GitHub: |
In this implementation all sorting criterias have been excluded to the class api/BamSortCriteria. This has the advantage that any other sorting criterias can be easily added. Furthermore sorting can be switched to descending by adding -desc. This works for all sorting criterias. In this implementation sorting for the SAM/BAM tags QNAME, POS, AS (Alignment Score from BFAST Alignment) are possible