Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -42,27 +42,28 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 42 |
|
| 43 |
@tool
|
| 44 |
def run_blast(arguments_string: str) -> str:
|
| 45 |
-
"""
|
| 46 |
-
|
| 47 |
-
Parses arguments from a string input.
|
| 48 |
|
| 49 |
Args:
|
| 50 |
-
arguments_string
|
| 51 |
-
|
|
|
|
|
|
|
| 52 |
|
| 53 |
Returns:
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
The arguments_string passed to run_blast contains everything needed: "blastp nr ATGCGTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGC". The function will parse this string, run the BLAST with the provided sequence, and return the results.
|
| 66 |
"""
|
| 67 |
|
| 68 |
parser = argparse.ArgumentParser(
|
|
|
|
| 42 |
|
| 43 |
@tool
|
| 44 |
def run_blast(arguments_string: str) -> str:
|
| 45 |
+
"""Submits a BLAST job to NCBI and retrieves the results.
|
| 46 |
+
|
| 47 |
+
Parses arguments from a string input. Accepts a sequence directly as input, not a file.
|
| 48 |
|
| 49 |
Args:
|
| 50 |
+
arguments_string: A string containing the BLAST program, database, and query sequence.
|
| 51 |
+
The string should be formatted as: "program database query_sequence".
|
| 52 |
+
For example: "blastp nr ATGCGTAGCTAGCTAG...".
|
| 53 |
+
The query sequence should be provided directly within the string.
|
| 54 |
|
| 55 |
Returns:
|
| 56 |
+
BLAST results in text format on success, or an error message string on failure.
|
| 57 |
+
Possible error messages include:
|
| 58 |
+
"Error: Invalid arguments"
|
| 59 |
+
"Error submitting request: {error_details}"
|
| 60 |
+
"Error: Could not parse RID or RTOE from BLAST response."
|
| 61 |
+
"Search {rid} failed; please report to blast-help@ncbi.nlm.nih.gov."
|
| 62 |
+
"Search {rid} expired."
|
| 63 |
+
"No hits found."
|
| 64 |
+
"Unknown error during polling."
|
| 65 |
+
"Error polling for results: {error_details}"
|
| 66 |
+
"Error retrieving results: {error_details}"
|
|
|
|
| 67 |
"""
|
| 68 |
|
| 69 |
parser = argparse.ArgumentParser(
|