Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. from Bio.Seq import Seq
  2. def zadanie(name):
  3. s = []
  4. file = open(name, "r").readlines()
  5. seq = ""
  6. for line in file[1:]:
  7. s += line.rstrip()
  8.  
  9. print("Ilosc par zasad to " + str(len(s)))
  10.  
  11. if len(s)/2 % 2 == 0:
  12. print("Srodkowe zasady to " + s[int(len(s)/2)] + " i " +s[int(len(s)/2+1)])
  13. else:
  14. print("Srodkowa zasada to" + s[int(len(s)/2+0.5)])
  15.  
  16. seq = Seq("".join(s))
  17. print("mRNA: " + seq.transcribe())
  18. print("Translacja: " + seq.translate())
  19. print "Ilosc alaniny:",s.count(('A'))
  20. print "Ilosc guaniny:", s.count(('G'))
  21. print "Ilosc cytozyny:", s.count(('C'))
  22. print "Ilosc tyminy:", s.count(('T'))
  23.  
  24. print "Procent cytozyny", s.count(('C'))/len(s)*100, "%"
  25. print "Bez alaniny", seq.ungap('A')
  26. zadanie("seq1.fasta")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement