ml-struct-bio / cryodrgn

Neural networks for cryo-EM reconstruction
http://cryodrgn.cs.princeton.edu
GNU General Public License v3.0
317 stars 76 forks source link

I can't use result from write_starfile.py #24

Closed kimdn closed 3 years ago

kimdn commented 4 years ago

Hi Ellen,

I can't generate mrcs from star file from cryodrgn. I did (cryodrgn) [kimd999@marianas to_extract_particles]$ python ~/script/python/cryoEM/cryodrgn/utils/write_starfile.py cryosparc_P122_J44_003_particles_cs_abs_w_mrcs_star.64.mrcs --ind ind_selected.pkl -o class1_from_cryodrgn.star ctf.pkl

Then I did (cryodrgn) [kimd999@marianas to_extract_particles]$ ~/bin/ccpem-20200722/bin/relion_stack_create --i class1_from_cryodrgn.star --o class1_from_cryodrgn_star.mrcs

However, it resulted in

in: /home/jenkins/workspace/CCP-EM/sl6_devtoolset/devtools/checkout/relion-ver3.1/src/jaz/obs_model.cpp, line 200
ERROR:
ERROR: not all necessary variables defined in _optics.star file: rlnPixelSize, rlnVoltage and rlnSphericalAberration. Make sure to convert older STAR files anew in version-3.1, with relion_convert_star.
=== Backtrace  ===
/qfs/people/kimd999/bin/ccpem-20200722/bin/../lib/librelion_lib.so(_ZN11RelionErrorC1ERKSsS1_l+0x49) [0x7f4c6092ef99]
/qfs/people/kimd999/bin/ccpem-20200722/bin/../lib/librelion_lib.so(_ZN16ObservationModelC2ERK13MetaDataTableb+0x476) [0x7f4c60cee9a6]
/qfs/people/kimd999/bin/ccpem-20200722/bin/../lib/librelion_lib.so(_ZN16ObservationModel10loadSafelyESsRS_R13MetaDataTableSsib+0x619) [0x7f4c60cf4e09]
/people/kimd999/bin/ccpem-20200722/bin/relion_stack_create(_ZN23stack_create_parameters3runEv+0x2d7c) [0x41b9cc]
/people/kimd999/bin/ccpem-20200722/bin/relion_stack_create(main+0x31) [0x4058f1]
/usr/lib64/libc.so.6(__libc_start_main+0xf5) [0x7f4c51055c05]
/people/kimd999/bin/ccpem-20200722/bin/relion_stack_create() [0x405a41]
==================
ERROR:
ERROR: not all necessary variables defined in _optics.star file: rlnPixelSize, rlnVoltage and rlnSphericalAberration. Make sure to convert older STAR files anew in version-3.1, with relion_convert_star.

Indeed I can't find rlnPixelSize in class1_from_cryodrgn.star.

I'm using relion 3.1

(cryodrgn) [kimd999@marianas to_extract_particles]$ ~/bin/ccpem-20200722/bin/relion_stack_create --version
RELION version: 3.1.0-commit-842729
Precision: BASE=double, CUDA-ACC=single

I'm pretty much sure that relion3.1 format star needs to have 2 sections anyway.

For example, relion3.1 star should have something like

# version 30001

data_optics

loop_
_rlnOpticsGroup #1
_rlnOpticsGroupName #2
_rlnAmplitudeContrast #3
_rlnSphericalAberration #4
_rlnVoltage #5
_rlnImageSize #6
_rlnImageDimensionality #7
           1 opticsGroup1     0.070000     2.700000   300.000000           64            2

# version 30001

data_particles

loop_
_rlnImageName #1
_rlnDefocusU #2
_rlnDefocusV #3
_rlnDefocusAngle #4
_rlnPhaseShift #5
_rlnOpticsGroup #6
19@cryosparc_P122_J44_003_particles_cs_abs_w_mrcs_star.64.mrcs 15314.800000 14930.100000     5.280000     0.000000            1
23@cryosparc_P122_J44_003_particles_cs_abs_w_mrcs_star.64.mrcs 15159.800000 14775.200000     5.280000     0.000000            1

While, I see 1 section in class1_from_cryodrgn.star

# Created 2020-10-14 07:10:00.521278

data_

loop_
_rlnImageName
_rlnDefocusU
_rlnDefocusV
_rlnDefocusAngle
_rlnVoltage
_rlnSphericalAberration
_rlnAmplitudeContrast
_rlnPhaseShift
19@cryosparc_P122_J44_003_particles_cs_abs_w_mrcs_star.64.mrcs 15314.8 14930.1 5.28 300.0 2.7 0.07 0.0
23@cryosparc_P122_J44_003_particles_cs_abs_w_mrcs_star.64.mrcs 15159.8 14775.2 5.28 300.0 2.7 0.07 0.0
zhonge commented 3 years ago

Sorry I completely missed seeing this issue until now... The script write_starfile.py only writes the older .star format. You'll need to use relion_convert_star to convert it to 3.1 format.