Grouping procedure: Difference between revisions
(Created page with "== What are groups for? == If you're going to group micrographs together it is important to understand what groups are used for inside RELION. Although you may be familiar wi...") |
|||
(12 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
== | == Overview == | ||
The procedure is as follows: | |||
* Generate a text file with the rlnMicrographName for each micrograph in the data set, and sort it (either based on defocus or on previously refined intensity scale-factors) | |||
* Insert empty lines in the sorted list to indicate the start of a new group | |||
* Run a csh script to generate a STAR file with the corresponding rlnGroupName labels for all particles. | |||
=== Defocus-based groups === | |||
Despite that RELION groups are NOT the same as defocus groups (see this [[FAQs#What_are_groups_for_anyway.3F | FAQ]]), it appears that particles with similar defocus values often have similar scale intensity factors and noise power spectra. Therefore, you may sort your micrographs on defocus and use this as a guideline for grouping. You could sort your micrographs for example by using the following command: | |||
relion_star_printtable particles.star data_ _rlnDefocusU _rlnMicrographName | sort -n | uniq -f 1 | awk '{print $2, $1}' > split_mics_defocus.dat | |||
Note that this sorting will disregard any increase in noise due to contamination. If you think contamination may play an important role in your data set, then you might want to consider an alternative sorting (one that takes defocus AND aquisition time into account). | |||
=== Intensity scale-factor-based groups === | |||
Alternatively, if you have already ran a RELION refinement (either 2D class averages or 3D classification/refinement) in which you used a new group for each micrograph (which happens automatically when you don't specify any groups), then you may group your particles based on their refined intensity scale-factor: | |||
relion_star_printtable Class2D/run1_it025_model.star data_model_groups _rlnGroupName _rlnGroupScaleCorrection _rlnGroupNrParticles | awk '{print $2, $1, $3}' | sort -n | awk '{print $2, $1, $3}' > split_mics_scale.dat | |||
=== Introduce empty lines to indicate groups === | |||
Now use a text editor to introduce empty lines that will indicate new groups. In the example below, we edited split_mics_defocus.dat and introduced a single empty line to make one group of 3 micrographs and one group of 2 micrographs: | |||
Micrographs/17.15.02_CCD_Acquire.mrc 30698.650391 | |||
Micrographs/15.53.53_CCD_Acquire.mrc 30737.880859 | |||
Micrographs/23.59.00_CCD_Acquire.mrc 30820.509766 | |||
Micrographs/16.51.48_CCD_Acquire.mrc 32674.019531 | |||
Micrographs/19.17.43_CCD_Acquire.mrc 33067.578125 | |||
=== Generate a new STAR file === | |||
Finally, we run the [[make_grouped_star.csh]] script to make a new STAR file. | |||
The arguments are: | |||
1. The edited list (with the empty lines): split_mics_def.dat. | |||
1. The original STAR file with the particles without groups: particles.star | |||
1. The output STAR file with the corresponding rlnGroupName labels: particles_grouped.star | |||
./make_grouped_starfile.csh split_mics_def.dat particles.star particles_grouped.star |
Latest revision as of 13:20, 13 November 2017
Overview
The procedure is as follows:
- Generate a text file with the rlnMicrographName for each micrograph in the data set, and sort it (either based on defocus or on previously refined intensity scale-factors)
- Insert empty lines in the sorted list to indicate the start of a new group
- Run a csh script to generate a STAR file with the corresponding rlnGroupName labels for all particles.
Defocus-based groups
Despite that RELION groups are NOT the same as defocus groups (see this FAQ), it appears that particles with similar defocus values often have similar scale intensity factors and noise power spectra. Therefore, you may sort your micrographs on defocus and use this as a guideline for grouping. You could sort your micrographs for example by using the following command:
relion_star_printtable particles.star data_ _rlnDefocusU _rlnMicrographName | sort -n | uniq -f 1 | awk '{print $2, $1}' > split_mics_defocus.dat
Note that this sorting will disregard any increase in noise due to contamination. If you think contamination may play an important role in your data set, then you might want to consider an alternative sorting (one that takes defocus AND aquisition time into account).
Intensity scale-factor-based groups
Alternatively, if you have already ran a RELION refinement (either 2D class averages or 3D classification/refinement) in which you used a new group for each micrograph (which happens automatically when you don't specify any groups), then you may group your particles based on their refined intensity scale-factor:
relion_star_printtable Class2D/run1_it025_model.star data_model_groups _rlnGroupName _rlnGroupScaleCorrection _rlnGroupNrParticles | awk '{print $2, $1, $3}' | sort -n | awk '{print $2, $1, $3}' > split_mics_scale.dat
Introduce empty lines to indicate groups
Now use a text editor to introduce empty lines that will indicate new groups. In the example below, we edited split_mics_defocus.dat and introduced a single empty line to make one group of 3 micrographs and one group of 2 micrographs:
Micrographs/17.15.02_CCD_Acquire.mrc 30698.650391 Micrographs/15.53.53_CCD_Acquire.mrc 30737.880859 Micrographs/23.59.00_CCD_Acquire.mrc 30820.509766 Micrographs/16.51.48_CCD_Acquire.mrc 32674.019531 Micrographs/19.17.43_CCD_Acquire.mrc 33067.578125
Generate a new STAR file
Finally, we run the make_grouped_star.csh script to make a new STAR file. The arguments are: 1. The edited list (with the empty lines): split_mics_def.dat. 1. The original STAR file with the particles without groups: particles.star 1. The output STAR file with the corresponding rlnGroupName labels: particles_grouped.star
./make_grouped_starfile.csh split_mics_def.dat particles.star particles_grouped.star