yinuozhang commited on
Commit
2b5f1d4
·
1 Parent(s): 5db893f

bug fixing

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -828,12 +828,12 @@ def process_input(smiles_input=None, file_obj=None, show_linear=False,
828
  smiles = smiles_input.strip()
829
 
830
  if not analyzer.is_peptide(smiles):
831
- return "Error: Input SMILES does not appear to be a peptide structure.", None, None
832
 
833
  try:
834
  mol = Chem.MolFromSmiles(smiles)
835
  if mol is None:
836
- return "Error: Invalid SMILES notation.", None, None
837
 
838
  if generate_3d:
839
  generator = PeptideStructureGenerator()
@@ -857,7 +857,7 @@ def process_input(smiles_input=None, file_obj=None, show_linear=False,
857
  structure_files.append(uff_path)
858
 
859
  except Exception as e:
860
- return f"Error generating 3D structures: {str(e)}", None, None, None
861
 
862
  segments = analyzer.split_on_bonds(smiles)
863
 
@@ -985,12 +985,12 @@ def process_input(smiles_input=None, file_obj=None, show_linear=False,
985
  output_text += f"Peptide Cycles: {', '.join(peptide_cycles)}\n"
986
  output_text += "-" * 50 + "\n"
987
 
988
- return output_text, None, None
989
 
990
  except Exception as e:
991
- return f"Error processing file: {str(e)}", None, None
992
 
993
- return "No input provided.", None, None
994
 
995
  iface = gr.Interface(
996
  fn=process_input,
 
828
  smiles = smiles_input.strip()
829
 
830
  if not analyzer.is_peptide(smiles):
831
+ return "Error: Input SMILES does not appear to be a peptide structure.", None, None, []
832
 
833
  try:
834
  mol = Chem.MolFromSmiles(smiles)
835
  if mol is None:
836
+ return "Error: Invalid SMILES notation.", None, None, []
837
 
838
  if generate_3d:
839
  generator = PeptideStructureGenerator()
 
857
  structure_files.append(uff_path)
858
 
859
  except Exception as e:
860
+ return f"Error generating 3D structures: {str(e)}", None, None, []
861
 
862
  segments = analyzer.split_on_bonds(smiles)
863
 
 
985
  output_text += f"Peptide Cycles: {', '.join(peptide_cycles)}\n"
986
  output_text += "-" * 50 + "\n"
987
 
988
+ return output_text, None, None, []
989
 
990
  except Exception as e:
991
+ return f"Error processing file: {str(e)}", None, None, []
992
 
993
+ return "No input provided.", None, None, []
994
 
995
  iface = gr.Interface(
996
  fn=process_input,