PhDFlo commited on
Commit
71b6cd0
·
1 Parent(s): 9aeca93

def fasta func and rename of space

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +32 -0
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: MCP Chai1 Modal
3
  emoji: 🧬
4
  colorFrom: gray
5
  colorTo: green
 
1
  ---
2
+ title: MCP Modal Protein Folding
3
  emoji: 🧬
4
  colorFrom: gray
5
  colorTo: green
app.py CHANGED
@@ -11,6 +11,38 @@ from modal_app import app, chai1_inference, download_inference_dependencies, her
11
 
12
  # Definition of the tools for the MCP server
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  # Function to create a custom JSON config file
15
  def create_custom_config(
16
  num_trunk_recycles: int = 3,
 
11
 
12
  # Definition of the tools for the MCP server
13
 
14
+ # Function to return a fasta file
15
+ def return_fasta_file() -> str:
16
+ """Create a FASTA file from a protein sequence string.
17
+
18
+ Args:
19
+ sequence (str): The protein sequence string
20
+ name (str, optional): The name/identifier for the sequence. Defaults to "PROTEIN"
21
+ output_file (str, optional): Path to save the FASTA file. If None, saves to default location.
22
+
23
+ Returns:
24
+ str: Path to the created FASTA file
25
+ """
26
+ # Clean the sequence by removing whitespace and newlines
27
+ sequence = ''.join(sequence.split())
28
+
29
+ # Set default name if none provided
30
+ if name is None:
31
+ name = "PROTEIN"
32
+
33
+ # Create FASTA content
34
+ fasta_content = f">{name}\n{sequence}\n"
35
+
36
+ # Set default output path if none provided
37
+ if output_file is None:
38
+ output_file = here / "inputs" / "chai1_custom_input.fasta"
39
+
40
+ # Write the FASTA file
41
+ with open(output_file, "w") as f:
42
+ f.write(fasta_content)
43
+
44
+ return str(output_file)
45
+
46
  # Function to create a custom JSON config file
47
  def create_custom_config(
48
  num_trunk_recycles: int = 3,