Spaces:
Sleeping
Sleeping
Commit
·
fc0ba60
1
Parent(s):
ae8cb90
Update code/pdb_featureVector.py
Browse files
code/pdb_featureVector.py
CHANGED
|
@@ -230,19 +230,23 @@ def pdb(input_set, mode, impute):
|
|
| 230 |
for search in pdbs:
|
| 231 |
# Step 1: Fetch the PDB file
|
| 232 |
pdb_url = f"https://files.rcsb.org/download/{search}.pdb"
|
|
|
|
| 233 |
try:
|
| 234 |
response = requests.get(pdb_url)
|
|
|
|
| 235 |
response.raise_for_status() # Check for a successful response
|
| 236 |
except :
|
| 237 |
continue # Skip to the next PDB code if fetching fails
|
| 238 |
-
|
| 239 |
# Step 2: Parse the PDB file from memory
|
| 240 |
pdb_data = response.text
|
|
|
|
| 241 |
pdb_parser = PDBParser(QUIET=True) # QUIET=True suppresses warnings
|
| 242 |
pdb_file_content = StringIO(pdb_data)
|
| 243 |
structure = pdb_parser.get_structure(pdb_code, pdb_file_content)
|
| 244 |
ppb = PPBuilder()
|
| 245 |
for model in structure:
|
|
|
|
| 246 |
for pp in ppb.build_peptides(model):
|
| 247 |
sequence = pp.get_sequence()
|
| 248 |
for chain in model:
|
|
|
|
| 230 |
for search in pdbs:
|
| 231 |
# Step 1: Fetch the PDB file
|
| 232 |
pdb_url = f"https://files.rcsb.org/download/{search}.pdb"
|
| 233 |
+
st.write(pdb_url)
|
| 234 |
try:
|
| 235 |
response = requests.get(pdb_url)
|
| 236 |
+
st.write('response', response)
|
| 237 |
response.raise_for_status() # Check for a successful response
|
| 238 |
except :
|
| 239 |
continue # Skip to the next PDB code if fetching fails
|
| 240 |
+
st.write('response2', response)
|
| 241 |
# Step 2: Parse the PDB file from memory
|
| 242 |
pdb_data = response.text
|
| 243 |
+
st.write('pdb_data', pdb_data)
|
| 244 |
pdb_parser = PDBParser(QUIET=True) # QUIET=True suppresses warnings
|
| 245 |
pdb_file_content = StringIO(pdb_data)
|
| 246 |
structure = pdb_parser.get_structure(pdb_code, pdb_file_content)
|
| 247 |
ppb = PPBuilder()
|
| 248 |
for model in structure:
|
| 249 |
+
st.write(model)
|
| 250 |
for pp in ppb.build_peptides(model):
|
| 251 |
sequence = pp.get_sequence()
|
| 252 |
for chain in model:
|