Repository navigation
Fixed a table parsing bug. - #583
Conversation
|
@peterjc @tiagoantao |
|
@tiagoantao can you look at this small pull request? Even if you only have time to review it, I can do the merge. |
|
@tiagoantao does this little change make sense? Are you happy for it to be accepted as is, or does it need a test? |
|
Sorry to nag @tiagoantao, but is it OK to merge this small PR? And if so, @StuntsPT: Are you happy to dual licence your contributions under both the Biopython License Agreement AND the BSD 3-Clause License? See #898. And are you happy to be thanked by name in the |
|
That's great - I'll update #898 when we merge this. Regarding acknowledgement, this is a small but real change - but if you prefer we can leave your name off until one day you make a larger contribution. If you need a suggestion, how about adding that wiki example test case to the Biopython unit tests? ;) |
|
@tiagoantao If you don't object I propose to merge this before the next release. @StuntsPT if you could add something to the unit tests to confirm this fix, that would be even better. |
|
@peterjc I'll be on that today, it was already too late yesterday to implement unit testing. =-) |
Codecov Report
@@ Coverage Diff @@
## master #583 +/- ##
=======================================
Coverage 80.75% 80.75%
=======================================
Files 322 322
Lines 49424 49424
=======================================
Hits 39913 39913
Misses 9511 9511
Continue to review full report at Codecov.
|
|
I seem to be having some problem, since all the PopGen tests are failing here... Is this expected? python Tests/test_PopGen_GenePop.py
test_allele_genotype_frequencies (__main__.AppTest)
Test genepop execution on basic allele and genotype frequencies. ... ERROR
test_calc_diversities_fis_with_identity (__main__.AppTest)
Test calculations of diversities ... ... ERROR
test_estimate_nm (__main__.AppTest)
Test Nm estimation. ... ERROR
test_fst_all (__main__.AppTest)
Test genepop execution on all fst. ... ERROR
test_haploidy (__main__.AppTest)
Test haploidy. ... ERROR
======================================================================
ERROR: test_allele_genotype_frequencies (__main__.AppTest)
Test genepop execution on basic allele and genotype frequencies.
----------------------------------------------------------------------
Traceback (most recent call last):
File "Tests/test_PopGen_GenePop.py", line 38, in test_allele_genotype_frequencies
File "/usr/lib/python3.6/site-packages/Bio/PopGen/GenePop/Controller.py", line 553, in calc_allele_genotype_freqs
self._run_genepop(["INF"], [5, 1], fname)
File "/usr/lib/python3.6/site-packages/Bio/PopGen/GenePop/Controller.py", line 246, in _run_genepop
self.controller() # checks error level is zero
File "/usr/lib/python3.6/site-packages/Bio/Application/__init__.py", line 516, in __call__
stdout_str, stderr_str)
Bio.Application.ApplicationError: Non-zero return code 255 from 'Genepop MenuOptions=5.1 Mode=Batch InputFile=/home/francisco/Programming/github/biopython/PopGen/big.gen', message 'Unable to open file genepop.txt'
======================================================================
ERROR: test_calc_diversities_fis_with_identity (__main__.AppTest)
Test calculations of diversities ...
----------------------------------------------------------------------
Traceback (most recent call last):
File "Tests/test_PopGen_GenePop.py", line 56, in test_calc_diversities_fis_with_identity
File "/usr/lib/python3.6/site-packages/Bio/PopGen/GenePop/Controller.py", line 703, in calc_diversities_fis_with_identity
return self._calc_diversities_fis(fname, ".DIV")
File "/usr/lib/python3.6/site-packages/Bio/PopGen/GenePop/Controller.py", line 669, in _calc_diversities_fis
self._run_genepop([ext], [5, 2], fname)
File "/usr/lib/python3.6/site-packages/Bio/PopGen/GenePop/Controller.py", line 246, in _run_genepop
self.controller() # checks error level is zero
File "/usr/lib/python3.6/site-packages/Bio/Application/__init__.py", line 516, in __call__
stdout_str, stderr_str)
Bio.Application.ApplicationError: Non-zero return code 255 from 'Genepop MenuOptions=5.2 Mode=Batch InputFile=/tmp/tmp1giye7ew/PopGen/big.gen', message 'Unable to open file genepop.txt'
======================================================================
ERROR: test_estimate_nm (__main__.AppTest)
Test Nm estimation.
----------------------------------------------------------------------
Traceback (most recent call last):
File "Tests/test_PopGen_GenePop.py", line 68, in test_estimate_nm
File "/usr/lib/python3.6/site-packages/Bio/PopGen/GenePop/Controller.py", line 491, in estimate_nm
self._run_genepop(["PRI"], [4], fname)
File "/usr/lib/python3.6/site-packages/Bio/PopGen/GenePop/Controller.py", line 246, in _run_genepop
self.controller() # checks error level is zero
File "/usr/lib/python3.6/site-packages/Bio/Application/__init__.py", line 516, in __call__
stdout_str, stderr_str)
Bio.Application.ApplicationError: Non-zero return code 255 from 'Genepop MenuOptions=4 Mode=Batch InputFile=/tmp/tmpxbyrw49n/PopGen/big.gen', message 'Unable to open file genepop.txt'
======================================================================
ERROR: test_fst_all (__main__.AppTest)
Test genepop execution on all fst.
----------------------------------------------------------------------
Traceback (most recent call last):
File "Tests/test_PopGen_GenePop.py", line 76, in test_fst_all
File "/usr/lib/python3.6/site-packages/Bio/PopGen/GenePop/Controller.py", line 727, in calc_fst_all
self._run_genepop([".FST"], [6, 1], fname)
File "/usr/lib/python3.6/site-packages/Bio/PopGen/GenePop/Controller.py", line 246, in _run_genepop
self.controller() # checks error level is zero
File "/usr/lib/python3.6/site-packages/Bio/Application/__init__.py", line 516, in __call__
stdout_str, stderr_str)
Bio.Application.ApplicationError: Non-zero return code 255 from 'Genepop MenuOptions=6.1 Mode=Batch InputFile=/tmp/tmpb1ohvfhn/PopGen/c2line.gen', message 'Unable to open file genepop.txt'
======================================================================
ERROR: test_haploidy (__main__.AppTest)
Test haploidy.
----------------------------------------------------------------------
Traceback (most recent call last):
File "Tests/test_PopGen_GenePop.py", line 86, in test_haploidy
File "/usr/lib/python3.6/site-packages/Bio/PopGen/GenePop/Controller.py", line 727, in calc_fst_all
self._run_genepop([".FST"], [6, 1], fname)
File "/usr/lib/python3.6/site-packages/Bio/PopGen/GenePop/Controller.py", line 246, in _run_genepop
self.controller() # checks error level is zero
File "/usr/lib/python3.6/site-packages/Bio/Application/__init__.py", line 516, in __call__
stdout_str, stderr_str)
Bio.Application.ApplicationError: Non-zero return code 255 from 'Genepop MenuOptions=6.1 Mode=Batch InputFile=/tmp/tmp6zrluam9/PopGen/haplo.gen', message 'Unable to open file genepop.txt'
----------------------------------------------------------------------
Ran 5 tests in 0.026s
FAILED (errors=5) |
|
Could be you're not in the |
|
Yup, that's it. I really have to read the docs on |
|
In this case its a quirk of the Biopython test, which we've tried to document with a chapter in the Tutorial. |
|
Oh. In that case, that's where I'm headed. Thanks! |
|
Unit test implemented. |
|
Lovely. It won't trigger under TravisCI as we don't have the command line tool dependencies installed there. Thank you 👍 |
|
You''re welcome. |
Squashed commit of pull request biopython#583, closes biopython#582. * Fixed a table parsing bug. * Added a HWE test so that it won't happen again.
Original author Jeffrey Chang, named copyright holders, and other contributors tracked with version control have all agreed: - Andrew Dalke (@adalke) http://mailman.open-bio.org/pipermail/biopython-dev/2013-August/019941.html - Austin Varela (@austinv11) biopython#1697 - Carlos Pena (@carlosp420) biopython#898 (comment) - chrismit (@Chris7) biopython#898 (comment) - Christian Brueffer (@cbrueffer) biopython#898 (comment) - Connor T. Skennerton (@ctSkennerton) biopython#898 (comment) - Edward Liaw (@edliaw) biopython#898 (comment) - Eric Rasche (@erasche) biopython#898 (comment) - Francesco Gastaldello (@Gasta88) biopython#1063 - Francisco Pina-Martins (@StuntsPT) biopython#583 (comment) - Jacek Śmietański (@dadoskawina) biopython#898 (comment) - jchang (@jefftc) biopython#898 (comment) - João D Ferreira (@jdferreira) biopython#898 (comment) - Mark Amery (@ExplodingCabbage) biopython#2165 - Markus Piotrowski (@MarkusPiotrowski) biopython#898 (comment) - Michiel de Hoon (@mdehoon) biopython#898 (comment) - Peter Cock (@peterjc) biopython#898 (comment) - Sergei Lebedev (@superbobry) biopython#898 (comment) - Sergio Valqui (@svalqui) biopython#1749 - Sujan Dulal (@Dsujan) biopython#2430 - Travis Wrightsman (@twrightsman) biopython#898 (comment) - Yi Hsiao (@hsiaoyi0504) biopython#1869
Original author Jeffrey Chang, named copyright holders, and other contributors tracked with version control have all agreed: - Andrew Dalke (@adalke) http://mailman.open-bio.org/pipermail/biopython-dev/2013-August/019941.html - Austin Varela (@austinv11) biopython#1697 - Carlos Pena (@carlosp420) biopython#898 (comment) - chrismit (@Chris7) biopython#898 (comment) - Christian Brueffer (@cbrueffer) biopython#898 (comment) - Connor T. Skennerton (@ctSkennerton) biopython#898 (comment) - Edward Liaw (@edliaw) biopython#898 (comment) - Eric Rasche (@erasche) biopython#898 (comment) - Francesco Gastaldello (@Gasta88) biopython#1063 - Francisco Pina-Martins (@StuntsPT) biopython#583 (comment) - Jacek Śmietański (@dadoskawina) biopython#898 (comment) - jchang (@jefftc) biopython#898 (comment) - João D Ferreira (@jdferreira) biopython#898 (comment) - Mark Amery (@ExplodingCabbage) biopython#2165 - Markus Piotrowski (@MarkusPiotrowski) biopython#898 (comment) - Michiel de Hoon (@mdehoon) biopython#898 (comment) - Peter Cock (@peterjc) biopython#898 (comment) - Sergei Lebedev (@superbobry) biopython#898 (comment) - Sergio Valqui (@svalqui) biopython#1749 - Sujan Dulal (@Dsujan) biopython#2430 - Travis Wrightsman (@twrightsman) biopython#898 (comment) - Yi Hsiao (@hsiaoyi0504) biopython#1869
Original author Jeffrey Chang, named copyright holders, and other contributors tracked with version control have all agreed: - Andrew Dalke (@adalke) http://mailman.open-bio.org/pipermail/biopython-dev/2013-August/019941.html - Austin Varela (@austinv11) #1697 - Carlos Pena (@carlosp420) #898 (comment) - chrismit (@Chris7) #898 (comment) - Christian Brueffer (@cbrueffer) #898 (comment) - Connor T. Skennerton (@ctSkennerton) #898 (comment) - Edward Liaw (@edliaw) #898 (comment) - Eric Rasche (@erasche) #898 (comment) - Francesco Gastaldello (@Gasta88) #1063 - Francisco Pina-Martins (@StuntsPT) #583 (comment) - Jacek Śmietański (@dadoskawina) #898 (comment) - jchang (@jefftc) #898 (comment) - João D Ferreira (@jdferreira) #898 (comment) - Mark Amery (@ExplodingCabbage) #2165 - Markus Piotrowski (@MarkusPiotrowski) #898 (comment) - Michiel de Hoon (@mdehoon) #898 (comment) - Peter Cock (@peterjc) #898 (comment) - Sergei Lebedev (@superbobry) #898 (comment) - Sergio Valqui (@svalqui) #1749 - Sujan Dulal (@Dsujan) #2430 - Travis Wrightsman (@twrightsman) #898 (comment) - Yi Hsiao (@hsiaoyi0504) #1869
Original author Tiago Antao and other contributors since as tracked with version control have agreed: - Carlos Pena (@carlosp420) biopython#898 (comment) - Chris Rands (@chris-rands) biopython#1301 - Christian Brueffer (@cbrueffer) biopython#898 (comment) - Connor McCoy (@cmccoy) biopython#898 (comment) - Francesco Gastaldello (@Gasta88) biopython#1063 - Francisco Pina-Martins (@StuntsPT) biopython#583 (comment) - Jeremy LaBarge (@biojerm) biopython#1847 (comment) - Lenna Peterson (@lennax) biopython#898 (comment) - Michiel de Hoon (@mdehoon) biopython#898 (comment) - @morrme biopython#1172 (comment) - Nick Negretti (@nimne) biopython#1768 (comment) - Nick Semenkovich (@semenko) biopython#898 (comment) - Peter Cock (@peterjc) biopython#898 (comment) - Sergio Valqui (@svalqui) biopython#1749 - Suresh Panneerselvam (@Amrithasuresh) biopython#1575 - Tiago Antao (@tiagoantao) biopython#898 (comment) - Travis Wrightsman (@twrightsman) biopython#898 (comment)
Original author Tiago Antao and other contributors since as tracked with version control have agreed: - Carlos Pena (@carlosp420) #898 (comment) - Chris Rands (@chris-rands) #1301 - Christian Brueffer (@cbrueffer) #898 (comment) - Connor McCoy (@cmccoy) #898 (comment) - Francesco Gastaldello (@Gasta88) #1063 - Francisco Pina-Martins (@StuntsPT) #583 (comment) - Jeremy LaBarge (@biojerm) #1847 (comment) - Lenna Peterson (@lennax) #898 (comment) - Michiel de Hoon (@mdehoon) #898 (comment) - @morrme #1172 (comment) - Nick Negretti (@nimne) #1768 (comment) - Nick Semenkovich (@semenko) #898 (comment) - Peter Cock (@peterjc) #898 (comment) - Sergio Valqui (@svalqui) #1749 - Suresh Panneerselvam (@Amrithasuresh) #1575 - Tiago Antao (@tiagoantao) #898 (comment) - Travis Wrightsman (@twrightsman) #898 (comment)
Fixes #582 .