Skip to content

Tips and tricks

Juha Huiskonen edited this page Jul 30, 2016 · 25 revisions

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")
Clone this wiki locally