from Bio.Seq import Seq
from Bio.SeqUtils import GC
def dna(*ags, **kws):
input_seq_element = Element("input_seq")
input_seq = input_seq_element.element.value
my_seq = Seq(input_seq)
Element("seq_type").write("DNA")
Element("my_seq").write(str(my_seq))
Element("seq_length").write(str(len(my_seq)))
Element("countA").write(f'A: {str(my_seq.count("A"))}')
Element("countT").write(f'T: {str(my_seq.count("T"))}')
Element("countG").write(f'G: {str(my_seq.count("G"))}')
Element("countC").write(f'C: {str(my_seq.count("C"))}')
Element("GC").write(str(GC(my_seq)))
Element("complement").write(str(my_seq.complement()))
Element("reverse").write(str(my_seq[::-1]))
Element("reverse_complement").write(str(my_seq.reverse_complement()))
def rna(*ags, **kws):
input_seq_element = Element("input_seq")
input_seq = input_seq_element.element.value
my_seq = Seq(input_seq)
Element("seq_type").write("RNA")
Element("my_seq").write(str(my_seq))
Element("seq_length").write(str(len(my_seq)))
Element("countA").write(f'A: {str(my_seq.count("A"))}')
Element("countT").write(f'U: {str(my_seq.count("U"))}')
Element("countG").write(f'G: {str(my_seq.count("G"))}')
Element("countC").write(f'C: {str(my_seq.count("C"))}')
Element("GC").write(str(GC(my_seq)))
Element("complement").write(str(my_seq.complement()))
Element("reverse").write(str(my_seq[::-1]))
Element("reverse_complement").write(str(my_seq.reverse_complement()))
def protein(*ags, **kws):
input_seq_element = Element("input_seq")
input_seq = input_seq_element.element.value
my_seq = Seq(input_seq)
Element("seq_type").write("Protein")
Element("my_seq").write(str(my_seq))
Element("seq_length").write(str(len(my_seq)))
Element("countA").write("–")
Element("countT").write("–")
Element("countG").write("–")
Element("countC").write("–")
Element("GC").write("–")
Element("complement").write("–")
Element("reverse").write(str(my_seq[::-1]))
Element("reverse_complement").write("–")
button_dna = Element('dna')
button_dna.element.onclick = dna
button_rna = Element('rna')
button_rna.element.onclick = rna
button_rna = Element('protein')
button_rna.element.onclick = protein