Update app.py
Browse files
app.py
CHANGED
@@ -182,14 +182,20 @@ def pdb_structure(Structure_index):
|
|
182 |
created_folders = []
|
183 |
SurfacePoitCloud_all = []
|
184 |
for index in Structure_index:
|
185 |
-
structure_folder = join(temp_path, str(index)+".pdb")
|
186 |
-
created_folders.append(structure_folder)
|
187 |
-
pdb_file = join(pdb_path, f"{index}.pdb")
|
188 |
-
if os.path.exists(pdb_file):
|
189 |
-
|
190 |
-
else:
|
191 |
-
|
192 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
atoms_channel = utils.atomlistToChannels(atname)
|
194 |
radius = utils.atomlistToRadius(atname)
|
195 |
PointCloudSurfaceObject = VolumeMaker.PointCloudSurface(device=device)
|
@@ -212,12 +218,12 @@ def ACE(file):
|
|
212 |
|
213 |
|
214 |
test_dict = {"text":test_sequences, 'structure':test_Structure_index}
|
215 |
-
print("=================================Structure prediction========================")
|
216 |
-
for i in tqdm(range(0, len(test_sequences))):
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
test_data=MyDataset(test_dict)
|
222 |
test_dataloader=DataLoader(test_data,batch_size=batch_size,collate_fn=collate_fn,shuffle=False)
|
223 |
|
|
|
182 |
created_folders = []
|
183 |
SurfacePoitCloud_all = []
|
184 |
for index in Structure_index:
|
185 |
+
# structure_folder = join(temp_path, str(index)+".pdb")
|
186 |
+
# created_folders.append(structure_folder)
|
187 |
+
# pdb_file = join(pdb_path, f"{index}.pdb")
|
188 |
+
# if os.path.exists(pdb_file):
|
189 |
+
# shutil.copy2(pdb_file, structure_folder)
|
190 |
+
# else:
|
191 |
+
# print(f"PDB file not found for structure {index}")
|
192 |
+
print("=================================Structure prediction========================")
|
193 |
+
for i in tqdm(range(0, len(test_sequences))):
|
194 |
+
command = ["curl", "-X", "POST", "-k", "--data", f"{test_sequences[i]}", "https://api.esmatlas.com/foldSequence/v1/pdb/"]
|
195 |
+
result = subprocess.run(command, capture_output=True, text=True)
|
196 |
+
# with open(os.path.join(pdb_path, f'{test_Structure_index[i]}.pdb'), 'w') as file:
|
197 |
+
# file.write(result.stdout)
|
198 |
+
coords, atname, pdbname, pdb_num = utils.parsePDB(result.stdout)
|
199 |
atoms_channel = utils.atomlistToChannels(atname)
|
200 |
radius = utils.atomlistToRadius(atname)
|
201 |
PointCloudSurfaceObject = VolumeMaker.PointCloudSurface(device=device)
|
|
|
218 |
|
219 |
|
220 |
test_dict = {"text":test_sequences, 'structure':test_Structure_index}
|
221 |
+
# print("=================================Structure prediction========================")
|
222 |
+
# for i in tqdm(range(0, len(test_sequences))):
|
223 |
+
# command = ["curl", "-X", "POST", "-k", "--data", f"{test_sequences[i]}", "https://api.esmatlas.com/foldSequence/v1/pdb/"]
|
224 |
+
# result = subprocess.run(command, capture_output=True, text=True)
|
225 |
+
# with open(os.path.join(pdb_path, f'{test_Structure_index[i]}.pdb'), 'w') as file:
|
226 |
+
# file.write(result.stdout)
|
227 |
test_data=MyDataset(test_dict)
|
228 |
test_dataloader=DataLoader(test_data,batch_size=batch_size,collate_fn=collate_fn,shuffle=False)
|
229 |
|