We show here how to use CryoBench tools to generate FSCs between volumes reconstructed using our example methods and the ground truth volumes for our datasets.
Before running these tools, make sure you have and . Commands shown here use the same conda environments as described in the installation instructions!
Calculating per-image FSCs
We have created the cdrgn.py script as an example of how to calculate FSCs between volumes reconstructed by a cryoDRGN model and the ground truth volumes for each particle class in a CryoBench dataset. We generate volumes by selecting a given number of images from the dataset and then using the model decoder to return the volume for the latent space coordinates assigned to each image.
Note that we use 19 for the epoch number even though as epoch numbers are 0-indexed:
This will generate the following outputs in cryobench_output/IgG-1D/cryodrgn_fixed/:
Volumes vol_xxx.mrc generated by the cryoDRGN model for each of the chosen images (100 in this case due to -n 100)
A folder fsc_no_mask/ containing FSC curves calculated between the above reconstructed volumes and ground truth volumes stored in --gt-dir IgG-1D/vols/128_org/. These are stored as .txt files with a column for 1/resolution and a column for FSC values:
This will generate the same outputs as above β but the new FSCs will be placed in a subfolder named, in this case, fsc_mask/. In general, the _mask suffix will be replaced by the filename of the .mrc mask used.
You can also use cdrgn.py with an -o output folder that already contains generated volumes to recalculate FSCs with a mask, thus putting multiple sets of FSCs in the same output path. The script will skip volume generation in this case and proceed directly to FSC calculation unless the --overwrite flag is used.
Aligning volumes
Reconstructed volumes can be aligned to ground truth volumes using ChimeraX before calculating FSCs:
This will produce the same output as above, but also with a vol.x.txt file for each generated volume containing a log of the alignment process.
Volumes can also be aligned in parallel by submitting jobs to a Slurm compute cluster (if available) using the --parallel-align flag, which is advisable is using a large number of images as aligning all volumes serially can be time-consuming!
Plotting FSCs
To generate visualizations of the FSC curves at cryobench_output/IgG-1D/cryodrgn_fixed/:
This will plot the FSCs found in all fsc_*subfolders found in your CryoBench output folder, creating plots such as cryodrgn_fixed/fsc_no_mask.png and cryodrgn_fixed/fsc_no_mask_means.png:
Calculating Per-Conformation FSCs for Other Methods
In our repository we have included scripts for calculating FSC metrics for the other CryoBench example reconstruction methods using the original per-conformation method under metrics/fsc/old/per_conf/; we can provide scripts for calculating FSCs using the newer per-image method upon request!