Question
Write a function matching_codons(complements, pool1, pool2) that takes three arguments: a dictionary complements and two lists pool1 and pool2. The dictionary contains the base pairs,
Write a function matching_codons(complements, pool1, pool2) that takes three arguments: a dictionary complements and two lists pool1 and pool2. The dictionary contains the base pairs, and the pools each contain a list of codon sequences. Your task is to find the complementary codon sequence in pool2 for each codon sequence in pool1, and return all matching pairs in following format:
complements = {'A':'T', 'C':'G', 'T':'A', 'G':'C'}
pool1 = ['AAG', 'TAC', 'CGG', 'GAT', 'TTG', 'GTG', 'CAT', 'GGC', 'ATT', 'TCT']
pool2 = ['TAA', 'CTA', 'AAC', 'TTC', 'AGA', 'CCC', 'CCG', 'GTA']
print(matching_codons(complements, pool1, pool2))
[('AAG', 'TTC'), ('GAT', 'CTA'), ('TTG', 'AAC'), ('CAT', 'GTA'), ('GGC', 'CCG'), ('ATT', 'TAA'), ('TCT', 'AGA')]
In molecular biology, a codon refers to a substring of a DNA sequence made up of the nucleotides A, T, C and G. The nucleotide A always binds with T, and T always binds with A. A and T are referred to as "base pairs". Similarly, C and G are base pairs, that is, C always binds with G, and G always binds with C. Two codons are complementary if each of their respective nucleotides are base pairs. ?
The return value is a list of 2-tuples of codons. The first item in each tuple is a codon from pool1 and the second is the matching codon found in pool2. For example, the sequences AAG (pool1[0]) and TTC (pool2[3]) are complementary as the base pair of A is T and that of G is C. For CCG, on the other hand, the matching codon (GGC) does not occur in pool2, and it is thus not contained in the output of the function. The returned list should preserve the original order of pool1. Note that you may assume that there are no duplicate codons in pool1 or pool2.
Make sure to use the base pair information given in the complements dictionary to identify the complementary codons,
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started