fatmacankara commited on
Commit
6038db7
·
1 Parent(s): 655ea6b

Update code/add_alignment.py

Browse files
Files changed (1) hide show
  1. code/add_alignment.py +16 -16
code/add_alignment.py CHANGED
@@ -11,22 +11,22 @@ def do_alignment(identifier, uniprotSequence, pdbSequence, alignment_path):
11
  print(pdbSequence)
12
  print('uniprot Seq')
13
  print(uniprotSequence)
14
- if len(pdbSequence) >= 1:
15
- #f = open(Path(alignment_path / f'{identifier}_alignment.txt'),"w")
16
- aligner.mode = 'local'
17
- aligner.substitution_matrix = substitution_matrices.load("BLOSUM62")
18
- aligner.open_gap_score = -11
19
- aligner.extend_gap_score = -1
20
- alignments = aligner.align(uniprotSequence, pdbSequence)
21
- alignments = (list(alignments))
22
- alignment_list = []
23
- for alignment in alignments:
24
- #f.write(str(alignment))
25
- #f.write('\n')
26
- #f.write('\n')
27
- alignment = (str(alignment).strip().split('\n'))
28
- alignment = [''.join(['.' if m == ' ' else m for m in x]) for x in alignment]
29
- alignment_list.append(alignment)
30
  print(alignment_list)
31
  return alignment_list
32
 
 
11
  print(pdbSequence)
12
  print('uniprot Seq')
13
  print(uniprotSequence)
14
+ #if len(pdbSequence) >= 1:
15
+ #f = open(Path(alignment_path / f'{identifier}_alignment.txt'),"w")
16
+ aligner.mode = 'local'
17
+ aligner.substitution_matrix = substitution_matrices.load("BLOSUM62")
18
+ aligner.open_gap_score = -11
19
+ aligner.extend_gap_score = -1
20
+ alignments = aligner.align(uniprotSequence, pdbSequence)
21
+ alignments = (list(alignments))
22
+ alignment_list = []
23
+ for alignment in alignments:
24
+ #f.write(str(alignment))
25
+ #f.write('\n')
26
+ #f.write('\n')
27
+ alignment = (str(alignment).strip().split('\n'))
28
+ alignment = [''.join(['.' if m == ' ' else m for m in x]) for x in alignment]
29
+ alignment_list.append(alignment)
30
  print(alignment_list)
31
  return alignment_list
32