Python Programming Consensus and Print Matrix Profile Assignment
- consensus(profile): Input is a list of motifs. Output is a string corresponding to the most frequently occurring letter at each position.
- print_matrix(profile): Input is a profile of probabilities. (example below):
>>> mymotifs = [‘ACGTT’,’CCGTT’, ‘AGGTT’, ‘ACTTT’, ‘ACGAT’,’TTTTT’]
>>> my_profile = profile(mymotifs)
>>> my_profile
{‘A’: [0.6666666666666666, 0.0, 0.0, 0.16666666666666666, 0.0], ‘C’: [0.16666666666666666, 0.6666666666666666, 0.0, 0.0, 0.0], ‘G’: [0.0, 0.16666666666666666, 0.6666666666666666, 0.0, 0.0], ‘T’: [0.16666666666666666, 0.16666666666666666, 0.3333333333333333, 0.8333333333333334, 1.0]}
>>> print_matrix(my_profile)
A 0.67 0.00 0.00 0.17 0.00
C 0.17 0.67 0.00 0.00 0.00
G 0.00 0.17 0.67 0.00 0.00
T 0.17 0.17 0.33 0.83 1.00
Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."