-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathq33.py
More file actions
24 lines (18 loc) · 665 Bytes
/
q33.py
File metadata and controls
24 lines (18 loc) · 665 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import sys # reference: Biopython pairwise2
from Bio import pairwise2
from Bio.pairwise2 import format_alignment
from Bio.SubsMat import MatrixInfo as matrix
matscores = matrix.blosum62
f = open("rosalind_glob.txt",'r') #To extract input from the file
inputs1 = f.read()
#print inputs
seq=inputs1.strip().split('>')
inputv = []
for s in seq:
if(s!=""):
strings=s.split()
part1=strings[0]
part2=''.join(strings[1:])
inputv.append(part2)
for i in pairwise2.align.globalds(inputv[0], inputv[1], matscores, -5, -5): # Determining the score
print(format_alignment(*i))