Spaces:
Sleeping
Sleeping
Commit
·
2d335db
1
Parent(s):
af56dfe
Update code/add_3Dalignment.py
Browse files- code/add_3Dalignment.py +4 -14
code/add_3Dalignment.py
CHANGED
|
@@ -10,13 +10,13 @@ from Bio import Align
|
|
| 10 |
import gzip
|
| 11 |
from pathlib import Path
|
| 12 |
from Bio.Align import substitution_matrices
|
|
|
|
| 13 |
aligner = Align.PairwiseAligner()
|
| 14 |
import requests
|
| 15 |
from Bio.PDB import PDBParser, PPBuilder
|
| 16 |
from io import StringIO
|
| 17 |
|
| 18 |
|
| 19 |
-
from Bio.PDB.Polypeptide import *
|
| 20 |
|
| 21 |
|
| 22 |
def convert_non_standard_amino_acids(sequence):
|
|
@@ -260,13 +260,7 @@ def get_alignments_3D(identifier, model_num, pdb_path, pdbSequence, source, chai
|
|
| 260 |
atomSequence += threeToOne(line[17:20].strip())
|
| 261 |
coords.append([line[31:38].strip(), line[39:46].strip(), line[47:54].strip()])
|
| 262 |
resnums_for_sasa.append(line[22:26].strip())
|
| 263 |
-
|
| 264 |
-
print('atomSequence')
|
| 265 |
-
print(atomSequence)
|
| 266 |
-
print('coords')
|
| 267 |
-
print(coords)
|
| 268 |
-
print('resnums_for_sasa')
|
| 269 |
-
print(resnums_for_sasa)
|
| 270 |
aligner.mode = 'local'
|
| 271 |
aligner.substitution_matrix = substitution_matrices.load("BLOSUM62")
|
| 272 |
aligner.open_gap_score = -11
|
|
@@ -275,14 +269,10 @@ def get_alignments_3D(identifier, model_num, pdb_path, pdbSequence, source, chai
|
|
| 275 |
|
| 276 |
|
| 277 |
atomSequence = convert_non_standard_amino_acids(atomSequence)
|
| 278 |
-
|
| 279 |
-
print(pdbSequence)
|
| 280 |
-
print(atomSequence)
|
| 281 |
-
print(aligner.align(pdbSequence, atomSequence))
|
| 282 |
alignments = aligner.align(pdbSequence, atomSequence)
|
| 283 |
alignments = (list(alignments))
|
| 284 |
-
|
| 285 |
-
print(alignments)
|
| 286 |
return alignments, coords, resnums_for_sasa
|
| 287 |
elif mode==2:
|
| 288 |
atomSequence = ''
|
|
|
|
| 10 |
import gzip
|
| 11 |
from pathlib import Path
|
| 12 |
from Bio.Align import substitution_matrices
|
| 13 |
+
from Bio.PDB.Polypeptide import *
|
| 14 |
aligner = Align.PairwiseAligner()
|
| 15 |
import requests
|
| 16 |
from Bio.PDB import PDBParser, PPBuilder
|
| 17 |
from io import StringIO
|
| 18 |
|
| 19 |
|
|
|
|
| 20 |
|
| 21 |
|
| 22 |
def convert_non_standard_amino_acids(sequence):
|
|
|
|
| 260 |
atomSequence += threeToOne(line[17:20].strip())
|
| 261 |
coords.append([line[31:38].strip(), line[39:46].strip(), line[47:54].strip()])
|
| 262 |
resnums_for_sasa.append(line[22:26].strip())
|
| 263 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 264 |
aligner.mode = 'local'
|
| 265 |
aligner.substitution_matrix = substitution_matrices.load("BLOSUM62")
|
| 266 |
aligner.open_gap_score = -11
|
|
|
|
| 269 |
|
| 270 |
|
| 271 |
atomSequence = convert_non_standard_amino_acids(atomSequence)
|
| 272 |
+
|
|
|
|
|
|
|
|
|
|
| 273 |
alignments = aligner.align(pdbSequence, atomSequence)
|
| 274 |
alignments = (list(alignments))
|
| 275 |
+
|
|
|
|
| 276 |
return alignments, coords, resnums_for_sasa
|
| 277 |
elif mode==2:
|
| 278 |
atomSequence = ''
|