meanshrink and lowpass on micrographs

299 views
Skip to first unread message

Daniel Calles

unread,
Aug 21, 2014, 4:17:05 PM8/21/14
to em...@googlegroups.com
Hi,

I started using Eman a few months ago to work on negative stain data but have recently started working with cryoEM data and I've started having some problems.

I wanted to know if there is a simple way to:

First, bin 200+ micrographs from terminal using e2proc2d, in one step.
I tried using meanshrink but could not do it other than one at a time, which is impractical.

Second, lowpass filter 200+ micrographs from terminal, just as before, in one step.
Again, I tried e2proc2d but could not do more than one at a time.

How do I process a lot of micrographs from the terminal in a "batch"mode? Preferably moving the new files to a new folder or adding something to their name.

Thanks,


Daniel.


Daniel E. Calles
PhD Student at McGill University
Montreal, Canada

Jason K

unread,
Aug 21, 2014, 7:13:22 PM8/21/14
to em...@googlegroups.com
e2proc2dmulti.py will do this in one step, BUT it overwrites the files.

Here's what I would do. Let's pretend micrographs are in hdf format (just change hdf to your actual format), you want meanshrink 2 and lowpass to 20Å.

mkdir processed; cp *.hdf ./processed; cd processed; e2proc2dmulti.py *.hdf --meanshrink=2 --process=filter.lowpass.gauss:cutoff_freq=0.05

Steven Ludtke

unread,
Aug 22, 2014, 9:08:35 AM8/22/14
to em...@googlegroups.com
Hi Daniel. Jason's suggestion is a good one. I would add that you can avoid over-writing the input files, by adding the --postfix option.

While this is a solution for this specific problem, as a more general suggestion, it is well worth your (or anyone's) time to learn a few simple shell-scripting constructs. They will make your life (unless you are using Windows) much easier with EMAN2 and pretty much any other command-line software. For example:

say you have the files a01.hdf - a99.hdf in the current directory, and you wish to shrink and low-pass each of them into a new folder with the same name, you could do this from your standard bash shell (if you use csh/tcsh, the syntax is slightly different):

mkdir newfiles

for i in *hdf
do
e2proc2d.py $i newfiles/$i --process=filter.lowpass.gauss:cutoff_freq=0.05 --meanshrink=2
done

There are many more advanced things you can do with this with just a few simple tricks. For example, if you also wanted to change the .hdf files to .mrc files in this operation:

for i in *hdf
do
e2proc2d.py $i newfiles/${i%%.hdf}.mrc --process=filter.lowpass.gauss:cutoff_freq=0.05 --meanshrink=2
done

There are many good guides on the web on shell scripting. Knowing a few of these tricks can save you a LOT of time and effort.



--
--
----------------------------------------------------------------------------------------------
You received this message because you are subscribed to the Google
Groups "EMAN2" group.
To post to this group, send email to em...@googlegroups.com
To unsubscribe from this group, send email to eman2+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/eman2

---
You received this message because you are subscribed to the Google Groups "EMAN2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eman2+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Calles

unread,
Aug 22, 2014, 9:24:35 AM8/22/14
to em...@googlegroups.com
Hi all,
Thank you so much for the help! I'll try it right away and will let you know if it goes smoothly.
I definitely need to work on my shell scripting, as right now I only know very basic things. I'm on Mac and sometimes use Linux as well, so scripting is going to be really useful.
I'll try your suggestions and let you know how it goes.
Thanks again!

Daniel.


You received this message because you are subscribed to a topic in the Google Groups "EMAN2" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/eman2/MRZNw6OSLo0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to eman2+un...@googlegroups.com.

Daniel Calles

unread,
Aug 22, 2014, 10:02:57 AM8/22/14
to em...@googlegroups.com
Hi again,
Thank you both for your help!
I used Steven's way to process all my data, running now with no problems at all.
Thanks!


Daniel.
Reply all
Reply to author
Forward
0 new messages