Skip to content

SWARM in e2boxer.py

Michael A. Cianfrocco edited this page Jun 7, 2018 · 1 revision

Home > Picking particles > Semi-automated picking in e2boxer.py

###Semi-automated particle using SWARM in EMAN2

Beyond manual picking, EMAN2's program e2boxer.py allows users to use 'SWARM' to pick particles. SWARM is a method that will pick particles that look similar to templates identified by the user. Once EMAN2 has developed a model of user-identified particles, EMAN2 can continue to use SWARM across multiple micrographs.

###Launching e2boxer.py on all micrographs

Semi-automated picking with e2boxer.py is straightforward & intuitive due to its graphical user interface (GUI).

To open a set of micrographs for picking, simply provide the wildcard-containing name alongside the e2boxer.py command:

$ e2boxer.py *.mrc 

This will open four windows:

  • A window containing your micrograph (left window below)
  • A blank window that will show picked particles (middle window below)
  • Main menu window (right window below)
  • A window with all of your micrographs as thumbnails (not shown below)

For the first micrograph, make sure that 'SWARM' from the Main menu window along with a diameter (in pixels) for your sample. To learn more about how to measure the diameter of your sample & picking a box size, read more here:

###Picking particles using SWARM

Within the first micrograph, start clicking 'good' particles. You'll notice that the program will place your selected particles in black, and then start to show other particles automatically in green. As you add more particles manually, you'll see that more green particles will appear.

These particles show in green boxes are the automatically picked particles:

Depending upon the homogeneity of your sample, you may or may not think that the automatic particle picking program is picking all of the 'good' particles on your grid. On the Main menu window you can decide to make SWARM more selective, or you can manually specify a threshold.

When SWARM has selected all particles in your micrograph that you want, you are finished for this micrograph.

Tips for using EMAN2:

  • To change the zoom on the micrograph, simply scroll your mouse wheel OR right click image and adjust 'magnification.'
  • To remove particles that you don't want, you can press the 'Clear' button in the menu to remove all particle picks.

###Running SWARM on each micrograph in dataset

After SWARM has picked all the particles you wanted, you can transfer the SWARM picking model onto other micrographs in your dataset.

To make SWARM pick the particles automatically in your other micrographs, go to the window showing thumbnails of your micrographs. Just click on other micrographs, and then you will see green boxes appear on the new micrograph.

Continue to do this for all micrographs in your dataset.

###Saving particles

When you are ready to save your particles, you have two choices for the output format from EMAN2:

  1. Extracting particle stacks
  2. Coordinate files (e.g. .box) containing the X & Y coordinates for each particle within the micrograph

To specify either output option, first you need to click the 'Write Output' button within the Main menu window.

This will open a new window. You must perform the following actions:

  • Select the micrograph from which you will extract/save particles (micrograph(s) that are highlighted are 'selected')
  • Specify if the output is a particle stack or particle X & Y coordinates
  • Specify the output box size
  • Specify the output particle stack format (if applicable)
  • Specify the type of image normalization (read about normalization here)
  • Specify output suffix

####Saving output as particle stack

You can save your particles directly into a particle stack that is .img/hed, .spi, or other formats (read more about file formats here).

Make sure to select each micrograph in the list that you want particles extracted from. This means that if you picked 100 micrographs, you'll need to make sure 100 micrographs are selected (highlighted in blue) in this window.

#####Output location The output particle stacks will be within a directory below where your micrograph is located. If you micrograph is located in /home/micros, then your stacks will be in directory /home/micros/particles named with the same base name as the micrograph.

Each micrograph will have its own particle stack created, which means you will have to combine these together into a single stack.

Pros:

  • This method allows you to extract directly your particles that you just picked
  • EMAN2's SWARM program help you pick many more particles than you would've wanted to pick manually.

Cons:

  • You have to click each micrograph that needs to be analyzed by SWARM

####Saving output as particle coordinate file (.box)

Instead of saving the particle stack, you can save the X & Y coordinates of the particles you just picked in a text file with the .box extension. By saving .box files for all of your micrographs, you can extract your particles into a single stack using a single command.

#####Output location

This coordinate file will be within the same directory as your micrographs. If your micrographs are located in /home/micros, then your coordinate file will be in directory /home/micros named with the same base name as the micrograph and the extension of .box.

Pros:

  • This method allows you to using the makeStack.py command to extract all of your particles from multiple micrographs simultaneously, while also giving the option to perform CTF correction of the extracted particles.

Cons:

  • You will only get coordinate files as outputs, so you can't see your particle stack until later when you extract all of your data.
Clone this wiki locally