Mercurial > repos > cpt > cpt_linear_genome_plot
comparison 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 |
comparison
equal
deleted
inserted
replaced
2:b36bdd17d99a | 3:b79e98299a78 |
---|---|
32 Uses BioPython for speed. | 32 Uses BioPython for speed. |
33 """ | 33 """ |
34 return complement(sequence)[::-1] | 34 return complement(sequence)[::-1] |
35 | 35 |
36 | 36 |
37 aa_short_to_long_form_dict = { | 37 if type(aa1) is str and type(aa3) is list: |
38 _aa1: _aa3[0] + _aa3[1:].lower() for (_aa1, _aa3) in zip(aa1 + "*", aa3 + ["*"]) | 38 aa_short_to_long_form_dict = { |
39 } | 39 _aa1: _aa3[0] + _aa3[1:].lower() for (_aa1, _aa3) in zip(aa1 + "*", aa3 + ["*"]) |
40 } | |
41 else: | |
42 aa_short_to_long_form_dict = { | |
43 _aa1: _aa3[0] + _aa3[1:].lower() | |
44 for (_aa1, _aa3) in zip(aa1 + ("*",), aa3 + ("*",)) | |
45 } | |
40 | 46 |
41 | 47 |
42 def translate(dna_sequence, long_form=False): | 48 def translate(dna_sequence, long_form=False): |
43 """Translate the DNA sequence into an amino-acids sequence MLKYQT... | 49 """Translate the DNA sequence into an amino-acids sequence MLKYQT... |
44 | 50 |