Skip to content

Commit 9455431

Browse files
committed
fix: update notebook visualization
1 parent 6b8ad9d commit 9455431

8 files changed

Lines changed: 16 additions & 13 deletions

File tree

614 KB
Loading
-38.8 KB
Loading
267 KB
Loading

examples/science/af3-slurm/examples/simple_ipynb_launcher/adm/rest_api_launch_af3_job.sh.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ elif [ "$JOB_TYPE" = "inference" ]; then
285285

286286
# Add JAX cache path if set
287287
if [ -n "$JAX_COMPILATION_CACHE_PATH" ]; then
288-
job_specific_python_opts+=" --jax_compilation_cache_path='${JAX_COMPILATION_CACHE_PATH}'"
288+
job_specific_python_opts+=" --jax_compilation_cache_dir='${JAX_COMPILATION_CACHE_PATH}'"
289289
apptainer_binds+=("--bind" "${JAX_COMPILATION_CACHE_PATH}")
290290
echo "Info: JAX cache enabled at ${JAX_COMPILATION_CACHE_PATH}"
291291
else

examples/science/af3-slurm/examples/simple_ipynb_launcher/adm/slurm-rest-api-notebook.ipynb.j2

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@
205205
"datapipeline_partition_name = \"{{ default_datapipeline_partition_name }}\"\n",
206206
"\n",
207207
"# Assign `input_file` with datapipeline input file path\n",
208-
"input_file= \"\" # Replace with your input file path (relative path from the jupyter notebook directory)\n"
208+
"input_file= \"fold_input.json\" # Replace with your input file path (relative path from the jupyter notebook directory)\n"
209209
]
210210
},
211211
{
@@ -259,8 +259,8 @@
259259
"# Datapipeline job could returns multiple output files in case the input file is a JSON file with multiple protein sequences\n",
260260
"# The output path is a list of dictionaries, each containing the path to the output file\n",
261261
"# The first output path is used as input for inference\n",
262-
"print(\"[INFO] Extracting output paths from inference job response...\")\n",
263-
"print(\"[INFO] Output count:\", len(datapipeline_submit_job_response[\"output_path_list\"]))\n",
262+
"print(\"[INFO] Extracting output paths from datapipeline job response...\")\n",
263+
"print(\"[INFO] Datapipeline output path count:\", len(datapipeline_submit_job_response[\"output_path_list\"]))\n",
264264
"inference_input_file = datapipeline_submit_job_response[\"output_path_list\"][0][\"output_path\"]\n",
265265
"\n",
266266
"# Assign `enable_unified_memory` with True or False\n",
@@ -328,7 +328,7 @@
328328
"# The output path is a list of dictionaries, each containing the path to the output file\n",
329329
"# In this example, we will use the first output path\n",
330330
"print(\"[INFO] Extracting output paths from inference job response...\")\n",
331-
"print(\"[INFO] Output count:\", len(inference_submit_job_response[\"output_path_list\"]))\n",
331+
"print(\"[INFO] Inference output path count:\", len(inference_submit_job_response[\"output_path_list\"]))\n",
332332
"inference_output_path_info = inference_submit_job_response[\"output_path_list\"][0]"
333333
]
334334
},

examples/science/af3-slurm/examples/simple_ipynb_launcher/adm/slurm_client.py.j2

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,6 @@ class AF3SlurmClient:
331331
f" └── Datapipeline output path : {datapipeline_output_file_path}")
332332

333333
response["output_path_list"] = output_path_list
334-
print(
335-
f"[INFO] Datapipeline output path : {datapipeline_output_file_path}")
336334
return response
337335

338336
def cancel_job(self, job_id: int) -> Optional[Dict]:

examples/science/af3-slurm/examples/simple_ipynb_launcher/adm/visualization.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,13 @@
2626

2727
def plot_pae_matrix(pae: np.ndarray, token_chain_ids: str) -> None:
2828
df = pd.DataFrame(pae)
29-
fig = px.imshow(df, color_continuous_scale='Viridis',
30-
labels={'color': 'PAE'},
31-
title='Predicted Aligned Error (PAE) Matrix')
29+
fig = px.imshow(
30+
df,
31+
color_continuous_scale=[(0.0, 'green'), (1.0, 'white')],
32+
labels={'color': 'PAE'},
33+
title='Predicted Aligned Error (PAE) Matrix'
34+
)
35+
3236
# Draw chain boundaries if available
3337
if token_chain_ids:
3438
chain_boundaries = []
@@ -45,16 +49,17 @@ def plot_pae_matrix(pae: np.ndarray, token_chain_ids: str) -> None:
4549
y0=0,
4650
x1=boundary,
4751
y1=len(token_chain_ids),
48-
line=dict(color="red", width=1)
52+
line=dict(color="black", width=1)
4953
)
5054
fig.add_shape(
5155
type="line",
5256
x0=0,
5357
y0=boundary,
5458
x1=len(token_chain_ids),
5559
y1=boundary,
56-
line=dict(color="red", width=1)
60+
line=dict(color="black", width=1)
5761
)
62+
5863
fig.update_layout(autosize=True)
5964
fig.show()
6065

examples/science/af3-slurm/examples/simple_job_launcher/launch_af3_job.sh.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ elif [ "$JOB_TYPE" = "inference" ]; then
254254

255255
# Add JAX cache path if set
256256
if [ -n "$JAX_COMPILATION_CACHE_PATH" ]; then
257-
job_specific_python_opts+=" --jax_compilation_cache_path='${JAX_COMPILATION_CACHE_PATH}'"
257+
job_specific_python_opts+=" --jax_compilation_cache_dir='${JAX_COMPILATION_CACHE_PATH}'"
258258
apptainer_binds+=("--bind" "${JAX_COMPILATION_CACHE_PATH}")
259259
echo "Info: JAX cache enabled at ${JAX_COMPILATION_CACHE_PATH}"
260260
else

0 commit comments

Comments
 (0)