Hi, all:
I tried to convert the particles from cryosparc to relion by using pyem. It looks good when I converted the refinement data. But after I run Class2D job, the 2D average looks weird. In Relion, the helix should be parallel. But the result of the converted particles is still vertical (cryosparc style) while some parallel shadow in the 2D average. It looks like Relion tries to make the angle correct, but only affect a few particles.
I think after the CS file is converted to a star file you can edit the file directly - I think if you subtract 90 from the rln_PsiAngle and rln_PsiAnglePrior columns, this will put the angles into Relion convention (though it would be great if someone else can confirm this?). You can try a Relion 2D classification without alignment switched on to check this.
I would also consider that it looks like Cryosparc has heavily translated those particles in a way that the signal is concentrated at the centre of the box, hence why it appears more ‘detailed’ there. I had some improvements of this by:
A: Switching off force max pose/shifts during my final pre-export 2D classification.
B: Removing the translations from the star file and re-extracting the particles in Relion before doing 2D classification.
I found these useful to get some further cleaning done as in my experience Cryosparc doesn’t perform so well with 2D classification of my filaments.
I tend to get things working with the following:
csparc2star.py with --inverty ( in case I want to reextract in RELION)
Add _rlnAngleTiltPrior column with 90 degree value for each particle
Add 90 degrees to _rlnAnglePsiPrior.
Python script to do this (need starfile first, i/e pip install starfile):
import argparse
import os
import starfile
def modify_star_file(input_file):
# Generate the output file name
base_name = os.path.splitext(input_file)[0]
output_file = f'{base_name}_modified.star'
# Read the STAR file using starfile
data = starfile.read(input_file)
# Check if 'particles' section exists
if 'particles' in data:
particles_data = data['particles']
# Add the rlnAngleTiltPrior column with value 90 if it doesn't exist
if 'rlnAngleTiltPrior' not in particles_data:
particles_data['rlnAngleTiltPrior'] = 90
# Modify the rlnAnglePsiPrior values by adding 90 degrees
if 'rlnAnglePsiPrior' in particles_data:
particles_data['rlnAnglePsiPrior'] = particles_data['rlnAnglePsiPrior'] + 90
else:
print("rlnAnglePsiPrior column not found in the particles section")
else:
print("particles section not found in the STAR file")
# Write the modified data back to a new STAR file
starfile.write(data, output_file)
print(f'New STAR file with rlnAngleTiltPrior column added and rlnAnglePsiPrior values adjusted by 90 degrees written to {output_file}')
if __name__ == "__main__":
# Set up argument parser
parser = argparse.ArgumentParser(description="Add rlnAngleTiltPrior column with value 90 and adjust rlnAnglePsiPrior values by adding 90 degrees in a STAR file")
parser.add_argument('--i', required=True, help="Input STAR file")
# Parse arguments
args = parser.parse_args()
input_file = args.i
# Modify the STAR file
modify_star_file(input_file)