Spaces:
Sleeping
Sleeping
Commit
·
056a4d7
1
Parent(s):
aae1a42
Update code/pdb_featureVector.py
Browse files- code/pdb_featureVector.py +12 -4
code/pdb_featureVector.py
CHANGED
|
@@ -262,10 +262,19 @@ def pdb(input_set, mode, impute):
|
|
| 262 |
try:
|
| 263 |
with open(Path(path_to_output_files / search/'.pdb'), "wb") as f:
|
| 264 |
st.write('WRITING TO FILE')
|
| 265 |
-
f.write(response.content)
|
| 266 |
except:
|
| 267 |
-
st.write('
|
| 268 |
st.write(f"PDB file {search}.pdb downloaded successfully.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 269 |
else:
|
| 270 |
st.write('Here2')
|
| 271 |
st.write(f"Failed to retrieve PDB file for {search}.")
|
|
@@ -273,8 +282,7 @@ def pdb(input_set, mode, impute):
|
|
| 273 |
existing_pdb = list(Path(path_to_output_files / 'pdb_structures').glob("*"))
|
| 274 |
st.write('existing_pdb3', existing_pdb)
|
| 275 |
|
| 276 |
-
|
| 277 |
-
|
| 278 |
|
| 279 |
resolution_method = parser.get_structure(search, file)
|
| 280 |
for record in SeqIO.parse(file, "pdb-seqres"):
|
|
|
|
| 262 |
try:
|
| 263 |
with open(Path(path_to_output_files / search/'.pdb'), "wb") as f:
|
| 264 |
st.write('WRITING TO FILE')
|
|
|
|
| 265 |
except:
|
| 266 |
+
st.write('ERROR')
|
| 267 |
st.write(f"PDB file {search}.pdb downloaded successfully.")
|
| 268 |
+
|
| 269 |
+
|
| 270 |
+
from huggingface_hub import HfApi
|
| 271 |
+
api = HfApi()
|
| 272 |
+
api.upload_file(
|
| 273 |
+
path_or_fileobj=response.content,
|
| 274 |
+
path_in_repo="out_files/pdb/pdb_structures/",
|
| 275 |
+
repo_id="HUBioDataLab/ASCARIS",
|
| 276 |
+
repo_type="space")
|
| 277 |
+
|
| 278 |
else:
|
| 279 |
st.write('Here2')
|
| 280 |
st.write(f"Failed to retrieve PDB file for {search}.")
|
|
|
|
| 282 |
existing_pdb = list(Path(path_to_output_files / 'pdb_structures').glob("*"))
|
| 283 |
st.write('existing_pdb3', existing_pdb)
|
| 284 |
|
| 285 |
+
|
|
|
|
| 286 |
|
| 287 |
resolution_method = parser.get_structure(search, file)
|
| 288 |
for record in SeqIO.parse(file, "pdb-seqres"):
|