Skip to content

Tips and tricks

Juha Huiskonen edited this page Mar 26, 2017 · 25 revisions

Removing all but one subparticle by partial signal subtraction

First create all symmetry related particles and save the orientations in a new STAR file:

relion_create_symmetry_related_particles.py --sym C12 /
--output particles_C12.star particles.star

Then create a mask that removes one subparticle from the particle reconstruction.

xmipp_localized_reconstruction_mask.py --vector 1,0,0 /
--length 100 --particle_size 256 --radius 40

Apply the mask on the particle reconstruction using your favourite software. Then run the relion_localized_reconstruction.py normally using the same parameters you used for creating the mask, and C1 symmetry for the particle (as now your particle is asymmetric) that is then used for subtracting the particle (and all but one subparticles) density from the raw particle images.

If your substructures locate on symmetry axis, you will end up having duplicate subparticles extracted. To remove the duplicates from your subparticle.star file run:

scipion run relion_remove_overlapping_particles.py --mindist 1 --originalParticles --output subparticles_unique.star subparticles.star

Reorienting all particles

Sometimes it is necessary to rotate all particles into a new symmetry convention. For example, a particle with D8 symmetry has an 8-fold symmetry axis aligned on the Z-axis and 2-fold symmetry axis on the X-axis (and also on the Y-axis). This example shows how to align the particles so that the 2-fold axis becomes aligned from the X-axis on the Z-axis.

First, it is necessary to relax the symmetry of the original symmetry group. Each of the original orientations is randomised over all the orientations that are equivalent in the D8 symmetry group:

scipion run relion_create_symmetry_particles.py --sym D8 --random --output particles_relax.star particles.star

Next, the particles orientations can be rotated, either by providing a vector or three Euler angles. Each particle will be oriented so that after reconstruction, the resulting map is in a new symmetry convention. To orient the symmetry axis from the X-axis to the Z-axis, use the following command:

scipion run relion_rotate_particles.py --vector 1,0,0 --output particles_relax_rot.star particles_relax.star

To check that this has worked, use relion_reconstruct to reconstruct with C2 symmetry. The reconstruction is now in the C2-symmetry convention.

If a rotation around all three Euler angles is required, instead of the --vector option use the --angles option. For example, if a 90-degree rotation around the Z-axis is required, use the following command:

scipion run relion_rotate_particles.py --angles 0,90,90 --output particles_relax_rot.star particles_relax.star

This will align the map as above, but it will be rotated 90 degrees around the Z-axis.

Using the in-built STAR file Python parser

The packages includes PyRelion, a Python parser for RELION-style STAR files. This example shows how to use the parser from Scipion and how to copy one column to another column (here GroupNumber is copied to GroupName).

Launch Python from Scipion (or use system's default python instead and make sure PyRelion is in PYTHONPATH):

scipion python

The type the following commands in the Python command prompt:

from pyrelion import MetaData
md = MetaData("input.star")
for particle in md:
     particle.rlnGroupName = particle.rlnGroupNumber
md.addLabels('rlnGroupName')
md.write("groups.star")

Instead of using the command prompt, you may want to create a script for running it later:

gedit add_group.py

And then add the following commands (the only difference is the first line):

#!/usr/bin/env python

from pyrelion import MetaData
md = MetaData("input.star")
for particle in md:
     particle.rlnGroupName = particle.rlnGroupNumber
md.addLabels('rlnGroupName')
md.write("groups.star")

And then run it:

scipion run add_group.py
Clone this wiki locally