Skip to content

Releases: ml-struct-bio/CryoBench

Version 0.2: Refactoring to improve user experience, introducing per-image FSC analyses

14 Dec 01:05

Choose a tag to compare

In this release we have applied a refactoring to the per-conformation FSC analyses and also moved them to be under metrics/fsc/old/per_conf/; we have also added the new per-image version of the FSC analyses for CryoDRGN outputs at metrics/fsc/cdrgn.py.

The main goal of the refactoring was to simplify the experience for CryoBench users, and especially to wherever possible reduce the number of commands necessary to run a particular analysis. For example, under version 0.1, running per-conformation FSC analyses for DRGN-AI ab-initio outputs entailed:

$ python metrics/per_conf_fsc/drgnai_abinit_gen_vol.py CryoBench/Conf-Het/drgnai/002_ab-initio/ --epoch 30 --Apix 3.0 -o CryoBench/Conf-Het/drgnai/002_ab-initio/out/cryobench_orig.30/ --method drgnai_abinit --gt-dir IgG-1D/vols/128_org/ --num-imgs 1000 --num-vols 100
$ python metrics/utils/align_multi.py CryoBench/Conf-Het/drgnai/002_ab-initio/out/cryobench_orig.30/drgnai_abinit/per_conf_fsc/vols/ --apix 3.0 --org-vol IgG-1D/vols/128_org/
$ python metrics/per_conf_fsc/drgnai_abinit_after_align.py -o CryoBench/Conf-Het/drgnai/002_ab-initio/out/cryobench_orig.30 --method drgnai_abinit --gt-dir CryoBench/datasets/IgG-1D/vols/128_org/ --mask /IgG-1D/init_mask/mask.mrc
$ python metrics/per_conf_fsc/per_conf_plot.py CryoBench/Conf-Het/drgnai/002_ab-initio/out/cryobench_orig.30/ --method drgnai_abinit

whereas now the following set of commands suffice to generate the per-conformation volumes, align them, and then calculate and plot FSCs against ground truth volumes:

$ python metrics/fsc/old/per_conf/drgnai.py CryoBench/Conf-Het/drgnai/002_ab-initio/ --epoch 30 --Apix 3.0 -o CryoBench/Conf-Het/drgnai/002_ab-initio/out/cryobench_confs.30/ --gt-dir IgG-1D/vols/128_org/ --num-imgs 1000 --num-vols 100 --mask IgG-1D/init_mask/mask.mrc --align-vols
$ python metrics/fsc/plot_fsc.py CryoBench/Conf-Het/drgnai/002_ab-initio/out/cryobench_confs.30/aligned/

Another example is with analyzing Ribosembly outputs, which previously required a separate set of analysis scripts:

$ python metrics/per_conf_fsc_Ribosembly/cdrgn.py CryoBench/Ribosembly/cryodrgn/001_train-vae/ -o CryoBench/Ribosembly/cryodrgn/001_train-vae/cryobench.19 --epoch 19 --method cryodrgn --mask Ribosembly/init_mask/mask.mrc --gt-dir Ribosembly/vols/128_org/
$ python metrics/per_conf_fsc/per_conf_plot.py CryoBench/Ribosembly/cryodrgn/001_train-vae/cryobench.19/ --method cryodrgn

but now can be done using the same commands used for all CryoBench datasets:

$ python metrics/fsc/old/per_conf/cdrgn.py CryoBench/Ribosembly/cryodrgn/001_train-vae/ --epoch 19 -o CryoBench/Ribosembly/cryodrgn/001_train-vae/cryobench-new.19/ --gt-dir Ribosembly/vols/128_org/ --mask Ribosembly/init_mask/mask.mrc --num-imgs 1000 --num-vols 16
$ python metrics/fsc/plot_fsc.py CryoBench/Ribosembly/cryodrgn/001_train-vae/cryobench-new.19/vols/

More detailed instructions for how to run the new set of commands can now be found at our new documentation portal!

Other changes to the codebase include:

  • improved code style and documentation of modules and methods
  • replacing copied reconstruction method subfolders under metrics/methods/ with git submodules so e.g. the exact version used for OPUS-DSD and RECOVAR can be tracked, and improving installation instructions so that metrics/methods/cryodrgn/ can be removed
  • adding better control over alignment of generated volumes prior to calculating FSC metrics with --serial-align and --parallel-align
  • nicer aesthetics for FSC plots, and adding plots of distributions of FSC values:

fsc_no_mask_means

Version 0.1

21 Aug 17:39

Choose a tag to compare

Initial release