simonduerr commited on
Commit
d13186d
1 Parent(s): 14b276d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -332,7 +332,7 @@ def make_fixed_positions_dict(atomsel, residue_index_df):
332
  # based on selected index now get resids
333
  selected_residues = [str(i) for i in selected_residues]
334
  if len(selected_residues)==0:
335
- return {'cleaned':{}}, []
336
  selected_residues_str = " ".join(selected_residues)
337
  selected_residues=set(mol.get('resid', sel=f"index {selected_residues_str}"))
338
 
@@ -432,7 +432,7 @@ def update(
432
 
433
  chain_id_dict = None
434
  if atomsel == "":
435
- fixed_positions_dict, selected_residues = {'cleaned':{}}, []
436
  else:
437
  fixed_positions_dict, selected_residues=make_fixed_positions_dict(atomsel, mol_index)
438
 
@@ -697,8 +697,8 @@ def update(
697
  )
698
  seq_list.append(seq + chain_s)
699
  message += f"{line}\n"
700
-
701
- message += f"\nfixed positions:* {fixed_positions_dict['cleaned']} \n\n*uses CHAIN:[1..len(chain)] residue numbering"
702
  # somehow sequences still contain X, remove again
703
  for i, x in enumerate(seq_list):
704
  for aa in omit_AAs:
 
332
  # based on selected index now get resids
333
  selected_residues = [str(i) for i in selected_residues]
334
  if len(selected_residues)==0:
335
+ return None, []
336
  selected_residues_str = " ".join(selected_residues)
337
  selected_residues=set(mol.get('resid', sel=f"index {selected_residues_str}"))
338
 
 
432
 
433
  chain_id_dict = None
434
  if atomsel == "":
435
+ fixed_positions_dict, selected_residues = None, []
436
  else:
437
  fixed_positions_dict, selected_residues=make_fixed_positions_dict(atomsel, mol_index)
438
 
 
697
  )
698
  seq_list.append(seq + chain_s)
699
  message += f"{line}\n"
700
+ if fixed_positions_dict!=None:
701
+ message += f"\nfixed positions:* {fixed_positions_dict['cleaned']} \n\n*uses CHAIN:[1..len(chain)] residue numbering"
702
  # somehow sequences still contain X, remove again
703
  for i, x in enumerate(seq_list):
704
  for aa in omit_AAs: