Skip to content

Commit

Permalink
CTFFind,MotionCorr: check for missing columns
Browse files Browse the repository at this point in the history
  • Loading branch information
biochem-fan committed Oct 27, 2020
1 parent 4e2f581 commit c7546fe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/ctffind_runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ void CtffindRunner::initialise()
MetaDataTable MDin;
ObservationModel::loadSafely(fn_in, obsModel, MDin, "micrographs", verb);

if (MDin.numberOfObjects() > 0 && !MDin.containsLabel(EMDL_MICROGRAPH_NAME))
REPORT_ERROR("ERROR: There is no rlnMicrographName label in the input micrograph STAR file.");

if (do_use_without_doseweighting && MDin.numberOfObjects() > 0 && !MDin.containsLabel(EMDL_MICROGRAPH_NAME_WODOSE))
REPORT_ERROR("ERROR: You are using --use_noDW, but there is no rlnMicrographNameNoDW label in the input micrograph STAR file.");

Expand Down
6 changes: 4 additions & 2 deletions src/filename.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,9 +600,11 @@ bool decomposePipelineSymlinkName(FileName fn_in, FileName &fn_pre, FileName &fn
if (!dont_expand && len != -1)
{
// This is a symbolic link!
if (linkname[len - 1] == '/')
linkname[len - 1] = '\0'; // remove trailing '/'

if (linkname[len - 1] == '/')
linkname[len - 1] = '\0'; // remove trailing '/'
linkname[len] = '\0';

FileName fn_link = std::string(linkname);
// TODO: FIXME: This condition is still not perfect. For example,
// Micrograph/mic001.mrc -> ../../../storage/mic001.mrc breaks the code.
Expand Down
2 changes: 2 additions & 0 deletions src/motioncorr_runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ void MotioncorrRunner::initialise()
{
MetaDataTable MDin;
ObservationModel::loadSafely(fn_in, obsModel, MDin, "movies", verb);
if (MDin.numberOfObjects() > 0 && !MDin.containsLabel(EMDL_MICROGRAPH_MOVIE_NAME))
REPORT_ERROR("The input STAR file does not contain the rlnMicrographMovieName column. Are you sure you imported files as movies, not single frame images?");

fn_micrographs.clear();
optics_group_micrographs.clear();
Expand Down

0 comments on commit c7546fe

Please sign in to comment.