Expand volume series to multiple volumes when provided as input (feature request)

Hi,

It would be convenient if volume_series slots could be provided as inputs (e.g. to Align 3D, Class 3D or heterogeneous refinement).

For example - I have an 80 class 3D classification. I would like to align all maps (and particles) to a reference volume (aligning on the bits in the membrane, for example). Currently, to do this I need to drag and drop the 80 classes individually - it would be nice if I could just drag the volume series slot (and particles with class assignments?) and have cryosparc take care of the rest automatically :slight_smile: :pray: .

Also, would it be possible to add a particle input for align 3D? So that the corresponding particle sets have whatever shifts/orientations determined by align3d applied? this would be very handy when combining particle sets for local refinement after 3D classification…

EDIT: Oh wait this (particle inputs for Align3D) already exists?? - awesome!!

Cheers
Oli

Hi @olibclarke,

This has been noted to add a volume series input in Align 3D to simplify cases involving many volumes like this.

Michael

1 Like

In the meantime, here’s a short CryoSPARC Tools script which will connect all the output volumes from a Class 3D to (in this case) an Align 3D Maps job. I created both jobs before running the script – this just automates the connection process. I wrote it this way with the hopes that it is generally useful for any job which wants multiple volumes, rather than having to write one per job :slight_smile:

from cryosparc.tools import CryoSPARC
import json

with open("/u/rposert/instance-info.json", "r") as f:
    instance_info = json.load(f)

cs = CryoSPARC(**instance_info)
assert cs.test_connection()

project_number = "P310"
workspace_number = "W1"

project = cs.find_project(project_number)

class_job_number = "J52"
align_job_number = "J56"

class_job = project.find_job(class_job_number)
align_job = project.find_job(align_job_number)

class_idx = 0
while True:
    try:
        vol_id = f"volume_class_{class_idx}"
        # check if output exists by just trying to load it
        _ = class_job.load_output(vol_id)
        align_job.connect("maps_align", class_job_number, vol_id)
        class_idx += 1
    except TypeError:
        # load_output throws a TypeError when the output does not exist
        break
2 Likes