Advertisement
Azkiin

DNA Reading + Digestion site

Jun 17th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.42 KB | None | 0 0
  1. from Bio.Seq import Seq
  2. from Bio.Alphabet import IUPAC
  3.  
  4.  
  5. DNA0 = input("Plak de DNA sequentie")
  6. seq = DNA0.upper()
  7. enz0 = input("plak de enzym naam:")
  8. enz = enz0.upper()
  9.  
  10. y= seq[0]
  11. y_minus = 0
  12.  
  13. restriction_site = ""
  14. restriction_site = 0
  15. fragment = ""
  16. enz = ""
  17.  
  18.  
  19. A = DNA0.count("A")
  20. T = DNA0.count("T")
  21. C = DNA0.count("C")
  22. G = DNA0.count("G")
  23.  
  24. my_seq = Seq(DNA0, IUPAC.unambiguous_dna)
  25.  
  26. def transcribe(sequence):
  27. return sequence.replace('T', 'U')
  28.  
  29. def digestion (seq,enz):
  30. if (enz == "XBAI"): recognition_site = "TCTAGA"
  31. elif (enz == "ECORI"): recognition_site = "GAATTC"
  32. else:
  33. print("Enzym niet herkend")
  34. fragment = (seq.split(recognition_site))
  35. print("De digestie van het DNA fragment"+ enz +", De resulterende DNA fragmenten na digestie")
  36. for No_fr, i in enumerate(fragment):
  37. print(No_fr,i, end= "\n")
  38. str_regDNA0 = "(_^_)".join(map(str,fragment))
  39. str_regDNA1 = str(str_regDNA0[0:-1])
  40. print("\nHet aantal DNA fragmenten na disgestie ziet er als volgt uit")
  41. return(str_regDNA1)
  42.  
  43. def translate_rna(s):
  44. codon2aa = {"AAA": "K", "AAC": "N", "AAG": "K", "AAU": "N",
  45. "ACA": "T", "ACC": "T", "ACG": "T", "ACU": "T",
  46. "AGA": "R", "AGC": "S", "AGG": "R", "AGU": "S",
  47. "AUA": "I", "AUC": "I", "AUG": "M", "AUU": "I",
  48.  
  49. "CAA": "Q", "CAC": "H", "CAG": "Q", "CAU": "H",
  50. "CCA": "P", "CCC": "P", "CCG": "P", "CCU": "P",
  51. "CGA": "R", "CGC": "R", "CGG": "R", "CGU": "R",
  52. "CUA": "L", "CUC": "L", "CUG": "L", "CUU": "L",
  53.  
  54. "GAA": "E", "GAC": "D", "GAG": "E", "GAU": "D",
  55. "GCA": "A", "GCC": "A", "GCG": "A", "GCU": "A",
  56. "GGA": "G", "GGC": "G", "GGG": "G", "GGU": "G",
  57. "GUA": "V", "GUC": "V", "GUG": "V", "GUU": "V",
  58.  
  59. "UAA": "_", "UAC": "Y", "UAG": "_", "UAU": "T",
  60. "UCA": "S", "UCC": "S", "UCG": "S", "UCU": "S",
  61. "UGA": "_", "UGC": "C", "UGG": "W", "UGU": "C",
  62. "UUA": "L", "UUC": "F", "UUG": "L", "UUU": "F"}
  63.  
  64. l = [codon2aa.get(s[n:n + 3], 'X') for n in range(0, len(s), 3)]
  65. return "".join(l)
  66.  
  67. RNA = transcribe(DNA0)
  68.  
  69. print("De volledige sequentie is :", (A + C + T + G), "bp lang.")
  70. print("Het aantal A bp in de sequentie is :", A)
  71. print("Het aantal T bp in de sequentie is :", T)
  72. print("Het aantal C bp in de sequentie is :", C)
  73. print("Het aantal G bp in de sequentie is :", G)
  74. print("De GC ratio van de sequence is :", (G + C) / (G + C + T + A), '\n')
  75.  
  76. print("De complimentaire DNA sequentie is:")
  77. print (my_seq.complement(), '\n')
  78.  
  79. print("De reversecomplimentaire DNA sequentie is:")
  80. print(my_seq.reverse_complement(), '\n')
  81.  
  82. print("De RNA sequentie is:")
  83. print(RNA, '\n')
  84.  
  85. print("De Eiwitsequentie is:")
  86. protein = translate_rna(RNA)
  87. print(protein, '\n')
  88. print("Het aantal aminozuren van het eiwit is:")
  89. print(len(protein) - 1, '\n\n\n')
  90. print(digestion(DNA0, enz0),'\n\n\n')
  91. print("Deze software is het eigendom van Loeke van der Linden, De restrictie software is eigendom van Kevin Harrijvan")
  92. print("Deze Software kan daarom niet instaan voor de juistheid of (on)volledigheid van de gepubliceerde informatie.")
  93. print("Loeke aanvaardt geen enkele verantwoordelijkheid of aansprakelijkheid voor eventuele schade, van welke aard dan ook, die op welke wijze dan ook voortvloeit uit het gebruik")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement