Yanisadel commited on
Commit
d79b96d
·
verified ·
1 Parent(s): b2fd83a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -64,6 +64,12 @@ def read_dna_sequence(dna_text, fasta_file):
64
  dna_sequence = dna_sequence.upper()
65
  warning += "\n⚠️ Note: DNA sequence was converted to uppercase (lowercase nucleotides are not supported)."
66
 
 
 
 
 
 
 
67
  return dna_sequence, warning.strip(), error
68
 
69
 
@@ -148,7 +154,7 @@ with gr.Blocks(css=css) as demo:
148
  gr.Markdown(
149
  """
150
  # 🧬 ChatNT: A Multimodal Conversational Agent for DNA, RNA and Protein Tasks
151
- [ChatNT](https://www.nature.com/articles/s42256-025-01047-1) is the first multimodal conversational agent designed with a deep understanding of biological sequences (DNA, RNA, proteins). It enables users — even those with no coding background — to interact with biological data through natural language and it generalizes across multiple biological tasks and modalities
152
 
153
  This Hugging Face Space is powered by a [ZeroGPU](https://huggingface.co/docs/hub/en/spaces-zerogpu), which is free but **limited to 5 minutes per day per user**.
154
  """
 
64
  dna_sequence = dna_sequence.upper()
65
  warning += "\n⚠️ Note: DNA sequence was converted to uppercase (lowercase nucleotides are not supported)."
66
 
67
+ if error != "":
68
+ # If there was an error before, no need to check the content of the sequence. Otherwise, check that only ACGTN are used
69
+ for nucleotide in dna_sequence:
70
+ if nucleotide not in ["A", "C", "G", "T", "N"]:
71
+ error = "❌ The nucleotides of the DNA sequence should be either 'A', 'T', 'G', 'C' or 'N'."
72
+
73
  return dna_sequence, warning.strip(), error
74
 
75
 
 
154
  gr.Markdown(
155
  """
156
  # 🧬 ChatNT: A Multimodal Conversational Agent for DNA, RNA and Protein Tasks
157
+ [ChatNT](https://www.nature.com/articles/s42256-025-01047-1) is the first multimodal conversational agent designed with a deep understanding of biological sequences (DNA, RNA, proteins). It enables users — even those with no coding background — to interact with biological data through natural language and it generalizes across multiple biological tasks and modalities.
158
 
159
  This Hugging Face Space is powered by a [ZeroGPU](https://huggingface.co/docs/hub/en/spaces-zerogpu), which is free but **limited to 5 minutes per day per user**.
160
  """