Spaces:
Running
on
T4
Running
on
T4
simonduerr
commited on
Commit
•
80ea1c9
1
Parent(s):
99db958
Update app.py
Browse files
app.py
CHANGED
@@ -349,7 +349,7 @@ def preprocess_mol(pdb_code="", filepath=""):
|
|
349 |
print("cleaned", tf_cleaned)
|
350 |
mol.write(tf_cleaned.name)
|
351 |
print(os.listdir())
|
352 |
-
return tf_cleaned.name, df
|
353 |
|
354 |
|
355 |
def assign_sasa(mol):
|
@@ -378,9 +378,9 @@ def process_atomsel(atomsel):
|
|
378 |
return atomsel
|
379 |
|
380 |
|
381 |
-
def make_fixed_positions_dict(atomsel, residue_index_df):
|
382 |
# we use the uploaded file for the selection
|
383 |
-
mol = Molecule(
|
384 |
# use index for selection as resids will change
|
385 |
|
386 |
# set sasa to 0 for all non protein atoms (all non protein atoms are deleted later)
|
@@ -447,7 +447,7 @@ def update(
|
|
447 |
|
448 |
#pdb_path = get_pdb(pdb_code=inp, filepath=file)
|
449 |
|
450 |
-
pdb_path, mol_index = preprocess_mol(pdb_code=inp,filepath=file)
|
451 |
|
452 |
print("done processing mol")
|
453 |
if pdb_path == None:
|
@@ -505,7 +505,7 @@ def update(
|
|
505 |
if atomsel == "":
|
506 |
fixed_positions_dict, selected_residues = None, []
|
507 |
else:
|
508 |
-
fixed_positions_dict, selected_residues = make_fixed_positions_dict(
|
509 |
atomsel, mol_index
|
510 |
)
|
511 |
|
|
|
349 |
print("cleaned", tf_cleaned)
|
350 |
mol.write(tf_cleaned.name)
|
351 |
print(os.listdir())
|
352 |
+
return tf_cleaned.name, df, tf_original
|
353 |
|
354 |
|
355 |
def assign_sasa(mol):
|
|
|
378 |
return atomsel
|
379 |
|
380 |
|
381 |
+
def make_fixed_positions_dict(original_file, atomsel, residue_index_df):
|
382 |
# we use the uploaded file for the selection
|
383 |
+
mol = Molecule(original_file)
|
384 |
# use index for selection as resids will change
|
385 |
|
386 |
# set sasa to 0 for all non protein atoms (all non protein atoms are deleted later)
|
|
|
447 |
|
448 |
#pdb_path = get_pdb(pdb_code=inp, filepath=file)
|
449 |
|
450 |
+
pdb_path, mol_index, path_unprocessed = preprocess_mol(pdb_code=inp,filepath=file)
|
451 |
|
452 |
print("done processing mol")
|
453 |
if pdb_path == None:
|
|
|
505 |
if atomsel == "":
|
506 |
fixed_positions_dict, selected_residues = None, []
|
507 |
else:
|
508 |
+
fixed_positions_dict, selected_residues = make_fixed_positions_dict(path_unprocessed,
|
509 |
atomsel, mol_index
|
510 |
)
|
511 |
|