0% found this document useful (0 votes)
50 views

Q1 a Write a program to construct a dot plot for the alignment of human and chicken+haemoglobin β chain. Identify the segments, which are same in both sequences

The following dot plot identifies segments of the human and chicken haemoglobin β chain sequences that are identical. Several identical segments are identified between the two sequences.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Q1 a Write a program to construct a dot plot for the alignment of human and chicken+haemoglobin β chain. Identify the segments, which are same in both sequences

The following dot plot identifies segments of the human and chicken haemoglobin β chain sequences that are identical. Several identical segments are identified between the two sequences.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Q1 a Write a program to construct a dot plot for the alignment of human and

chicken+haemoglobin β chain. Identify the segments, which are same in both sequences.

M V H W T A E E K Q L I T G L W G K V N V A E C G A E A L A R L L I V Y P W T Q R F F A S F G N L S S P T A I L G N P M V R A H G K K V L T S F G D A V K N L D N I K N T F S Q L S E L H C D K L H V D P E N F R L L G D I L I I V L A A H F S K D F T P E C Q A A W Q K L V R V V A H A L A R K Y H
M . .
V . . . . . . . . . . . .
H . . . . . . .
L . . . . . . . . . . . . . . . . . .
T . . . . . . .
P . . . . .
E . . . . . . .
E . . . . . . .
K . . . . . . . . . .
S . . . . . . .
A . . . . . . . . . . . . . . .
V . . . . . . . . . . .
T . . . . . . .
A . . . . . . . . . . . . . . .
L . . . . . . . . . . . . . . . . .
W . . .
G . . . . . . .
K . . . . . . . . . .
V . . . . . . . . . . . .
N . . . . . . .
V . . . . . . . . . . . .
D . . . . . .
E . . . . . . .
V . . . . . . . . .
G . . . . . . .
G . . . . . .
E . . . . . . .
A . . . . . . . . . . . . .
L . . . . . . . . . . . . . . . . .
G . . . . . .
R . . . . . .
L . . . . . . . . . . . . . . . . .
L . . . . . . . . . . . . . . . . .
V . . . . . . . . .
V . . . . . . . . . . . .
Y . .
P . . . . .
W . . .
T . . . . . . .
Q . . . .
R . . . . . .
F . . . . . . . .
F . . . . . . . .
E . . .
S . . . . . . .
F . . . . . . . .
G . . . . . . .
D . . . . . .
L . . . . . . . . . . . . . . . . .
S . . . . . . .
T . . . .
P . . . . .
D . . . . . .
A . . . . . . . . . . .
V . . . . . . . .
M .
G . . . . . . .
N . . . . . .
P . . . . .
K . . . . . . . .
V . . . . . . . . . . . .
K . . . . . . . .
A . . . . . . . . . . .
H . . . . . . .
G . . . . . . .
K . . . . . . . . . .
K . . . . . . . . . .
V . . . . . . . . . . . .
L . . . . . . . . . . . . . . . .
G . .
A . . . . . . . .
F . . . . . . . .
S . . .
D . . . . . .
G . .
L . . . . . . . . . .
A . . . . . . .
H . . . . .
L . . . . . . . . . . . . . . . .
D . . . . . .
N . . . . .
L . . . . . . . . .
K . . . . . . . . .
G .
T . . . . .
F . . . . . . . .
A . . . . . . .
T .
L . . . . . . . . . . . . . . . .
S . . . .
E . . . . . . .
L . . . . . . . . . . . . . . . .
H . . . . . . .
C . .
D . . . . . .
K . . . . . . . . .
L . . . . . . . . . . . . . . . .
H . . . . . . .
V . . . . . . . . . . .
D . . . . . .
P . . . . .
E . . . . . . .
N . . . .
F . . . . . . . .
R . . . . .
L . . . . . . . . . . . . . . . .
L . . . . . . . . . . . . . . . .
G . . . . . .
N .
V . . . .
L . . . . . . . . . . . . . . . .
V . . . .
C .
V . . . . . . . . . . .
L . . . . . . . . . . . . . . . .
A . . . . . . . . . .
H . . .
H . . . . . . .
F . . . . . . . .
G .
K . . . . . . . . .
E .
F . . . . . . . .
T . . . . .
P . . . . .
P
V . . .
Q . . .
A . . . . . . . . .
A . . . . . . . . .
Y .
Q . . .
K . . . . . . . . .
V . . . .
V . . . . . . . . . . .
A . . .
G
V . . . . . . . . . .
A . . . . . . . . .
N .
A . . . . . . . . .
L . . . . . . . . . . . . . . .
A . . . . . . . . .
H .
K . . . . . . . . .
Y . .
H . . . . . .
Segments which are same in both sequence
MVH (1 to 3)*
EEK (7 to 9)*
LWGKVNV (15 to 21)
VYPWTQRFF (35 to 43)
AHGKKVL (63 to 69)
LSELHCDKLHVDPENFRLLG (89 to 108)

b. Construct the dot plot manually for the residues 1-20 and verify with the plot
obtained using program
> Verified and found similarity between program and manual plot
2.Calculate the score for the following alignments using code:
AATCTATA
AAG--ATA

AATCTATA
AAG--ATA
Q 3
=5*(1) +2(-1) + 1 (-2)= 1
The alignment score manually is 1 which verifies the code.

Q4 Using the Needleman and Wunsch dynamic programming method, construct


the partial alignment score table and align the following two sequences
(using code):
ACAGTCGAACG and ACCGTCCG

# define the sequences


seq1 = "ACAGTCGAACG"
seq2 = "ACCGTCCG"

# define the scoring parameters


match_score = 2
mismatch_score = -1
gap_penalty = -2

# create the score matrix


score_matrix = [[0 for j in range(len(seq2) + 1)] for i in range(len(seq1)
+ 1)]

# initialize the first row and column of the score matrix


for i in range(len(seq1) + 1):
score_matrix[i][0] = i * gap_penalty
for j in range(len(seq2) + 1):
score_matrix[0][j] = j * gap_penalty

# fill in the rest of the score matrix using dynamic programming


for i in range(1, len(seq1) + 1):
for j in range(1, len(seq2) + 1):
match = score_matrix[i-1][j-1] + (match_score if seq1[i-1] ==
seq2[j-1] else mismatch_score)
delete = score_matrix[i-1][j] + gap_penalty
insert = score_matrix[i][j-1] + gap_penalty
score_matrix[i][j] = max(match, delete, insert)
# initialize the indices to the bottom-right corner of the score matrix
i, j = len(seq1), len(seq2)

# initialize the aligned sequences as empty strings


aligned_seq1 = ""
aligned_seq2 = ""

# backtrack through the score matrix to obtain the aligned sequences


while i > 0 or j > 0:
if i > 0 and j > 0 and score_matrix[i][j] == score_matrix[i-1][j-1] +
(match_score if seq1[i-1] == seq2[j-1] else mismatch_score):
aligned_seq1 = seq1[i-1] + aligned_seq1
aligned_seq2 = seq2[j-1] + aligned_seq2
i -= 1
j -= 1
elif i > 0 and score_matrix[i][j] == score_matrix[i-1][j] +
gap_penalty:
aligned_seq1 = seq1[i-1] + aligned_seq1
aligned_seq2 = "-" + aligned_seq2
i -= 1
else:
aligned_seq1 = "-" + aligned_seq1
aligned_seq2 = seq2[j-1] + aligned_seq2
j -= 1

# print the aligned sequences


print("Aligned Sequence 1: " + aligned_seq1)
print("Aligned Sequence 2: " + aligned_seq2)

Output
Q 5

Maximum score is 7

You might also like