Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reextracting refine3D data star particles from fresh MotionCorr not working anymore #524

Closed
xeniorn opened this issue Oct 21, 2019 · 10 comments

Comments

@xeniorn
Copy link

xeniorn commented Oct 21, 2019

Trying to re-extract particles from a data.star file from Refine3D in relion 3.0.6 in 3.1.

I made a new project and re-did motionCorr and CtfFind from scratch.

I copied the data.star to the new project folder and adjusted the rlnMicrographName to the path of the fresh MotionCorr and CtfFind.

Got a "ObservationModel::getBoxSize: box sizes not available" error.

Thought it might be because in the new version it is trying to read the box size from the mrcs files. Adjusted the rlnImagePath in the imported star file so that it points to the locations of the mrcs files in the old project folder. Confirmed "Display" works for these particles from relion 3.1 gui. Still got the same error.

head of Import/job004/from_190919_struct_A_job070_data.star:


# version 30001

data_optics

loop_ 
_rlnOpticsGroup #1 
_rlnOpticsGroupName #2 
_rlnAmplitudeContrast #3 
_rlnSphericalAberration #4 
_rlnVoltage #5 
_rlnImagePixelSize #6 
_rlnMicrographOriginalPixelSize #7 
           1 opticsGroup0     0.100000     2.700000   300.000000     1.040000     1.040000 
 

# version 30001

data_particles

loop_ 
_rlnCoordinateX #1 
_rlnCoordinateY #2 
_rlnClassNumber #3 
_rlnAutopickFigureOfMerit #4 
_rlnAnglePsi #5 
_rlnImageName #6 
_rlnMicrographName #7 
_rlnCtfMaxResolution #8 
_rlnCtfFigureOfMerit #9 
_rlnDefocusU #10 
_rlnDefocusV #11 
_rlnDefocusAngle #12 
_rlnCtfBfactor #13 
_rlnCtfScalefactor #14 
_rlnPhaseShift #15 
_rlnGroupNumber #16 
_rlnAngleRot #17 
_rlnAngleTilt #18 
_rlnNormCorrection #19 
_rlnLogLikeliContribution #20 
_rlnMaxValueProbDistribution #21 
_rlnNrOfSignificantSamples #22 
_rlnGroupName #23 
_rlnRandomSubset #24 
_rlnOpticsGroup #25 
_rlnOriginXAngst #26 
_rlnOriginYAngst #27 
 2109.064097  1040.852245            1     0.234056   157.981947 000005@old_folder_path/relion/Extract/job055/sourceMicrographs/59-100_001.mrcs MotionCorr/job002/raw_micrographs/59-100_001.mrc     3.858064     0.041814 18352.322266 18249.996094    -34.02842     0.000000     1.000000     0.000000            1   -166.75503    91.249555     0.733196 4.910379e+05     0.099443           54   group_25            2            1     1.299797     0.707777 
 

head of CtfFind/job003/micrographs_ctf_beamtilt.star:


# version 30001

data_optics

loop_ 
_rlnOpticsGroupName #1 
_rlnOpticsGroup #2 
_rlnMtfFileName #3 
_rlnMicrographOriginalPixelSize #4 
_rlnVoltage #5 
_rlnSphericalAberration #6 
_rlnAmplitudeContrast #7 
_rlnMicrographPixelSize #8 
opticsGroup1            1 MTF_K2summit_300kV.star     1.040000   300.000000     2.700000     0.100000     1.040000 
 

# version 30001

data_micrographs

loop_ 
_rlnMicrographName #1 
_rlnOpticsGroup #2 
_rlnCtfImage #3 
_rlnDefocusU #4 
_rlnDefocusV #5 
_rlnCtfAstigmatism #6 
_rlnDefocusAngle #7 
_rlnCtfFigureOfMerit #8 
_rlnCtfMaxResolution #9 
_rlnBeamTiltClass #10 
MotionCorr/job002/raw_micrographs/59-100_001.mrc 1 CtfFind/job003/raw_micrographs/59-100_001_PS.ctf:mrc 18365.607422 18268.240234 97.367188 80.936073 0.030488 3.127851 1

Environment:

  • OS: CentOS 7
  • MPI runtime: OpenMPI 2.0.2
  • RELION version v3.1-beta-b86482c
  • Memory: 13GB per core
  • GPU: /

Dataset:

  • Box size: 352
  • Pixel size: 1.04 Å/px
  • Number of particles: [e.g. 150,000]

Job options:

  • Type of job: [e.g. Extract]
  • Number of MPI processes: any
  • Number of threads: any
  • Full command (see note.txt in the job directory):
$(which relion_preprocess_mpi) --i CtfFind/job003/micrographs_ctf_beamtilt.star --reextract_data_star Import/job004/from_190919_struct_A_job070_data.star --recenter --recenter_x 0 --recenter_y 0 --recenter_z 0 --part_star Extract/job006/particles.star --part_dir Extract/job006/ --extract --extract_size 352 --norm --bg_radius 160 --white_dust -1 --black_dust -1 --invert_contrast  --only_do_unfinished   --pipeline_control Extract/job006/ && echo CtfFind/job003/micrographs_ctf_beamtilt.star > Extract/job006/coords_suffix_extract.star

Error message:

Please cite the full error message as the example below.

in: /software/build-tmp/RELION/v3.1-beta-b86482c/foss-2017a-CUDA-9.1.85/relion-b86482c458d88425594a7b1eab0709ca21f487c1/src/jaz/obs_model.cpp, line 650
ERROR: 
ObservationModel::getBoxSize: box sizes not available

in: /software/build-tmp/RELION/v3.1-beta-b86482c/foss-2017a-CUDA-9.1.85/relion-b86482c458d88425594a7b1eab0709ca21f487c1/src/jaz/obs_model.cpp, line 650
ERROR: 
ObservationModel::getBoxSize: box sizes not available

in: /software/build-tmp/RELION/v3.1-beta-b86482c/foss-2017a-CUDA-9.1.85/relion-b86482c458d88425594a7b1eab0709ca21f487c1/src/jaz/obs_model.cpp, line 650
ERROR: 
ObservationModel::getBoxSize: box sizes not available

in: /software/build-tmp/RELION/v3.1-beta-b86482c/foss-2017a-CUDA-9.1.85/relion-b86482c458d88425594a7b1eab0709ca21f487c1/src/jaz/obs_model.cpp, line 650
ERROR: 
ObservationModel::getBoxSize: box sizes not available

in: /software/build-tmp/RELION/v3.1-beta-b86482c/foss-2017a-CUDA-9.1.85/relion-b86482c458d88425594a7b1eab0709ca21f487c1/src/jaz/obs_model.cpp, line 650
ERROR: 
ObservationModel::getBoxSize: box sizes not available

in: /software/build-tmp/RELION/v3.1-beta-b86482c/foss-2017a-CUDA-9.1.85/relion-b86482c458d88425594a7b1eab0709ca21f487c1/src/jaz/obs_model.cpp, line 650
ERROR: 
ObservationModel::getBoxSize: box sizes not available

in: /software/build-tmp/RELION/v3.1-beta-b86482c/foss-2017a-CUDA-9.1.85/relion-b86482c458d88425594a7b1eab0709ca21f487c1/src/jaz/obs_model.cpp, line 650
ERROR: 
ObservationModel::getBoxSize: box sizes not available

=== Backtrace  ===
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN11RelionErrorC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_l+0x66) [0x425366]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZNK16ObservationModel10getBoxSizeEi+0x5b) [0x465bdb]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN13Preprocessing33extractParticlesFromOneMicrographER13MetaDataTable8FileNameiS2_S2_RllRdS4_S4_S4_+0x3653) [0x44ddb3]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN13Preprocessing31extractParticlesFromFieldOfViewE8FileNamel+0x8cd) [0x44ef9d]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN16PreprocessingMpi19runExtractParticlesEv+0x565) [0x45f3d5]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN16PreprocessingMpi3runEv+0x12) [0x45f692]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(main+0x3b) [0x41d68b]
/lib64/libc.so.6(__libc_start_main+0xf5) [0x2aaab767cc05]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi() [0x41dfef]
==================
ERROR: 
ObservationModel::getBoxSize: box sizes not available

=== Backtrace  ===
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN11RelionErrorC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_l+0x66) [0x425366]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZNK16ObservationModel10getBoxSizeEi+0x5b) [0x465bdb]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN13Preprocessing33extractParticlesFromOneMicrographER13MetaDataTable8FileNameiS2_S2_RllRdS4_S4_S4_+0x3653) [0x44ddb3]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN13Preprocessing31extractParticlesFromFieldOfViewE8FileNamel+0x8cd) [0x44ef9d]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN16PreprocessingMpi19runExtractParticlesEv+0x565) [0x45f3d5]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN16PreprocessingMpi3runEv+0x12) [0x45f692]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(main+0x3b) [0x41d68b]
/lib64/libc.so.6(__libc_start_main+0xf5) [0x2aaab767cc05]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi() [0x41dfef]
==================
ERROR: 
ObservationModel::getBoxSize: box sizes not available

=== Backtrace  ===
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN11RelionErrorC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_l+0x66) [0x425366]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZNK16ObservationModel10getBoxSizeEi+0x5b) [0x465bdb]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN13Preprocessing33extractParticlesFromOneMicrographER13MetaDataTable8FileNameiS2_S2_RllRdS4_S4_S4_+0x3653) [0x44ddb3]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN13Preprocessing31extractParticlesFromFieldOfViewE8FileNamel+0x8cd) [0x44ef9d]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN16PreprocessingMpi19runExtractParticlesEv+0x565) [0x45f3d5]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN16PreprocessingMpi3runEv+0x12) [0x45f692]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(main+0x3b) [0x41d68b]
/lib64/libc.so.6(__libc_start_main+0xf5) [0x2aaab767cc05]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi() [0x41dfef]
==================
ERROR: 
ObservationModel::getBoxSize: box sizes not available

=== Backtrace  ===
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN11RelionErrorC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_l+0x66) [0x425366]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZNK16ObservationModel10getBoxSizeEi+0x5b) [0x465bdb]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN13Preprocessing33extractParticlesFromOneMicrographER13MetaDataTable8FileNameiS2_S2_RllRdS4_S4_S4_+0x3653) [0x44ddb3]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN13Preprocessing31extractParticlesFromFieldOfViewE8FileNamel+0x8cd) [0x44ef9d]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN16PreprocessingMpi19runExtractParticlesEv+0x565) [0x45f3d5]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN16PreprocessingMpi3runEv+0x12) [0x45f692]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(main+0x3b) [0x41d68b]
/lib64/libc.so.6(__libc_start_main+0xf5) [0x2aaab767cc05]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi() [0x41dfef]
==================
ERROR: 
ObservationModel::getBoxSize: box sizes not available

=== Backtrace  ===
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN11RelionErrorC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_l+0x66) [0x425366]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZNK16ObservationModel10getBoxSizeEi+0x5b) [0x465bdb]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN13Preprocessing33extractParticlesFromOneMicrographER13MetaDataTable8FileNameiS2_S2_RllRdS4_S4_S4_+0x3653) [0x44ddb3]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN13Preprocessing31extractParticlesFromFieldOfViewE8FileNamel+0x8cd) [0x44ef9d]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN16PreprocessingMpi19runExtractParticlesEv+0x565) [0x45f3d5]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN16PreprocessingMpi3runEv+0x12) [0x45f692]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(main+0x3b) [0x41d68b]
/lib64/libc.so.6(__libc_start_main+0xf5) [0x2aaab767cc05]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi() [0x41dfef]
==================
ERROR: 
ObservationModel::getBoxSize: box sizes not available

=== Backtrace  ===
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN11RelionErrorC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_l+0x66) [0x425366]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZNK16ObservationModel10getBoxSizeEi+0x5b) [0x465bdb]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN13Preprocessing33extractParticlesFromOneMicrographER13MetaDataTable8FileNameiS2_S2_RllRdS4_S4_S4_+0x3653) [0x44ddb3]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN13Preprocessing31extractParticlesFromFieldOfViewE8FileNamel+0x8cd) [0x44ef9d]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN16PreprocessingMpi19runExtractParticlesEv+0x565) [0x45f3d5]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN16PreprocessingMpi3runEv+0x12) [0x45f692]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(main+0x3b) [0x41d68b]
/lib64/libc.so.6(__libc_start_main+0xf5) [0x2aaab767cc05]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi() [0x41dfef]
==================
ERROR: 
ObservationModel::getBoxSize: box sizes not available

=== Backtrace  ===
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN11RelionErrorC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_l+0x66) [0x425366]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZNK16ObservationModel10getBoxSizeEi+0x5b) [0x465bdb]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN13Preprocessing33extractParticlesFromOneMicrographER13MetaDataTable8FileNameiS2_S2_RllRdS4_S4_S4_+0x3653) [0x44ddb3]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN13Preprocessing31extractParticlesFromFieldOfViewE8FileNamel+0x8cd) [0x44ef9d]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN16PreprocessingMpi19runExtractParticlesEv+0x565) [0x45f3d5]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(_ZN16PreprocessingMpi3runEv+0x12) [0x45f692]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi(main+0x3b) [0x41d68b]
/lib64/libc.so.6(__libc_start_main+0xf5) [0x2aaab767cc05]
/software/171020/software/relion/v3.1-beta-b86482c-foss-2017a-cuda-9.1.85/bin/relion_preprocess_mpi() [0x41dfef]
==================
ERROR: 
ObservationModel::getBoxSize: box sizes not available


@biochem-fan
Copy link
Member

in the new version it is trying to read the box size from the mrcs files.

Yes.

Adjusted the rlnImagePath in the imported star file so that it points to the locations of the mrcs files in the old project folder.

Did you do this before import?

Another way is to convert STAR files by relion_convert_star in the old project directory first and then import the output.

@biochem-fan
Copy link
Member

The Import job should have written a warning:

Warning: not all image files could be found.
         Image sizes and dimensionalities will be missing from the star file.

If didn't, please let me know.

@xeniorn
Copy link
Author

xeniorn commented Oct 21, 2019

I did it after import, but I modified the star file in the Import/job004 folder, not the original one I selected for import. I assume this can't make a difference?

My workaround was to extract coordinates for each referenced micrograph and import those coordinates. This works well. Not sure which info I'm losing though? Tilt / Rot information seems to be lost on re-extraction anyhow. Are rlnGroupNumber/Name preserved after reextract normally?

#!/bin/bash

set -eu

inputStar=$1
targetFolder=$2

micrographsFile=${targetFolder}'/micrographs.tmp'

extension='_manualpick'

header='data_

loop_
_rlnCoordinateX #1
_rlnCoordinateY #2
_rlnClassNumber #3
_rlnAnglePsi #4
_rlnAutopickFigureOfMerit #5'

timestamp=$(date +%N)

columnX=$(grep -F --max-count=1 '_rlnCoordinateX' ${inputStar} | awk -F " #" '{print $2}' | sed -r 's|\s||g')
columnY=$(grep -F --max-count=1 '_rlnCoordinateY' ${inputStar} | awk -F " #" '{print $2}' | sed -r 's|\s||g')
columnMicrograph=$(grep -F --max-count=1 '_rlnMicrographName' ${inputStar} | awk -F " #" '{print $2}' | sed -r 's|\s||g')

micrographs=$(awk '{if(NF>10){print $'${columnMicrograph}'}}' ${inputStar} | uniq)

for currentMicrograph in ${micrographs}; do

        targetDir=${targetFolder}'/'$(dirname ${currentMicrograph})

        echo "Doing $currentMicrograph"

        if [ ! -d ${targetDir} ]; then
                mkdir -p ${targetDir}
        fi

        currentOut=${targetDir}'/'$(basename ${currentMicrograph} | sed -r 's|(.+)\.mrc|\1'${extension}'.star|')

        echo "${header}" >${currentOut}

        grep -F ${currentMicrograph} ${inputStar} | awk '
        BEGIN {
                colX='${columnX}';
                colY='${columnY}'
                }
                {
                if(NF>10){
                        print $colX" "$colY" -999 -999.000 -999.000"
                        }
                }' >>${currentOut} &

done

Regarding box sizes - the approach seems to be kind of mixed now. Both pixel size and box size are encoded in .mrc files, but you are reading pixel size from the star file, and the box size from the mrcs file. Do you think it would make sense rather to consolidate it and include rlnImageBoxSize as a metadata parameter rather than reading mrcs files?

Best

J

@xeniorn
Copy link
Author

xeniorn commented Oct 21, 2019

in: /software/build-tmp/RELION/v3.1-beta-b86482c/foss-2017a-CUDA-9.1.85/relion-b86482c458d88425594a7b1eab0709ca21f487c1/src/image.h, line 272 ERROR: Cannot read file Extract/job055/MotionCorr/job002/raw_micrographs/59-100_001.mrcs It does not exist Warning: 000005@Extract/job055/MotionCorr/job002/raw_micrographs/59-100_001.mrcs not found. Warning: not all image files could be found. Image sizes and dimensionalities will be missing from the star file.

This was reported on import, yes

@xeniorn
Copy link
Author

xeniorn commented Oct 21, 2019

Tried importing the "fixed" star file. There was no error in import this time.

I'm still getting the error on attempt to reextract.

There is a possibility it's due to soft links in the path I guess? I have encountered this in the past.

@biochem-fan
Copy link
Member

When you imported the fixed STAR file, does the output has the rlnImageBoxSize column?

The box size is determined when a file is converted from 3.0 to 3.1 during Import. Thus, the image files must be available when importing.

soft links

Did you use the full path in the link? ln -s ../../XXX is bad, please use ln -s /full/path/to/XXX.

@biochem-fan
Copy link
Member

Both pixel size and box size are encoded in .mrc files, but you are reading pixel size from the star file, and the box size from the mrcs file.

Earlier versions of RELION (and some external programs) didn't write the pixel size to the MRCS header. Thus we don't trust the field.

@xeniorn
Copy link
Author

xeniorn commented Oct 21, 2019

When you imported the fixed STAR file, does the output has the rlnImageBoxSize column?

Ok, I see I made a mistake now. I tried to reimport the file that I fixed in the Import folder, and that one didn't work because it already had the optics table without the image dimensions. When I fixed the original and imported it fixed, it did work in the end.

Did you use the full path in the link? ln -s ../../XXX is bad, please use ln -s /full/path/to/XXX.

using relative paths in links, because we have diferent mount points in different systems, and absolute paths would only work in one (/absolute/path/no1/parent1/parent2/target vs /i/am/mounted/differently/parent1/parent2/target). Relative paths work very well in this case, even Windows resolves them correctly. Most programs we use are (or seem) agnostic to whether the file is a symlink or not, and agnostic to how the symlink is defined. If the shell can see and resolve it properly, so do the programs. Not sure why is this not the case with relion, but I assume you do some kind of optimized file access which makes it behave this way.

I also tried first continuing the last iteration of the refinement in the old project. It gave me the correct star file incl box size (I see now it's a part of an optics group). This one imports and reextracts correctly in the new folder as well.

Thanks for your answers!

@xeniorn
Copy link
Author

xeniorn commented Oct 21, 2019

To note, in the end the symlinks were not an issue (even though it's nested symlinks some of which have relative paths).

@biochem-fan
Copy link
Member

biochem-fan commented Oct 21, 2019

(I edited your markup)

Ok, I see I made a mistake now. I tried to reimport the file that I fixed in the Import folder, and that one didn't work because it already had the optics table without the image dimensions. When I fixed the original and imported it fixed, it did work in the end.

Yes. This makes sense.

Relative paths

The problem is that RELION tries to expand symbolic links for job aliases into real paths (e.g. Refine3D/class1 => Refine3D/job123). We do our best to keep symbolic links to somewhere outside the project directory (../somewhere/Refine3D/class1) but there are many corner cases this fails. Relative links sometimes work, but absolute links are always safer (because we never expand anything starting from /).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants