Repository navigation
Conversation
It seems that everywhere else in this module the "alphabet" is not more an Alphabet instance, but rather a string like "ATGC". So calculate_pseudocounts should not use ``alphabet.letters``. This fixes a bug breaking calculate_pseudocounts in Biopython 1.75.
Codecov Report
@@ Coverage Diff @@
## master #2341 +/- ##
==========================================
- Coverage 84.94% 83.57% -1.37%
==========================================
Files 323 321 -2
Lines 52690 52353 -337
==========================================
- Hits 44756 43753 -1003
- Misses 7934 8600 +666
Continue to review full report at Codecov.
|
|
I'm going to rebase this to have the tests run with the latest master branch where the flake8 issue was fixed... |
|
I don't seem to be able to push - was the "allow modifications from maintainers" check box on the pull request ticked? Also, I'd really like to see a unit test for this - as simple as calling |
|
I won't have the time to update this branch but I'll post a minimal example test in case it helps. |
|
What about this for a test? from Bio import motifs
from Bio.Seq import Seq
def test_jaspar_pseudocounts():
motif = motifs.create([
Seq("ATTG"),
Seq("ATTT"),
Seq("ATTA"),
])
pseudo_counts = motifs.jaspar.calculate_pseudocounts(motif)
# pseudo_counts should be {'G': 0.433..., 'A': 0.433..., etc.}
for nucleotide in "ATGC":
assert abs(pseudo_counts[nucleotide] - 0.433) < 0.001
test_jaspar_pseudocounts() |
|
Closed in favour of #2384, but thank you! |
Was it actually closed? It still looks open. |
It seems that everywhere else in this module the "alphabet" is not more an Alphabet instance, but rather a string like "ATGC". So calculate_pseudocounts should not use
alphabet.letters. This fixes a bug breaking calculate_pseudocounts in Biopython 1.75.This pull request addresses issue #...
I hereby agree to dual licence this and any previous contributions under both
the Biopython License Agreement AND the BSD 3-Clause License.
I have read the
CONTRIBUTING.rstfile, have runflake8locally, andunderstand that AppVeyor and TravisCI will be used to confirm the Biopython unit
tests and style checks pass with these changes.
I have added my name to the alphabetical contributors listings in the files
NEWS.rstandCONTRIB.rstas part of this pull request, am listedalready, or do not wish to be listed. (This acknowledgement is optional.)