Getting filepaths to generated plots from Job ID

Hi everyone, I was looking to find where the plots from cryosparc refinement runs (FSC curves, guinier plot, orientation heatmap ect) are saved on disc, and it seems that they are in a folder that is not easily linkable to tje Job ID (https://cryosparc.server/api/files/64a0a98e61b7d9f520d6d5f3). Is there a way to find the associated plots on disc bsaed on the Job ID? I would like to organise data for a paper that uses lots of local refinements …

Many thanks,

Consider this script

#! /usr/bin/env python

import requests
import os
import os.path
import json
import sys

project_uid = 'P19'
job_uid = 'J192'
output_container = f"{os.environ['HOME']}/tmp" # must exist

license_id = os.environ['CRYOSPARC_LICENSE_ID']
vis_port = os.environ['CRYOSPARC_COMMAND_VIS_PORT'] # base port + 3
cryosparc_host = 'localhost'

# No changes should be needed below.

cryosparc_vis_url = f"http://{cryosparc_host}:{vis_port}"

output_dir_path = os.path.abspath(os.path.join(output_container, f"cryosparc_{project_uid}_{job_uid}_files")) # must not exist

assert os.path.isdir(output_container), f"{output_container}/, where the directory with job files shall be placed, must exist."
assert os.access(output_container, os.W_OK), f"{output_container}/, where the directory with job files shall be placed, must be writable."
assert not os.path.exists(output_dir_path), f"{output_directory_name}, to which certain job files shall be downloaded, already exists."

request_headers = {"License-ID": license_id,
                   "Content-Type": "application/json"}

query_url = f"http://{cryosparc_host}:{vis_port}/api"
query_data = json.dumps({"jsonrpc": "2.0", "method": "list_job_files",
              "params": {"project_uid": project_uid, "job_uid": job_uid},
              "id": 1})

result ="{cryosparc_vis_url}/api",
                       data=query_data, headers=request_headers


for r in result:
    file_data ="{cryosparc_vis_url}/get_job_file",
                              data=json.dumps({"fileid": r["_id"]}),
    output_file_path = os.path.join(output_dir_path, f"{r['_id']}_{r['filename']}")
    with open(output_file_path, 'wb') as oh:
        print(f"Storing {output_file_path} ...")

You may modify the project_uid, job_uid and output_container variables, save it to a file in the current working directory and run it on the CryoSPARC master with the command

cryosparcm call python $(pwd)/ 

and should end up with a collection of the job’s image files.

Oh wow, thanks a lot for that, will give it a try!