Repository navigation
updatind SamTools API for sort - 1.3.1 - #927
Conversation
#needs a better way to save the test files..
|
travis is running the check on an old samtools program, is there a chance to update for the new one? |
|
Do you have any thoughts on how we should try to support both versions of the samtools command line API? In other tools like BLAST+ where an option as was added or removed, we have offered both (with comments in the docstrings) - but it makes writing the unit tests a little harder. |
|
@saketkc what do you think as you wrote most of the samtools wrappers? |
|
I would personally want to support both versions. I will take a look at it in the next couple of days. |
|
I can do the support for both versions in samtools sort as it done with BLAST+. My only concern is for the options with the same name and different meanings. |
|
I added the ability to use both versions of samtools, the 0.1.x and 1.3.x |
| equate=False, checker_function=lambda x: isinstance(x, str)), | ||
| _Option(["-O", "O"], """(FORMAT) Write the final output as sam, bam, or cram""", | ||
| equate=False, checker_function=lambda x: isinstance(x, str)), | ||
| _Option(["-T", "T"], """(FREFIX) Write temporary files to PREFIX.nnnn.bam, or if the specified PREFIX |
| stdout=subprocess.PIPE, \ | ||
| stderr=subprocess.PIPE, \ | ||
| universal_newlines=True) | ||
| >>> stdoutdata, stderrdata = child.communicate() |
There was a problem hiding this comment.
This has effectively made the samtools binary a dependency for running the Biopython doctests - something we've avoided until now.
|
Auto-detecting the samtools version won't work for some use cases like preparing a script on one machine (building command line strings) and then submitting it to a cluster. I would much prefer this be explicit and in the hands of the user - probably the simplest way to do this is two command line wrapper classes, avoiding code duplication by subclassing (see the BLAST+ wrappers for a good example of this - we avoid repeating many many common BLAST+ parameters that way). |
0.1.x = SamtoolsVersion0xSortCommandline 1.x.x = SamtoolsVersion1xSortCommandline
version 0.1.x = SamtoolsVersion0xSortCommandline version 1.x.x = SamtoolsVersion1xSortCommandline
|
I divided the sort by versions since both versions are totally different. and now there is no dependency |
Codecov Report
@@ Coverage Diff @@
## master #927 +/- ##
=========================================
+ Coverage 80.4% 80.4% +<.01%
=========================================
Files 319 319
Lines 48800 48807 +7
=========================================
+ Hits 39236 39243 +7
Misses 9564 9564
Continue to review full report at Codecov.
|
|
Sorry for the delay in getting back to you. With one minor change I think this is ready to go. Right now this removes the old I suggest renaming Also, are you happy to dual license your contributions under both the Biopython Licence Agreement AND the 3-Clause BSD license? See #898. And finally, are you happy to be thanked by name in the |
|
Yes to both your questions about contribution. For the legacy name SamtoolsSortCommandline I just added the import in init as |
|
What do you think @saketkc (of the changes as they stand, but in particular the class naming)? |
|
@peterjc This should be good to merge? |
|
Thanks for chasing this up @saketkc. Other than two unused @NikiB: Are you happy to dual licence your contributions under both the Biopython License Agreement AND the BSD 3-Clause License? See #898. Also, are you happy to be thanked by name in the |
|
yes, no problem with any of it |
|
Merged, thank you. @NikiB are you happy for me to thank you under your real name (which is visible along with your email address via the commit itself), or just as the alias Note should you wish to, it is possible to hide your email address on GitHub - see https://help.github.com/articles/keeping-your-email-address-private/ |
|
No problem :) |
See preceeding commits and pull request #927.
Squashed commit of pull request biopython#927, introducing two alternative wrappers due to the incompatible change to the ``samtools sort`` command behaviour change in v1.0.
See preceeding commits and pull request biopython#927.
Original author Saket Choudhary and other contributors since as tracked by version control have agreed: - Adhemar Zerlotini (@azneto) biopython#1412 (comment) - Christian Brueffer (@cbrueffer) biopython#898 (comment) - @morrme biopython#1172 (comment) - Peter Cock (@peterjc) biopython#898 (comment) - Saket Choudhary (@saketkc) biopython#898 (comment) - Sergio Valqui (@svalqui) biopython#1749 - Sujan Dulal (@Dsujan) biopython#2430 - Travis Wrightsman (@twrightsman) biopython#898 (comment) - Veronika Berman (@NikiB) biopython#927 (comment)
Original author Osvaldo Zagordi and the contributors since as tracked by version control have agreed: - Brad Chapman (@chapmanb) http://mailman.open-bio.org/pipermail/biopython-dev/2013-July/019903.html - Brian Osborne (@bosborne) biopython#898 (comment) - Carlos Pena (@carlosp420) biopython#898 (comment) - Christian Brueffer (@cbrueffer) biopython#898 (comment) - John Ma (@JohnMCMa) biopython#1790 - Osvaldo Zagordi (@ozagordi) biopython#3365 - Peter Cock (@peterjc) biopython#898 (comment) - Saket Choudhary (@saketkc) biopython#898 (comment) - Sergio Valqui (@svalqui) biopython#1749 - Veronika Berman (@NikiB) biopython#927 (comment)
Original author Osvaldo Zagordi and the contributors since as tracked by version control have agreed: - Brad Chapman (@chapmanb) http://mailman.open-bio.org/pipermail/biopython-dev/2013-July/019903.html - Brian Osborne (@bosborne) biopython#898 (comment) - Carlos Pena (@carlosp420) biopython#898 (comment) - Christian Brueffer (@cbrueffer) biopython#898 (comment) - John Ma (@JohnMCMa) biopython#1790 - Osvaldo Zagordi (@ozagordi) biopython#3365 - Peter Cock (@peterjc) biopython#898 (comment) - Saket Choudhary (@saketkc) biopython#898 (comment) - Sergio Valqui (@svalqui) biopython#1749 - Veronika Berman (@NikiB) biopython#927 (comment)
Original author Saket Choudhary and other contributors since as tracked by version control have agreed: - Adhemar Zerlotini (@azneto) #1412 (comment) - Christian Brueffer (@cbrueffer) #898 (comment) - @morrme #1172 (comment) - Peter Cock (@peterjc) #898 (comment) - Saket Choudhary (@saketkc) #898 (comment) - Sergio Valqui (@svalqui) #1749 - Sujan Dulal (@Dsujan) #2430 - Travis Wrightsman (@twrightsman) #898 (comment) - Veronika Berman (@NikiB) #927 (comment)
Original author Osvaldo Zagordi and the contributors since as tracked by version control have agreed: - Brad Chapman (@chapmanb) http://mailman.open-bio.org/pipermail/biopython-dev/2013-July/019903.html - Brian Osborne (@bosborne) #898 (comment) - Carlos Pena (@carlosp420) #898 (comment) - Christian Brueffer (@cbrueffer) #898 (comment) - John Ma (@JohnMCMa) #1790 - Osvaldo Zagordi (@ozagordi) #3365 - Peter Cock (@peterjc) #898 (comment) - Saket Choudhary (@saketkc) #898 (comment) - Sergio Valqui (@svalqui) #1749 - Veronika Berman (@NikiB) #927 (comment)
Original author Saket Choudhary and other contributors since as tracked by version control have agreed: - Adhemar Zerlotini (@azneto) biopython#1412 (comment) - Christian Brueffer (@cbrueffer) biopython#898 (comment) - @morrme biopython#1172 (comment) - Peter Cock (@peterjc) biopython#898 (comment) - Saket Choudhary (@saketkc) biopython#898 (comment) - Sergio Valqui (@svalqui) biopython#1749 - Sujan Dulal (@Dsujan) biopython#2430 - Travis Wrightsman (@twrightsman) biopython#898 (comment) - Veronika Berman (@NikiB) biopython#927 (comment)
Original author Osvaldo Zagordi and the contributors since as tracked by version control have agreed: - Brad Chapman (@chapmanb) http://mailman.open-bio.org/pipermail/biopython-dev/2013-July/019903.html - Brian Osborne (@bosborne) biopython#898 (comment) - Carlos Pena (@carlosp420) biopython#898 (comment) - Christian Brueffer (@cbrueffer) biopython#898 (comment) - John Ma (@JohnMCMa) biopython#1790 - Osvaldo Zagordi (@ozagordi) biopython#3365 - Peter Cock (@peterjc) biopython#898 (comment) - Saket Choudhary (@saketkc) biopython#898 (comment) - Sergio Valqui (@svalqui) biopython#1749 - Veronika Berman (@NikiB) biopython#927 (comment)
I made the changes for SamTools sort according to the new samtools version 1.3.1
all test_samtools_tool.py worked