Use the list of sequence ["ATATCCG", "TCCG", "ATGTACTG", "ATGGCTG", "ATCA"] as an example, write a program that finds the sequence with the highest GC content (the percentage of G and C nucleotides) among a list of sequences. The program prints the sequence and its GC content. Using python, thanks!
def gc_percentage(dna): count = 0 for ch in dna: if ch in "GC": count += 1 return (count * 100) / len(data) data = ["ATATCCG", "TCCG", "ATGTACTG", "ATGGCTG", "ATCA"] max_gc_index = 0 for i in range(len(data)): if gc_percentage(data[i]) > gc_percentage(data[max_gc_index]): max_gc_index = i print("sequence with maximum GC content is " + data[max_gc_index]) print("It's GC percentage is " + str(gc_percentage(data[max_gc_index])))
Get Answers For Free
Most questions answered within 1 hours.