crYOLO particle picking problem: Unable to see power histogram and picked particles during inspect picks

Hello,
I have followed the guide provided in the cryosparc tools documentation for particle picking with crYOLO. However, I am encountering an issue when trying to inspect my particle picks. Specifically, I am unable to view the power histogram or any picked particles on my micrographs. I am wondering if anyone has experienced similar issues and if there are any solutions to this problem?

(Additionally, I am curious if it is possible to set the prediction threshold to 0 and then adjust it interactively during the inspect picks job)

Thank you in advance for your help and advice.

I was playing around with this and had the same issue, namely not being able to interactively select particles in the Inspect Particles Job.

To work around this I modified the provided script to set values for both “pick_stats/ncc_score” and “pick_stats/power” which then brought up the heat map in the interactive Inspect Particles Job. The value I assigned to “pick_stats/ncc_score” and “pick_stats/power” was the figure of merit provided by cryolo which I took from “boxfiles/CRYOSPARC/cryosparc.star”. Probably it would be smarter to get values from the CBOX files but I did not spend time to parse these files.

Below I paste the code I used but it is not tested so use with caution. I also added a tqdm progress bar so you have to have tqdm installed in your conda enviroment,

from tqdm.notebook import tqdm
from io import StringIO
import numpy as np
from numpy.core import records
from cryosparc import star



output_star_folder = "STAR"

all_predicted = []

starfile_path = "boxfiles/CRYOSPARC/cryosparc.star" 
locations = star.read(job.dir() / starfile_path)[""]


all_micrographs = job.load_input("all_micrographs", ["micrograph_blob"])

for mic in tqdm(all_micrographs.rows()):
    micrograph_path = mic["micrograph_blob/path"]
    micrograph_name = micrograph_path.split("/")[-1]
    #print(micrograph_name )
    height, width = mic["micrograph_blob/shape"]


    center_x = locations[locations['rlnMicrographName'] == micrograph_name]['rlnCoordinateX'] / width
    center_y = locations[locations['rlnMicrographName'] == micrograph_name]['rlnCoordinateY'] / height
    fig_merit = locations[locations['rlnMicrographName'] == micrograph_name]['rlnAutopickFigureOfMerit']
    
    predicted = job.alloc_output("predicted_particles", len(locations[locations['rlnMicrographName'] == micrograph_name]))
    predicted["location/micrograph_uid"] = mic["uid"]
    predicted["location/micrograph_path"] = mic["micrograph_blob/path"]
    predicted["location/micrograph_shape"] = mic["micrograph_blob/shape"]
    predicted["location/center_x_frac"] = center_x
    predicted["location/center_y_frac"] = center_y
    predicted["pick_stats/ncc_score"] = fig_merit
    predicted["pick_stats/power"] = fig_merit  
    all_predicted.append(predicted)
1 Like

Hi @Poko18 and @frozenfas ,

Thank you for reporting and apologies for the delay. We’ve made a fix to Inspect Picks such that it is able to display particles even when the input dataset does not contain pick_stats. This will be released in the next version of CryoSPARC.

Regards,
Suhail

2 Likes

Thank you for that. I tried it myself and it works great.
Also, I think that the merit numbers are the same between CBOX and cryosparc.star, so It might not be necessary to parse CBOX files.

Best,
Tadej

1 Like

Hi all,

This is resolved in v4.3 (August 9, 2023) as you can now run Inspect Picks on a datasets without pick stats.

- Suhail

2 Likes

Hi,

I am encountering this issue in CryoSPARC v4.4.1 with particles imported from a cryosparc.star file created with crYOLO v.1.9.7 .

The imported particle group has location and pick_stat but they are not showing up in the Inspect Picks job:

What’s interesting is that the pick locations are displayed in the thumbnail of the extraction job :thinking:

Best wishes,
Sven

Here is a screenshot of the thumbnail of the extraction job.

cryolo_particles_missing_thumbnail

Inspect Picks works for particles imported from Relion’s particle.star and crYOLO v1.9.6’s cryosparc.star files, which only have location and no pick_stats information.

Inspect Picks does not show particles for imports from the latest crYOLO v1.9.7 cryosparc.star, which contains (partial) pick_stats data providing ncc_score but zero values/floats for power, template_idx and angle_rad.

I guess the issue may be the partial pick_stats data is not read properly by the Inspect Picks job?

Happy to make changes to my cryosparc.star file if necessary.

I guess it is related to this issue? Import crYOLO coordinates into CryoSPARC v4 - #17 by D_E_N_N_I_S