New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removed partial codon warning when testing amino acid sequences #3307
Conversation
…t partial codon warning from appearing when testing translation error of amino acid Seq() object.
Codecov Report
@@ Coverage Diff @@
## master #3307 +/- ##
==========================================
- Coverage 83.98% 82.90% -1.09%
==========================================
Files 318 316 -2
Lines 51661 51511 -150
==========================================
- Hits 43389 42705 -684
- Misses 8272 8806 +534
Continue to review full report at Codecov.
|
I don't follow from the commit or pull request why you are changing this. If anything, it makes me wonder if there is a mistake in the tests? |
There is no mistake in the test that I see. I was just curious and running the test_seq tests when I noticed a warning,
that was being triggered by the I just thought it might make the test pass cleaner if the warning wasn't being triggered, since it seems to be aimed for codon sequences and not about the amino acids being tested. Shortening the test amino acid sequences doesn't change any of the other tests. |
From a quick inspection it looks to me the reason that the Lines 2407 to 2410 in 63ec6b5
Since we cannot distinguish between nucleic and protein sequences in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kaskales, test_translation_on_proteins
was the scope I wanted clarified. Your change makes sense to me.
@MarkusPiotrowski Since the Seq object no longer distinguishes nucleotide versus protein, a protein/peptide "AAA" can be translated just fine but "MED" fails as it does not make sense as a codon. The test motivation still makes sense to me.
Perhaps the length not a multiple of three warning should happen later in the translation (allowing the exceptions to trigger first). Also perhaps if using to_stop=True
the warning should be skipped too (if an in-frame stop is found)?
Exactly. Because protein sequences may be translatable, this test, described as "Check translation fails on a protein." doesn't make sense any longer. If the sequence was "ATG" or "MAS", the test wouldn't fail. |
OK, if |
Should I delete the |
Whichever is easier for you. |
Are there any additional changes I should make for this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Over to @MarkusPiotrowski for second opinion (and merge)?
Only changed the testing amino acid sequences so the warning isn't triggered. Amino acid sequences don't need to be divisible by 3, only codon sequences.
Trimmed three testing protein_seqs by one amino acid to prevent irrelevant partial codon warning from appearing when testing TranslationError of amino acid Seq() object.
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.rst
file, have runpre-commit
locally,and understand 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.rst
andCONTRIB.rst
as part of this pull request, am listedalready, or do not wish to be listed. (This acknowledgement is optional.)
Closes #...