Spaces:
Runtime error
Runtime error
Commit
·
a0bf679
1
Parent(s):
1a5f3ab
Update app.py
Browse files
app.py
CHANGED
@@ -26,29 +26,28 @@ def update(inp, file, mode, custom_resids, clustering_threshold):
|
|
26 |
pdb_file = file.name
|
27 |
except:
|
28 |
print("using pdbfile")
|
29 |
-
|
30 |
-
try:
|
31 |
-
pdb_file = inp
|
32 |
-
if (
|
33 |
-
re.match(
|
34 |
-
"[OPQ][0-9][A-Z0-9]{3}[0-9]|[A-NR-Z][0-9]([A-Z][A-Z0-9]{2}[0-9]){1,2}",
|
35 |
-
pdb_file,
|
36 |
-
).group()
|
37 |
-
== pdb_file
|
38 |
-
):
|
39 |
-
urllib.request.urlretrieve(
|
40 |
-
f"https://alphafold.ebi.ac.uk/files/AF-{pdb_file}-F1-model_v2.pdb",
|
41 |
-
f"files/{pdb_file}.pdb",
|
42 |
-
)
|
43 |
-
except AttributeError:
|
44 |
-
if len(inp) == 4:
|
45 |
pdb_file = inp
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
if mode == "All residues":
|
54 |
ids = get_all_protein_resids(
|
|
|
26 |
pdb_file = file.name
|
27 |
except:
|
28 |
print("using pdbfile")
|
29 |
+
try:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
pdb_file = inp
|
31 |
+
if (
|
32 |
+
re.match(
|
33 |
+
"[OPQ][0-9][A-Z0-9]{3}[0-9]|[A-NR-Z][0-9]([A-Z][A-Z0-9]{2}[0-9]){1,2}",
|
34 |
+
pdb_file,
|
35 |
+
).group()
|
36 |
+
== pdb_file
|
37 |
+
):
|
38 |
+
urllib.request.urlretrieve(
|
39 |
+
f"https://alphafold.ebi.ac.uk/files/AF-{pdb_file}-F1-model_v2.pdb",
|
40 |
+
f"files/{pdb_file}.pdb",
|
41 |
+
)
|
42 |
+
except AttributeError:
|
43 |
+
if len(inp) == 4:
|
44 |
+
pdb_file = inp
|
45 |
+
urllib.request.urlretrieve(
|
46 |
+
f"http://files.rcsb.org/download/{pdb_file.lower()}.pdb1",
|
47 |
+
f"files/{pdb_file}.pdb",
|
48 |
+
)
|
49 |
+
else:
|
50 |
+
return "pdb code must be 4 letters or Uniprot code does not match", ""
|
51 |
|
52 |
if mode == "All residues":
|
53 |
ids = get_all_protein_resids(
|