Spaces:
Sleeping
Sleeping
Commit
·
3dac5fe
1
Parent(s):
91a89e3
Update code/add_3Dalignment.py
Browse files- code/add_3Dalignment.py +0 -6
code/add_3Dalignment.py
CHANGED
@@ -215,10 +215,7 @@ def get_coords(annot, alignments, coords, resnums_for_sasa, mode):
|
|
215 |
|
216 |
|
217 |
def get_alignments_3D(identifier, model_num, pdb_path, pdbSequence, source, chain, pdbID, mode, path_3D_alignment,file_format = 'gzip'):
|
218 |
-
st.write('PDB SEW IN FN')
|
219 |
-
|
220 |
pdbSequence = convert_non_standard_amino_acids(pdbSequence)
|
221 |
-
st.write(pdbSequence)
|
222 |
if mode == 1:
|
223 |
if source == 'PDB':
|
224 |
# Step 1: Fetch the PDB file
|
@@ -277,13 +274,11 @@ def get_alignments_3D(identifier, model_num, pdb_path, pdbSequence, source, chai
|
|
277 |
|
278 |
return alignments, coords, resnums_for_sasa
|
279 |
elif mode==2:
|
280 |
-
st.write('Hello I am in 3Dalignment')
|
281 |
|
282 |
atomSequence = ''
|
283 |
coords = []
|
284 |
resnums_for_sasa = []
|
285 |
if file_format == 'txt':
|
286 |
-
st.write('Hello I am in 3Dalignment TXT')
|
287 |
with open(name, encoding="utf8") as f:
|
288 |
for line in f.readlines():
|
289 |
if line[0:4].strip() == 'ATOM' and line[13:15].strip() == 'CA':
|
@@ -295,7 +290,6 @@ def get_alignments_3D(identifier, model_num, pdb_path, pdbSequence, source, chai
|
|
295 |
coords.append([line[31:38].strip(), line[39:46].strip(), line[47:54].strip()])
|
296 |
resnums_for_sasa.append(line[22:26].strip())
|
297 |
elif file_format == 'gzip':
|
298 |
-
st.write('Hello I am in 3Dalignment GZIP')
|
299 |
with gzip.open(pdb_path, mode='rb') as f:
|
300 |
for line in f:
|
301 |
line = line.decode()
|
|
|
215 |
|
216 |
|
217 |
def get_alignments_3D(identifier, model_num, pdb_path, pdbSequence, source, chain, pdbID, mode, path_3D_alignment,file_format = 'gzip'):
|
|
|
|
|
218 |
pdbSequence = convert_non_standard_amino_acids(pdbSequence)
|
|
|
219 |
if mode == 1:
|
220 |
if source == 'PDB':
|
221 |
# Step 1: Fetch the PDB file
|
|
|
274 |
|
275 |
return alignments, coords, resnums_for_sasa
|
276 |
elif mode==2:
|
|
|
277 |
|
278 |
atomSequence = ''
|
279 |
coords = []
|
280 |
resnums_for_sasa = []
|
281 |
if file_format == 'txt':
|
|
|
282 |
with open(name, encoding="utf8") as f:
|
283 |
for line in f.readlines():
|
284 |
if line[0:4].strip() == 'ATOM' and line[13:15].strip() == 'CA':
|
|
|
290 |
coords.append([line[31:38].strip(), line[39:46].strip(), line[47:54].strip()])
|
291 |
resnums_for_sasa.append(line[22:26].strip())
|
292 |
elif file_format == 'gzip':
|
|
|
293 |
with gzip.open(pdb_path, mode='rb') as f:
|
294 |
for line in f:
|
295 |
line = line.decode()
|