Mercurial > repos > cpt > cpt_linear_genome_plot
diff dna_features_viewer/biotools.py @ 3:b79e98299a78 draft
planemo upload commit b9287cffb7503159debac57d68917f5d337f0c9e-dirty
author | cpt |
---|---|
date | Fri, 28 Jun 2024 03:17:21 +0000 |
parents | e923c686ead9 |
children |
line wrap: on
line diff
--- a/dna_features_viewer/biotools.py Fri Jun 28 02:21:43 2024 +0000 +++ b/dna_features_viewer/biotools.py Fri Jun 28 03:17:21 2024 +0000 @@ -34,9 +34,15 @@ return complement(sequence)[::-1] -aa_short_to_long_form_dict = { - _aa1: _aa3[0] + _aa3[1:].lower() for (_aa1, _aa3) in zip(aa1 + "*", aa3 + ["*"]) -} +if type(aa1) is str and type(aa3) is list: + aa_short_to_long_form_dict = { + _aa1: _aa3[0] + _aa3[1:].lower() for (_aa1, _aa3) in zip(aa1 + "*", aa3 + ["*"]) + } +else: + aa_short_to_long_form_dict = { + _aa1: _aa3[0] + _aa3[1:].lower() + for (_aa1, _aa3) in zip(aa1 + ("*",), aa3 + ("*",)) + } def translate(dna_sequence, long_form=False):