How to generate a sub-stack from the relion image stack file in mrc format

Forums

Hello Niko and others,

I'm preparing the par file and sub-stack image file from relion to run 3D classification in Frealign. Now I have successfully convert
the relion star file using the script in your site, and realized that the new frealign par file does not have particle numbers corresponding to the image numbers in the relion star file. This means I cannot use the whole image stack because the star file I used only include part of the particles in original image stack. So the question is how can I generate a new image stack (sub-stack) file that have particles corresponding to the particles in the star file that was used to convert to Frealign par file?

Thank you very much!

Zongli

In reply to by Alexis

Hi Alexis,

Thanks!

I have used "newstack" before. It seems I have to have some kind of script to extract the particle numbers from the relion star file and then use is as an input to "newstack", right?

Best,

Zongli

In reply to by zli25

I guess you mean that you haven't used it before.

Yes, as explained in the documentation page I linked to previously, you can use the option -fileinlist to tell newstack which locations in the input stack you want to copy to the output stack. The documentation for this option defines exactly what format of the list you need to create

-fileinlist (-filei) OR -FileOfInputs    File name
              Name of file with list of input files and sections to read.  The
              format of the file is the number of input files on the first
              line, the first file to read on the next line, the list of sec-
              tions to read on next line, next filename on next line, etc.  If
              this option is used, no input filenames may be specified with
              the -input option or following options on the command line.

You will have to extract this information from your Relion star files I guess.

Note that by default newstack counts image locations from 0. If that's not convenient, remember to use option -fromone when using newstack. Again, this is documented in the page linked to previously.

Hope this helps
Alexis