Spaces:
Sleeping
Sleeping
Commit
·
6e8a869
1
Parent(s):
86c44a0
Update code/pdb_featureVector.py
Browse files- code/pdb_featureVector.py +12 -8
code/pdb_featureVector.py
CHANGED
|
@@ -223,16 +223,18 @@ def pdb(input_set, mode, impute):
|
|
| 223 |
shutil.rmtree('obsolete')
|
| 224 |
except OSError as e:
|
| 225 |
pass
|
| 226 |
-
existing_pdb = list(Path(path_to_output_files / 'pdb_structures').glob("*"))
|
| 227 |
-
st.write('existing_pdb')
|
| 228 |
-
st.write(existing_pdb)
|
| 229 |
-
existing_pdb = [str(i) for i in existing_pdb]
|
| 230 |
-
existing_pdb = [i.split('/')[-1].split('.')[0].lower() for i in existing_pdb]
|
| 231 |
cnt = 0
|
| 232 |
st.write('this is the pdbs', pdbs)
|
| 233 |
for search in pdbs:
|
| 234 |
st.write('searching for pdb:', search)
|
| 235 |
try:
|
|
|
|
|
|
|
| 236 |
path_pdb = 'out_files/pdb/pdb_structures'
|
| 237 |
st.write('path for pdb: ', path_pdb)
|
| 238 |
file = pdbl.retrieve_pdb_file(search, pdir=path_pdb, file_format="pdb")
|
|
@@ -265,7 +267,7 @@ def pdb(input_set, mode, impute):
|
|
| 265 |
# st.write('ERROR')
|
| 266 |
|
| 267 |
|
| 268 |
-
|
| 269 |
from huggingface_hub import Hf
|
| 270 |
api = HfApi()
|
| 271 |
st.write('api', API)
|
|
@@ -276,7 +278,7 @@ def pdb(input_set, mode, impute):
|
|
| 276 |
repo_id="HUBioDataLab/ASCARIS",
|
| 277 |
repo_type="space")
|
| 278 |
st.write(f"PDB file {search}.pdb downloaded successfully.")
|
| 279 |
-
|
| 280 |
|
| 281 |
# Aug 23
|
| 282 |
content = response.content.decode("utf-8") # Decode the content if it's not already a string
|
|
@@ -298,7 +300,7 @@ def pdb(input_set, mode, impute):
|
|
| 298 |
existing_pdb = list(Path(path_to_output_files / 'pdb_structures').glob("*"))
|
| 299 |
st.write('existing_pdb3', existing_pdb)
|
| 300 |
|
| 301 |
-
|
| 302 |
|
| 303 |
resolution_method = parser.get_structure(search, file)
|
| 304 |
for record in SeqIO.parse(file, "pdb-seqres"):
|
|
@@ -319,6 +321,8 @@ def pdb(input_set, mode, impute):
|
|
| 319 |
pdb_info.at[index, 'resolution'] = 'nan'
|
| 320 |
cnt += 1
|
| 321 |
print()
|
|
|
|
|
|
|
| 322 |
print('PDB file processing finished..')
|
| 323 |
for filename in list(Path(path_to_output_files / 'pdb_structures').glob("*")):
|
| 324 |
try:
|
|
|
|
| 223 |
shutil.rmtree('obsolete')
|
| 224 |
except OSError as e:
|
| 225 |
pass
|
| 226 |
+
#existing_pdb = list(Path(path_to_output_files / 'pdb_structures').glob("*"))
|
| 227 |
+
#st.write('existing_pdb')
|
| 228 |
+
#st.write(existing_pdb)
|
| 229 |
+
#existing_pdb = [str(i) for i in existing_pdb]
|
| 230 |
+
#existing_pdb = [i.split('/')[-1].split('.')[0].lower() for i in existing_pdb]
|
| 231 |
cnt = 0
|
| 232 |
st.write('this is the pdbs', pdbs)
|
| 233 |
for search in pdbs:
|
| 234 |
st.write('searching for pdb:', search)
|
| 235 |
try:
|
| 236 |
+
file = pdb_list.retrieve_pdb_file(search, file_format="pdb")
|
| 237 |
+
"""
|
| 238 |
path_pdb = 'out_files/pdb/pdb_structures'
|
| 239 |
st.write('path for pdb: ', path_pdb)
|
| 240 |
file = pdbl.retrieve_pdb_file(search, pdir=path_pdb, file_format="pdb")
|
|
|
|
| 267 |
# st.write('ERROR')
|
| 268 |
|
| 269 |
|
| 270 |
+
|
| 271 |
from huggingface_hub import Hf
|
| 272 |
api = HfApi()
|
| 273 |
st.write('api', API)
|
|
|
|
| 278 |
repo_id="HUBioDataLab/ASCARIS",
|
| 279 |
repo_type="space")
|
| 280 |
st.write(f"PDB file {search}.pdb downloaded successfully.")
|
| 281 |
+
|
| 282 |
|
| 283 |
# Aug 23
|
| 284 |
content = response.content.decode("utf-8") # Decode the content if it's not already a string
|
|
|
|
| 300 |
existing_pdb = list(Path(path_to_output_files / 'pdb_structures').glob("*"))
|
| 301 |
st.write('existing_pdb3', existing_pdb)
|
| 302 |
|
| 303 |
+
"""
|
| 304 |
|
| 305 |
resolution_method = parser.get_structure(search, file)
|
| 306 |
for record in SeqIO.parse(file, "pdb-seqres"):
|
|
|
|
| 321 |
pdb_info.at[index, 'resolution'] = 'nan'
|
| 322 |
cnt += 1
|
| 323 |
print()
|
| 324 |
+
st.write()
|
| 325 |
+
st.write(pdb_info)
|
| 326 |
print('PDB file processing finished..')
|
| 327 |
for filename in list(Path(path_to_output_files / 'pdb_structures').glob("*")):
|
| 328 |
try:
|