You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove unused prompt and prediction selection functions
Deleted select_best_prediction, create_json_prompt, and create_initial_discussion_prompt functions, along with related imports and exports, to clean up unused code and simplify the API.
DEFAULT_JSON_PROMPT_TEMPLATE="""You are an expert single-cell RNA-seq analyst specializing in cell type annotation.
109
-
I need you to identify cell types of {species} cells from {tissue}.
110
-
Below is a list of marker genes for each cluster.
111
-
Please assign the most likely cell type to each cluster based on the marker genes.
112
-
113
-
IMPORTANT: Format your response as a valid JSON object as follows, using the EXACT SAME cluster IDs as provided in the input, and maintaining NUMERICAL ORDER:
114
-
```json
115
-
{{
116
-
"annotations": [
117
-
{{
118
-
"cluster": "0",
119
-
"cell_type": "T cells",
120
-
"confidence": "high",
121
-
"key_markers": ["CD3D", "CD3G", "CD3E"]
122
-
}},
123
-
{{
124
-
"cluster": "1",
125
-
"cell_type": "B cells",
126
-
"confidence": "high",
127
-
"key_markers": ["CD19", "CD79A", "MS4A1"]
128
-
}},
129
-
...
130
-
]
131
-
}}
132
-
```
133
-
134
-
For each cluster, provide:
135
-
1. The cluster ID (use the SAME ID as in the input)
136
-
2. The cell type name (be concise but specific)
137
-
3. Your confidence level (high, medium, low)
138
-
4. A list of 2-4 key markers that support your annotation
139
-
140
-
Here are the marker genes for each cluster:
141
-
{markers}
142
-
"""
143
-
144
107
# Template for facilitating discussion for controversial clusters
145
108
DEFAULT_DISCUSSION_TEMPLATE="""You are an expert in single-cell RNA-seq cell type annotation tasked with resolving disagreements between model predictions.
146
109
@@ -335,33 +298,6 @@ def create_batch_prompt(
335
298
returnprompt
336
299
337
300
338
-
defcreate_json_prompt(
339
-
marker_genes: dict[str, list[str]],
340
-
species: str,
341
-
tissue: Optional[str] =None,
342
-
additional_context: Optional[str] =None,
343
-
) ->str:
344
-
"""Create a prompt for cell type annotation with JSON output format.
345
-
346
-
Args:
347
-
marker_genes: Dictionary mapping cluster names to lists of marker genes
348
-
species: Species name (e.g., 'human', 'mouse')
349
-
tissue: Tissue name (e.g., 'brain', 'blood')
350
-
additional_context: Additional context to include in the prompt
0 commit comments