Skip to content

backtrans-align breaks if any dna seq length isn't a multiple of 3 #62

@metasoarous

Description

@metasoarous

We get the following error message and stack trace:

% seqmagick backtrans-align sorted_aligned_inseqs_translation.fasta sorted_inseqs.fasta -o test.fa                                                                                                                  17-01-20 - 12:59:13
Traceback (most recent call last):
  File "/app/seqmagick/0.6.0/bin/seqmagick", line 9, in <module>
    load_entry_point('seqmagick==0.6.0', 'console_scripts', 'seqmagick')()
  ...
  File "/app/seqmagick/0.6.0/lib/python2.7/site-packages/seqmagick-0.6.0-py2.7.egg/seqmagick/subcommands/backtrans_align.py", line 108, in <genexpr>
    for codon in codons)
  File "/app/python2/2.7.8/lib/python2.7/site-packages/Bio/Data/CodonTable.py", line 304, in get
    return self.__getitem__(codon)
  ...
  File "/app/python2/2.7.8/lib/python2.7/site-packages/Bio/Data/CodonTable.py", line 185, in list_possible_proteins
    c1, c2, c3 = codon
ValueError: need more than 1 value to unpack

I can confirm that when I cut off the extra nucleotides, the back translation operates without error.

At the very least, it would seem to be worth presenting a more helpful error message. Better yet though, we could either do this trimming automatically (with a warning), or add a flag for triggering this behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions