Skip to content

Tips and tricks

Juha Huiskonen edited this page Aug 2, 2016 · 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.

relion_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 normally using the same parameters you used for creating the mask, and C1 symmetry for the particle (as now your particle is asymmetric).

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")

Make the script executable:

chmod 755 add_group.py

And then run it:

scipion run ./add_group.py
Clone this wiki locally