Small beta-barrel protein alignment

Hi @huqi, apologies for the delay.

This usually happens because Ab Initio Reconstruction does not use all particles when producing a single class (for reasons described here). So you could

  • increase the Num particles to use parameter such that it is larger than your number of particles, or
  • use multiple classes (this might be better if you think there is still junk in your input particle stack)

I hope that helps!

Hi @rposert,

I ran into the same issue when using cryoSPARC tools in a Jupyter notebook. Could you help me diagnose what might be happening?

Initially, I noticed that the version number in the upper-left corner in the cryoSPARC home page showed “null”, and a response by wtempel in this thread suggested that restarting cryoSPARC would help. While this did fix the version number, it didn’t have any effect on the connection reset by peer error.

Based on your comment, I also checked to make sure my versions of cryoSPARC and cryosparc-tools match:

image

This is a little strange, because the notebook appears to be connecting successfully:

cs = CryoSPARC(
    license="redacted",
    host="localhost",
    base_port=39000,
    email=redacted",
    password="redacted"
)

assert cs.test_connection()

Connection succeeded to CryoSPARC command_core at http://localhost:39002
Connection succeeded to CryoSPARC command_vis at http://localhost:39003
Connection succeeded to CryoSPARC command_rtp at http://localhost:39005

Moreover, I can successfully import the results of a job into the notebook. The error only occurs when I try to save a results group.

for cluster_id, inds in clusters.items():
    cluster_cs = J380_particles.take(inds)
    cluster_cs_name = f'cluster_{cluster_id}/{num_clusters}'
    print(f'{cluster_cs_name}: len({cluster_cs.rows()}) particles')
    
    print(cluster_cs_name)
    cs.save_external_result('P10',
                            'W17',
                            cluster_cs,
                            type="particle",
                            name=cluster_cs_name,
                            slots=["blob"],
                            passthrough=('J380', "particles"),
                            title=cluster_cs_name    
    )

cluster_0/10: len(Spool object with 149935 items.) particles
cluster_0/10

/programs/x86_64-linux/anaconda/2022.10/envs/cs-tools/lib/python3.8/contextlib.py:113: UserWarning: *** CommandClient: (http://localhost:39003/external/projects/P10/jobs/J700/outputs/cluster_0/10/dataset) URL Error [Errno 104] Connection reset by peer, attempt 1 of 3. Retrying in 30 seconds
  return next(self.gen)
/programs/x86_64-linux/anaconda/2022.10/envs/cs-tools/lib/python3.8/contextlib.py:113: UserWarning: *** CommandClient: (http://localhost:39003/external/projects/P10/jobs/J700/outputs/cluster_0/10/dataset) URL Error [Errno 104] Connection reset by peer, attempt 2 of 3. Retrying in 30 seconds
  return next(self.gen)

Inside the project, a results group is generated. But although the job appears to have stopped with an error, there isn’t an obvious error message in the log:
image

[CPU:  268.3 MB  Avail: 184.32 GB]
Adding input slot particles (type particle)...

[CPU:  268.3 MB  Avail: 184.31 GB]
Created input group: particles (type particle)

[CPU:  268.3 MB  Avail: 184.31 GB]
Adding output group cluster_0/10 (type particle)...

[CPU:  268.3 MB  Avail: 184.31 GB]
Created output group cluster_0/10 (type particle, passthrough particles)

[CPU:  268.3 MB  Avail: 184.32 GB]
Added output slot for group cluster_0/10: blob (type particle.blob)

[CPU:  268.3 MB  Avail: 184.32 GB]
Passed through from input particles to output cluster_0/10

[CPU:  268.3 MB  Avail: 184.32 GB]
Passed through J380.particles to J700.particles

License is valid.

Any insights would be greatly appreciated!

Best,
cbeck

Actually, it looks like the save_external_result method works if I execute it outside of the for loop:

cluster_cs = J380_particles.take(clusters[0])
cs.save_external_result('P10',
                        'W17',
                        cluster_cs,
                        type="particle",
                        name="test",
                        slots=["blob"],
                        passthrough=('J380', "particles"),
                        title="test" 
                       )

'J701'

Is there something wrong with my syntax? I was following the example on your github page where you used a for loop to split a particle stack by its symmetry group and export each group of particles back into the project using a for loop: split_by_sym_exp.ipynb · GitHub

for symmetry_index in range(num_rotations + 1):
    sym_subset = expanded_particles.query({
        'sym_expand/idx': symmetry_index
    })
    
    cs.save_external_result(
        sym_exp_project_number,
        sym_exp_workspace_number,
        sym_subset,
        type = 'particle',
        slots = ['blob'],
        passthrough = (sym_exp_job_number, 'particles'),
        title = f"Symmetry Index {symmetry_index}"
    )

Do you have an idea of what might be happening? While it isn’t too difficult to just manually save each external result, it would be useful to execute t inside a for loop to help automate my workflow.

Nevermind, it was a syntax error. The name for the result can’t contain slashes because it gets converted to a URL, which makes the URL unreadable.

Cheers,
cbeck

2 Likes