asarnow / pyem

Python programs for electron microscopy
GNU General Public License v3.0
114 stars 52 forks source link

Relion not recognizing coordinates in star file generated from cpsarc refine job. #79

Closed RussellM6 closed 2 years ago

RussellM6 commented 2 years ago

Hi,

I'm running into an error with importing particle coordinates in a star file generated by csparc2relion.py.

I run the script as is prescribed here with extract job symlinked from CS into my Relion directory and then particles.cs and particles_passthrough.cs as arguments in the script: csparc2star.py ../P15/J142/cryosparc_P15/J142_012_particles.cs ../P15/J142/P142_passthrough_particles.cs from_csparc.star

I then modify the resulting star file to have the correct optics group to match with the ones in my MotionCorr and CtfFind jobs as well as to edit paths to the motion-corrected micrographs. From here, when I try to re-extract the particles for processing in Relion, I get nothing. Relion parses through the individual micrographs and indicates there are no particles to extract:

 ...
 WARNING: no particles on micrograph: MotionCorr/job004/tifs2/stack2_06061_X+1Y+2-3.mrc
 WARNING: no particles on micrograph: MotionCorr/job004/tifs2/stack2_06062_X+1Y+2-4.mrc
 WARNING: no particles on micrograph: MotionCorr/job004/tifs2/stack2_06063_X+1Y+2-5.mrc
 WARNING: no particles on micrograph: MotionCorr/job004/tifs2/stack2_06064_X+2Y+3-1.mrc
 WARNING: no particles on micrograph: MotionCorr/job004/tifs2/stack2_06065_X+2Y+3-2.mrc
 WARNING: no particles on micrograph: MotionCorr/job004/tifs2/stack2_06066_X+2Y+3-3.mrc
 WARNING: no particles on micrograph: MotionCorr/job004/tifs2/stack2_06067_X+2Y+3-4.mrc
 WARNING: no particles on micrograph: MotionCorr/job004/tifs2/stack2_06068_X+2Y+3-5.mrc
   0/   0 sec ............................................................~~(,_,">
 Joining metadata of all particles from 6069 micrographs in one STAR file...
 The pixel size of the extracted particles in optics group 1 is 2.364 Angstrom/pixel.
 Written out STAR file with 0 particles in Extract/job021/particles.star
 Done preprocessing!

I have gone through my star file and steps to prepare it fairly carefully at this point and I'm unclear what I might be doing wrong here.

Thank you, Russell

asarnow commented 2 years ago

Typically if you run motion correction outside CS and import micrographs, the coordinates will need to be altered using csparc2star.py --swapxy. Sometimes --inverty or --invertx are also necessary. Should work, feel free to re-open this issue if not.

RussellM6 commented 2 years ago

Even with the --swapxy and --inverty flags included, the extract job proceeds without identifying any particles.

I don't know if this is effects how Relion is behaving, however I have two subsets of micrographs (collected on the same microscope but separated with different gain refs due to a camera problem) and so my star file references two separate MotionCorr/CtfFind directories. I have not attempted importing the separated stacks of particles and combining within Relion as they were combined early on in CryoSparc and fairly well currated since.

asarnow commented 2 years ago

That's fine...is the pixel size correct? Are you asking Relion to recenter the particles? Are you sure the correspondences are correct in your modified .star file used for extraction?

Did you try --invertx? Unfortunately you may need to try every combination of the three arguments, however once the right formula is identified it will remain consistent.

RussellM6 commented 2 years ago

I thought I'd just follow up saying that I managed to successfully import my Csparc particle stack into Relion and then re-extract the coordinates fresh, as I had wanted to. I had checked through optics groups and meta data and that was all correct. What ultimately worked for me, and I'm not sure why this worked out, was that I generated a star file from only the particles_passthrough.cs file. The resulting star file only had the micrograph name, coordinates and a few other metadata components, importantly for me it kept the lnHelicalTubeID intact. In this star file the particles were ordered by the micrograph they were extracted from - I'm superstitiously believing that this is what let me import the particles finally, but I have no idea. After fixing my optics groups, I was able to re-extract the particles from the star file and run 2D classification (first without classifying 2D helical segments because the psi angle data was lost).

Thanks!