Repository navigation
add fasta-nowrap to SeqIO.write API - #1450
Conversation
|
Oops, should have ran tests before submitting. Sorry. Looks like the tests are written such that |
|
The place holder makes sense - up until now all the output formats have had a parser, so the tests reflect that. You could instead try adding a special case to the tests? |
|
I think to fix the test, you'd need to update this line elif format == "fasta":to: elif format in ["fasta", "fasta-nowrap"]: |
|
That helped fix some of the test. I'm breaking some new tests. Looks like I need to add a bunch of "expected output" lines to |
|
Ok, all tests are passing now. |
Codecov Report
@@ Coverage Diff @@
## master #1450 +/- ##
=========================================
+ Coverage 84.77% 84.8% +0.02%
=========================================
Files 321 323 +2
Lines 49316 49393 +77
=========================================
+ Hits 41810 41886 +76
- Misses 7506 7507 +1
Continue to review full report at Codecov.
|
|
I hope you spotted Would you like to add yourself to the |
|
Oh wow, I totally missed that. 🤦♂️ Thanks for the review! I've added myself to |
|
(The TravisCI Python 2.7 test failed in the KD Tree code, looks like a stochastic failure and I have re-run that) |
|
Thanks @peterjc. Looks like the tests passed this time! |
|
See #666 (comment) where perhaps |
|
(Hang on, I've had a rebase glitch while adding the parser on top of your branch...) |
3948217 to
107eff0
Compare
|
I had to do a Anyway, how does this look @Zsailer? There is scope for also implementing SeqIO indexing for the new FASTA variant as well. |
107eff0 to
77febec
Compare
This distinction is important for the planned parser.
|
Updated again since master branch now enforces I revised my doctest to avoid needing a |
|
@peterjc, this looks good! Thanks for pushing this forward! |
|
Great, thanks. Once the tests have passed on this, I'll apply it. (The stricter docstring checking is fairly recent, it will make life harder for a few of the already open pull requests) |
|
@bow Does this look good to you? We could add more on the tests side, and perhaps implement direct indexing of two-line-per-record FASTA as well - but this seems a useful unit of work now. |
|
Good catch on the write class name - I agree with you. I'll fix that before merging this. |
Suggested by Bow while reviewing pull request biopython#1450
As the original author I have agreed, as have the contributors since as per the git commit logs: - Olivier Morelle (@Oli4) #898 (comment) - Zachary Sailer (@Zsailer) #1450 - Bertrand Néron (@bneron) #898 (comment) - Wibowo Arindrarto (@bow) #898 (comment) - Carlos Pena (@carlosp420) #898 (comment) - Christian Brueffer (@cbrueffer) #898 (comment) - Brad Chapman (@chapmanb) http://mailman.open-bio.org/pipermail/biopython-dev/2013-July/019903.html - Connor McCoy (@cmccoy) #898 (comment) - Eric Talevich (@etal) #898 (comment) - Wayne Decatur (@fomightez) #898 (comment) - Bertrand Néron (@freeh4cker) #898 (comment) - FGastaldello (@Gasta88) #1063 - jchang (@jefftc) #898 (comment) - Uri Laserson (@laserson) #898 (comment) - Lenna Peterson (@lennax) #898 (comment) - Michiel de Hoon (@mdehoon) #898 (comment) - @morrme #1172 (comment) - Nick Negretti (@nimne) #1768 (comment) - Peter Cock (@peterjc) #898 (comment) - Shuichiro MAKIGAKI (@shuichiro-makigaki) #1370 - Travis Wrightsman (@twrightsman) #898 (comment) - Thomas Schmitt (@wurstbonbon) #898 (comment)
As original author I agree, as have all the named contributors since as tracked by version control (with one exception discussed below): - Carlos Pena (@carlosp420) biopython#898 (comment) - Chris Rands (@chris-rands) biopython#1301 - Christian Brueffer (@cbrueffer) biopython#898 (comment) - Connor McCoy (@cmccoy) biopython#898 (comment) - Dominik Luntzer (@stanti) biopython#898 (comment) - Francesco Gastaldello (@Gasta88) biopython#1063 - Jeroen Van Goey (@BioGeek) biopython#898 (comment) - lasher (@gotgenes) biopython#898 (comment) - @morrme biopython#1172 (comment) - Peter Cock (@peterjc) biopython#898 (comment) - Sergei Lebedev (@superbobry) biopython#898 (comment) - Zachary Sailer (@Zsailer) biopython#1450 The exception is Lucas Sinclair (@xapple), but their contribution was removing one line in a docstring, where the code example has since been updated.
As original author I agree, as have all the named contributors since as tracked by version control (with one exception discussed below): - Carlos Pena (@carlosp420) #898 (comment) - Chris Rands (@chris-rands) #1301 - Christian Brueffer (@cbrueffer) #898 (comment) - Connor McCoy (@cmccoy) #898 (comment) - Dominik Luntzer (@stanti) #898 (comment) - Francesco Gastaldello (@Gasta88) #1063 - Jeroen Van Goey (@BioGeek) #898 (comment) - lasher (@gotgenes) #898 (comment) - @morrme #1172 (comment) - Peter Cock (@peterjc) #898 (comment) - Sergei Lebedev (@superbobry) #898 (comment) - Zachary Sailer (@Zsailer) #1450 The exception is Lucas Sinclair (@xapple), but their contribution was removing one line in a docstring, where the code example has since been updated.
This pull request addresses issue #666. pinging @peterjc for review.
It extends the
SeqIO.writeAPI to allow writing to fasta format without line wrapping by adding afasta-nowrapoption to the format list.To implement this, I subclassed
FastaWritertoFastaNoWrapWriterand setwrap=Nonein super. Not sure if this is the best way to do this. I'm happy to change it.This doesn't update the Docs. I wanted to make sure the logic works before changing the docs.
Contributing stuff
I hereby agree to dual licence this and any previous contributions under both
the Biopython License Agreement AND the BSD 3-Clause License.
I am happy to be thanked by name in the
NEWS.rstandCONTRIB.rstfiles.I have read the
CONTRIBUTING.rstfile and understand that AppVeyor andTravisCI will be used to confirm the Biopython unit tests and
flake8stylechecks pass with these changes.