batch mode for ctffind4

Dear Alexis/Niko

I haven't used either ctffind3 or ctffind4 before. I'd like to try the latter on a series of micrographs in a single step. Could you please tell me how to do so, or provide a script (I don't have much scripting experience)?

Thank you

Taha

Hi Taha,

For any command-line-based program in unix/linux, you can use "here documents", which are described e.g. at this page.

The idea is that you write in the script every line that you would type at the terminal if you were running the program interactively.

So for example, if ctffind only asked 3 questions - 1 - input file, 2 - minimum defocus, 3 - maximum defocus, then you could write something like:

ctffind.exe 

where 10000.0 (Angstroms) is the minimum defocus value, 50000.0 is the maximum defocus value.

Obviously, there are many more lines to "feed" to ctffind, but I hope you get the idea.

Once you have this syntax working for a single run of ctffind, you just need to write loop syntax around this. See for example this tutorial. So then you would have something like:

for input_fn in /path/to/my/micrographs*.mrc
do 
ctffind.exe 

Hope this helps - good luck!
Alexis