-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWeek1-ProtienSequence-GlobalAlignment.py
66 lines (53 loc) · 4.12 KB
/
Week1-ProtienSequence-GlobalAlignment.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 29 14:38:00 2018
@author: KanzaBatool
"""
from Bio import pairwise2
from Bio.pairwise2 import format_alignment
from Bio.Seq import Seq
#bring dna sequence into our main code to keep things clean
dna = "GGTTCCGTGATGCACAGCTCCTTGGTTTTAATGAGTGTTTGTGAATGCAGTTGGTGAAGAACTCAGGCGAGCAGAGGCAATTGTGGACACCCCTACAGAAACGTCCTATACCCATGTGGCAATGCTCTGAAGAATAGCAGGGACCTCAGGAATGTCTATGGCCATACAATGACTAAACCAAATTCCCTCATCTTCTACTGTATCATTGTTTTAGGACTGACACTTATGAAAATCCAATTATCTGAGGAATGTGAGCTTATCATAAAGAGGCCAAACGCAAACCTTACCAGAGTGCCCAAGGACCTACCCTTGCAAACAACTACTTTAGATCTATCACAAAACAATATATCTGAGCTTCAGACTTCTGACATCCTCTCATTGTCCAAGCTGAGGGTCCTGATAATGTCCTACAACAGACTCCAGTATCTTAATATCAGTGTTTTCAAATTCAACACAGAGCTGGAATATTTGGATTTGTCCCACAATGAGCTAAAGGTGATCTTGTGCCACCCAACAGTCAGCCTCAAGCATTTGGACCTCTCCTTTAATGCCTTTGATGCCCTGCCTATATGCAAAGAATTTGGCAACATGTCCCAACTACAGTTCCTGGGGTTGAGCGGTTCTCGGGTACAAAGTTCAAGTGTGCAGCTGATTGCTCATTTGAACATCAGTAAGGTTTTGCTGGTGTTAGGAGATGCTTATGGGGAAAAAGAAGACCCCGAATCTCTTCGGCACGTTAGCACTGAGACTCTGCATATTGTTTTCCCGTCGAAAAGAGAATTCCGTTTTCTTCTGGATGTGTCCGTCAGCACTACGATCGGTTTGGAACTGTCTAACATCAAGTGTGTGCTTGAAGACCAGGGCTGCTCTTATTTCTTACGTGCTTTGTCAAAGCTTGGAAAGAATCTGAAGCTCTCAAATCTTACCCTGAACAATGTGGAAACAACGTGGAATTCCTTCATTAATATCCTCCAGATAGTTTGGCATACGCCAGTCAAATATTTCTCAATTTCAAATGTGAAGCTACAAGGTCAACTTGCCTTCAGGATGTTCAATTATTCTGACACTTCTCTGAAGGCTTTGTCGATACATCAAGTTGTCACTGATGTCTTCAGCTTCCCCCAAAGTTACATATACAGTATCTTTGCCAATATGAACATCCAAAACTTTACAATGTCTGGAACACACATGGTCCACATGCTGTGCCCGTCCCAAGTTAGCCCATTTCTGCATGTGGACTTTACAGATAACCTTTTAACAGACATGGTTTTTAAAGACTGTAGAAACTTAGTTAGATTGAAAACACTTAGTTTACAAAAGAATCAGTTAAAAAACCTTGAGAATATAATCCTCACATCTGCAAAGATGACATCCCTACAAAAACTAGACATTAGCCAGAATTCTCTAAGGTACAGCGATGGGGGAATCCCATGCGCCTGGACCCAGAGTTTGTTAGTTTTAAATTTGTCTTCGAATATGCTTACAGGCTCTGTCTTCAGATGCTTACCTCCCAAAGTCAAGGTCCTTGACCTTCACAACAACAGGATAATGAGCATCCCTAAAGATGTCACCCACCTGCAGGCTTTGCAGGAACTCAATGTAGCATCCAACTCCTTAACTGACCTTCCTGGGTGCGGGGCCTTCAGCAGCCTTTCTGTGCTGGTCATCGACCATAACTCAGTTTCCCATCCCTCTGAGGATTTCTTCCAGAGCTGTCAGAATATTAGATCCCTAACAGCGGGAAACAACCCATTCCAATGCACATGTGAGCTGAGGGACTTTGTCAAGAACATAGGCTGGGTAGCAAGAGAAGTGGTGGAGGGCTGGCCTGACTCTTACAGGTGTGACTACCCAGAAAGCTCTAGGGGAACTGCACTGAGGGACTTCCACATGTCTCCACTATCCTGTGATACTGTTCTGCTGACTGTCACCATCGGGGCCACTATGCTGGTGCTGGCTGTCACTGGGGCTTTCCTCTGTCTCTACTTTGACCTGCCCTGGTATGTGAGGATGCTGTGTCAGTGGACACAGACCAGGCACAGGGCCAGGCACATCCCCTTAGAGGAACTCCAGAGAAACCTCCAGTTCCATGCTTTTGTCTCATACAGTGGGCATGATTCTGCCTGGGTGAAGAACGAATTACTACCCAACCTAGAGAAAGATGACATCCAGATTTGCCTCCATGAGAGGAACTTTGTCCCTGGCAAGAGCATTGTGGAGAACATCATCAATTTCATTGAGAAGAGTTACAAGTCCATCTTTGTGCTGTCTCCCCACTTCATCCAGAGTGAGTGGTGTCATTATGAACTCTATTTTGCCCATCACAATCTCTTCCATGAAGGCTCTGATAACTTAATCCTCATCTTGCTGGCACCCATTCCCCAGTACTCCATCCCTACCAATTACCACAAGCTCAAAACTCTCATGTCACGAAGGACCTATCTGGAATGGCCCACAGAGAAGAACAAGCATGGACTTTTTTGGGCAAACCTAAGAGCATCCATTAATGTTAAGCTGGTTAACCAGGCAGAAGGAACGTGTTACACACAGCAATAAGAATATCCACC"
def loop():
coding_dna = Seq(dna)
orf1 = coding_dna.translate()
print ("**********************ORF1***********************")
print (orf1)
print ("\n\n")
coding_dna = Seq(dna[1:])
orf2 = coding_dna.translate()
print ("**********************ORF2***********************")
print (orf2)
print ("\n\n")
coding_dna = Seq(dna[2:])
orf3 = coding_dna.translate()
print ("**********************ORF3***********************")
print (orf3)
print ("\n\n")
coding_dna = Seq(dna)
coding_dna_reverse_comp = coding_dna.reverse_complement()
orf4 = coding_dna_reverse_comp.translate()
print ("**********************ORF4***********************")
print (orf4)
print ("\n\n")
coding_dna = Seq(dna[:-1])
coding_dna_reverse_comp = coding_dna.reverse_complement()
orf5 = coding_dna_reverse_comp.translate()
print ("**********************ORF5***********************")
print (orf5)
print ("\n\n")
coding_dna = Seq(dna[:-2])
coding_dna_reverse_comp = coding_dna.reverse_complement()
orf6 = coding_dna_reverse_comp.translate()
print ("**********************ORF6***********************")
print (orf6)
print ("\n\n")
def match():
String1 = 'ACCGTTTTTTACACAC'
String2 = 'ACGACACGTAC'
alignments = pairwise2.align.globalxx(String1, String2)
print(format_alignment(*alignments[0]))
def main():
loop()
match()
main()