Created
October 30, 2018 23:48
-
-
Save carolinecunningham/899577a89d5a6890dab0adc4ac623865 to your computer and use it in GitHub Desktop.
makes logo of DNA given original and mutated DNA sequence
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib as mpl | |
mpl.use('TkAgg') | |
import matplotlib.pyplot as plt | |
def graph_logo(ref, alt): | |
str = "" | |
for num, char in enumerate(ref): | |
if char != alt[num]: | |
discrep = alt[num] | |
d_index = num | |
for numb, charac in enumerate(alt): | |
if charac != discrep or numb != d_index: | |
str += alt[numb].lower() | |
elif d_index == numb: | |
str += discrep.upper() | |
#plt.text(0.5, 0.5, str, fontsize=24) | |
plt.text(0.5, 0.5, str, fontsize=24, color='g', weight='bold') | |
graph_logo("ctt", "ctg") | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment