Spaces:
Sleeping
Sleeping
fatmacankara
commited on
Commit
·
f5285f2
1
Parent(s):
aed628b
Update code/add_3Dalignment.py
Browse files- code/add_3Dalignment.py +7 -14
code/add_3Dalignment.py
CHANGED
@@ -228,23 +228,13 @@ def get_alignments_3D(identifier, model_num, pdb_path, pdbSequence, source, chai
|
|
228 |
response.raise_for_status() # Check for a successful response
|
229 |
# Step 2: Parse the PDB file from memory
|
230 |
atoms = [i for i in response.text.split('\n') if i.startswith('ATOM')]
|
231 |
-
print('ATOMS')
|
232 |
-
print(atoms)
|
233 |
-
atoms = [i.split() for i in atoms]
|
234 |
-
atoms = [i for i in atoms if (i[2] == 'CA' and i[4] == chain)]
|
235 |
-
print('ATOMS 2')
|
236 |
-
print(atoms)
|
237 |
|
238 |
-
|
|
|
239 |
atomSequence = ''.join([threeToOne(i[3]) for i in atoms])
|
240 |
-
print('atomSequence')
|
241 |
-
print(atomSequence)
|
242 |
coords = [[i[6] ,i[7] ,i[8]] for i in atoms]
|
243 |
-
print('coords')
|
244 |
-
print(coords)
|
245 |
resnums_for_sasa = [i[5] for i in atoms]
|
246 |
-
|
247 |
-
print(resnums_for_sasa)
|
248 |
elif source == 'SWISSMODEL':
|
249 |
atomSequence = ''
|
250 |
coords = []
|
@@ -278,7 +268,10 @@ def get_alignments_3D(identifier, model_num, pdb_path, pdbSequence, source, chai
|
|
278 |
aligner.extend_gap_score = -1
|
279 |
alignments = aligner.align(pdbSequence, atomSequence)
|
280 |
alignments = (list(alignments))
|
281 |
-
|
|
|
|
|
|
|
282 |
return alignments, coords, resnums_for_sasa
|
283 |
elif mode==2:
|
284 |
atomSequence = ''
|
|
|
228 |
response.raise_for_status() # Check for a successful response
|
229 |
# Step 2: Parse the PDB file from memory
|
230 |
atoms = [i for i in response.text.split('\n') if i.startswith('ATOM')]
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
|
232 |
+
atoms = [i.split() for i in atoms]
|
233 |
+
atoms = [i for i in atoms if (i[2] == 'CA' and i[4] == chain)]
|
234 |
atomSequence = ''.join([threeToOne(i[3]) for i in atoms])
|
|
|
|
|
235 |
coords = [[i[6] ,i[7] ,i[8]] for i in atoms]
|
|
|
|
|
236 |
resnums_for_sasa = [i[5] for i in atoms]
|
237 |
+
|
|
|
238 |
elif source == 'SWISSMODEL':
|
239 |
atomSequence = ''
|
240 |
coords = []
|
|
|
268 |
aligner.extend_gap_score = -1
|
269 |
alignments = aligner.align(pdbSequence, atomSequence)
|
270 |
alignments = (list(alignments))
|
271 |
+
print('IN FUNC')
|
272 |
+
print(alignments)
|
273 |
+
print(coords)
|
274 |
+
print(resnums_for_sasa)
|
275 |
return alignments, coords, resnums_for_sasa
|
276 |
elif mode==2:
|
277 |
atomSequence = ''
|