Skip to content

updatind SamTools API for sort - 1.3.1 - #927

Merged
peterjc merged 10 commits into
biopython:masterfrom
NikiB:master
Mar 20, 2017
Merged

peterjc merged 10 commits into
biopython:masterfrom
NikiB:master

Conversation

@NikiB

@NikiB NikiB commented Sep 8, 2016

Copy link
Copy Markdown
Contributor

I made the changes for SamTools sort according to the new samtools version 1.3.1
all test_samtools_tool.py worked

niki_main added 2 commits September 8, 2016 16:19
@NikiB

NikiB commented Sep 8, 2016

Copy link
Copy Markdown
Contributor Author

travis is running the check on an old samtools program, is there a chance to update for the new one?

@peterjc

peterjc commented Sep 9, 2016

Copy link
Copy Markdown
Member

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.

@peterjc

peterjc commented Sep 9, 2016

Copy link
Copy Markdown
Member

@saketkc what do you think as you wrote most of the samtools wrappers?

@saketkc

saketkc commented Sep 10, 2016

Copy link
Copy Markdown
Contributor

I would personally want to support both versions. I will take a look at it in the next couple of days.
I haven't personally moved to samtools 1.3 though.

@NikiB

NikiB commented Sep 11, 2016

Copy link
Copy Markdown
Contributor Author

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.

@NikiB

NikiB commented Oct 2, 2016

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Typo, F should be P in (PREFIX)

stdout=subprocess.PIPE, \
stderr=subprocess.PIPE, \
universal_newlines=True)
>>> stdoutdata, stderrdata = child.communicate()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This has effectively made the samtools binary a dependency for running the Biopython doctests - something we've avoided until now.

@peterjc

peterjc commented Oct 6, 2016

Copy link
Copy Markdown
Member

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).

niki_main added 3 commits October 31, 2016 14:45
0.1.x = SamtoolsVersion0xSortCommandline
1.x.x = SamtoolsVersion1xSortCommandline
version 0.1.x = SamtoolsVersion0xSortCommandline
version 1.x.x = SamtoolsVersion1xSortCommandline
@NikiB

NikiB commented Oct 31, 2016

Copy link
Copy Markdown
Contributor Author

I divided the sort by versions since both versions are totally different. and now there is no dependency

@codecov-io

codecov-io commented Oct 31, 2016 •

Copy link
Copy Markdown

Codecov Report

Merging #927 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff            @@
##           master    #927      +/-   ##
=========================================
+ Coverage    80.4%   80.4%   +<.01%     
=========================================
  Files         319     319              
  Lines       48800   48807       +7     
=========================================
+ Hits        39236   39243       +7     
  Misses       9564    9564
Impacted Files Coverage Δ
Bio/Sequencing/Applications/_samtools.py 97.59% <100%> (+0.18%) ⬆️
Bio/Sequencing/Applications/__init__.py 100% <100%> (ø) ⬆️
Bio/NeuralNetwork/Gene/Schema.py 71.07% <0%> (-0.83%) ⬇️
Bio/Graphics/Comparative.py 100% <0%> (+2.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3138e9a...2f39512. Read the comment docs.

@peterjc

peterjc commented Nov 24, 2016

Copy link
Copy Markdown
Member

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 SamtoolsSortCommandline class, which is a backwards incompatible change.

I suggest renaming SamtoolsVersion0xSortCommandline back to SamtoolsSortCommandline, and leaving the new class as SamtoolsVersion1xSortCommandline.

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 NEWS and CONTRIB files?

@NikiB

NikiB commented Nov 30, 2016

Copy link
Copy Markdown
Contributor Author

Yes to both your questions about contribution.

For the legacy name SamtoolsSortCommandline I just added the import in init as
"import SamtoolsVersion0xSortCommandline as SamtoolsSortCommandline".
This way people who need to be sure of the of the version have good reference as well.

@peterjc

peterjc commented Dec 1, 2016

Copy link
Copy Markdown
Member

What do you think @saketkc (of the changes as they stand, but in particular the class naming)?

@saketkc

saketkc commented Dec 2, 2016

Copy link
Copy Markdown
Contributor

I like @NikiB's idea of aliasing SamtoolsSortCommandline SamtoolsVersion0xSortCommandline.
All changes look good to me. Thanks @NikiB for handling this!

@saketkc

saketkc commented Mar 17, 2017

Copy link
Copy Markdown
Contributor

@peterjc This should be good to merge?

@peterjc

peterjc commented Mar 20, 2017

Copy link
Copy Markdown
Member

Thanks for chasing this up @saketkc.

Other than two unused import subprocess lines, this should be fine.

@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 NEWS and CONTRIB files?

@NikiB

NikiB commented Mar 20, 2017

Copy link
Copy Markdown
Contributor Author

yes, no problem with any of it

@peterjc
peterjc merged commit 6335514 into biopython:master Mar 20, 2017
@peterjc

peterjc commented Mar 20, 2017

Copy link
Copy Markdown
Member

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 NikiB? I'm double checking as you have not filled in a name on your GitHub profile.

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/

@NikiB

NikiB commented Mar 20, 2017

Copy link
Copy Markdown
Contributor Author

No problem :)
I will update my profile here later

peterjc added a commit that referenced this pull request Mar 20, 2017
See preceeding commits and pull request #927.
MarkusPiotrowski pushed a commit to MarkusPiotrowski/biopython that referenced this pull request Oct 31, 2017
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.
MarkusPiotrowski pushed a commit to MarkusPiotrowski/biopython that referenced this pull request Oct 31, 2017
See preceeding commits and pull request biopython#927.
peterjc added a commit to peterjc/biopython that referenced this pull request Nov 15, 2020
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)
peterjc added a commit to peterjc/biopython that referenced this pull request Nov 16, 2020
peterjc added a commit to peterjc/biopython that referenced this pull request Nov 16, 2020
peterjc added a commit that referenced this pull request Nov 17, 2020
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)
peterjc added a commit that referenced this pull request Nov 17, 2020
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)
JoaoRodrigues pushed a commit to JoaoRodrigues/biopython that referenced this pull request Jun 3, 2021
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)
JoaoRodrigues pushed a commit to JoaoRodrigues/biopython that referenced this pull request Jun 3, 2021
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.

4 participants