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

ctffind_runner better error message #1212

Merged
merged 2 commits into from
Nov 29, 2024

Conversation

huwjenkins
Copy link
Contributor

Possible fix for issues like #1167? When CTFFIND fails to fit CTF parameters for all input micrographs (i.e. MDctf is empty) exit with an error rather than failing later.

@huwjenkins
Copy link
Contributor Author

Note I only tested for the SPA case but based on the contents of the file written here:

else
{
obsModel.save(MDctf, fn_out + "micrographs_ctf.star", "micrographs");
}

I guess for tomo the underlying issue is the same

@biochem-fan
Copy link
Member

@huwjenkins Thank you very much.
Can you also add LC_ALL=C to the CTFFIND caller script written by this wrapper?

@huwjenkins
Copy link
Contributor Author

@biochem-fan is there a syntax that works for all possible shells? The user can choose this via RELION_SHELL environment variable:

fn_shell = "/bin/sh";
char *shell_name;
shell_name = getenv("RELION_SHELL");
if (shell_name != NULL)
fn_shell = (std::string)shell_name;

@biochem-fan
Copy link
Member

The user can choose this via RELION_SHELL environment variable

Oh, that is a pain.

Does env LC_ALL=C ctffind ... work?

@huwjenkins
Copy link
Contributor Author

It worked when RELION_SHELL was unset but when I put

export RELION_SHELL=/bin/csh

in my SLURM submission script then although CTFFIND doesn't segfault, it doesn't run:

        **   Welcome to Ctffind   **

            Version : 4.1.14
           Compiled : May  8 2020
               Mode : Scripted

Input image file name                              :
Error: File does not exist, please provide an existing file!


 Error: Running as script, and answer is not recognized...

In fact the same behaviour occurs without my changes and using a version of CTFFIND I know works.

@huwjenkins
Copy link
Contributor Author

export RELION_SHELL="/bin/csh -f"

worked, so I think it was a local issue. I've added the suggested env LC_ALL=C

@biochem-fan biochem-fan merged commit 745ac29 into 3dem:ver5.0 Nov 29, 2024
0 of 4 checks passed
@biochem-fan
Copy link
Member

Thank you very much for your contribution. I merged your patches.

@huwjenkins
Copy link
Contributor Author

Thanks! FWIW CTFFind 5.0.2 from https://grigoriefflab.umassmed.edu doesn't need the LC_ALL=C workaround so this change shouldn't be propagated to a future CtffindRunner::executeCtffind5()

@huwjenkins huwjenkins deleted the ctffind_runner-better-error branch December 3, 2024 10:53
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

Successfully merging this pull request may close these issues.

2 participants