Spaces:
Sleeping
Sleeping
fatmacankara
commited on
Commit
·
5f06ca7
1
Parent(s):
699a8e2
Update code/pdb_featureVector.py
Browse files- code/pdb_featureVector.py +9 -12
code/pdb_featureVector.py
CHANGED
@@ -191,13 +191,11 @@ def pdb(input_set, mode, impute):
|
|
191 |
|
192 |
for prot in protein:
|
193 |
pdbs.append(get_pdb_ids(prot))
|
194 |
-
print('PDBs', pdbs)
|
195 |
if len(pdbs) >= 1:
|
196 |
-
print('pdbs not empty')
|
197 |
pdbs = [item for sublist in pdbs for item in sublist]
|
198 |
-
print('
|
199 |
else:
|
200 |
-
print('
|
201 |
pdbs = []
|
202 |
print('Processing PDB structures...\n')
|
203 |
if pdbs == []:
|
@@ -218,14 +216,13 @@ def pdb(input_set, mode, impute):
|
|
218 |
cnt = 0
|
219 |
st.write('this is the pdbs', pdbs)
|
220 |
def fetch_uniprot_ids(pdb_code):
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
return []
|
229 |
for search in pdbs:
|
230 |
# Step 1: Fetch the PDB file
|
231 |
pdb_url = f"https://files.rcsb.org/download/{search}.pdb"
|
|
|
191 |
|
192 |
for prot in protein:
|
193 |
pdbs.append(get_pdb_ids(prot))
|
|
|
194 |
if len(pdbs) >= 1:
|
|
|
195 |
pdbs = [item for sublist in pdbs for item in sublist]
|
196 |
+
print('PDB List:', pdbs)
|
197 |
else:
|
198 |
+
print('PDB List Empty')
|
199 |
pdbs = []
|
200 |
print('Processing PDB structures...\n')
|
201 |
if pdbs == []:
|
|
|
216 |
cnt = 0
|
217 |
st.write('this is the pdbs', pdbs)
|
218 |
def fetch_uniprot_ids(pdb_code):
|
219 |
+
response = requests.get(f"https://www.ebi.ac.uk/pdbe/api/mappings/uniprot/{pdb_code}")
|
220 |
+
st.write('response', response)
|
221 |
+
response.raise_for_status() # Check for a successful response
|
222 |
+
data = response.json()
|
223 |
+
st.write(list(list(list(data.values())[0].values())[0].keys()))
|
224 |
+
return list(list(list(data.values())[0].values())[0].keys())
|
225 |
+
|
|
|
226 |
for search in pdbs:
|
227 |
# Step 1: Fetch the PDB file
|
228 |
pdb_url = f"https://files.rcsb.org/download/{search}.pdb"
|