SBC-Utrecht / pytom-match-pick

GPU-accelerated template matching for cryo-ET
https://sbc-utrecht.github.io/pytom-match-pick/
GNU General Public License v2.0
25 stars 7 forks source link

Extracting subtomos in RELION5 with particles.star file not working #214

Closed Phaips closed 4 weeks ago

Phaips commented 1 month ago

Hello,

I wanted to extract subtomos in RELION5 (beta-3-commit-b978db) using a .star file from TM with --relion5-compat. The header has data_, however I had to manually change it to data_particles for it to work. But now the next error I get is

in: /scicore/projects/scicore-p-structsoft/ubuntu/software/RELION/ver5.0/src/jaz/tomography/particle_set.cpp, line 130
ERROR: 
ParticleSet::ParticleSet: rlnTomoTiltSeriesPixelSize missing from optics MetaDataTable

Maybe this field also needs to be added to the .star file?

Thanks for the help!

All the best, Philippe

McHaillet commented 1 month ago

Hi Philippe,

Thanks for the feedback and solving the data_particles header! That definitely needs to be fixed.

I wrote the headers based on the Relion5 biorxiv paper and assumed they would work, but I didn't have a place to test the integration.

Could you try changing the _rlnDetectorPixelSize to _rlnTomoTiltSeriesPixelSize and see if that makes it readable for Relion5?

ParticleSet::ParticleSet: rlnTomoTiltSeriesPixelSize missing from optics MetaDataTable

Although this could also mean that there needs to be an optics table above it... Not sure.

Best, Marten

McHaillet commented 1 month ago

To-do for relion5 compat mode:

Phaips commented 1 month ago

Could you try changing the _rlnDetectorPixelSize to _rlnTomoTiltSeriesPixelSize and see if that makes it readable for Relion5?

EDIT: Tried this and it works! Another problem was the rec_ in the tomo name that I had to adjust! But changing the field to _rlnTomoTiltSeriesPixelSizeworked! I am not sure but I think the TiltSeriesPixelSize needs to be in bin1! At least the TiltSeries jobs .star file in RELION5 are in bin1. Because pytom outputs the voxelsize specified in the TM jobs which will most likely be on binned tomograms

Phaips commented 1 month ago

Thanks a lot for the quick fix!

McHaillet commented 1 month ago

Thanks for the quick response, I am glad that it solved it!

What do you mean with the rec_ in the tomo name? In the name of the mrc file?

If the pixel size is unbinned that would be annoying. I am not sure if its actually needed though because the coordinates are already in Angstroms, so I would not see the need for an additional pixel size there. Would it be possible for you to see if the extracted subtomos indeed contain your expected particles?

Phaips commented 1 month ago

Sorry I wasn't clear, I edited my comments a couple of times because I figured out many errors haha Yes, for the _rlnTomoName I had our usual rec_Position_1.mrc name as the identifier. In RELION5 however, the rec_ is left out so the tomo name would be Position_1.mrc but this was an easy find-and-replace fix :)

I ran a RELION5 Extraction job from PyTOM particles.star files with both _rlnTomoTiltSeriesPixelSize either bin1 (1.98) or bin4 (7.92) and the subtomograms look the same indeed! So as you said the coordinates being in bin1 might already be sufficient! Probably the _rlnTomoTiltSeriesPixelSize value is not used but the field needs to be there I guess.

McHaillet commented 1 month ago

Sorry I wasn't clear, I edited my comments a couple of times because I figured out many errors haha Yes, for the _rlnTomoName I had our usual rec_Position_1.mrc name as the identifier. In RELION5 however, the rec_ is left out so the tomo name would be Position_1.mrc but this was an easy find-and-replace fix :)

I got it now! That is slightly annoying, but I guess not something we should fix. It seems better to store the exact filename in the starfile.

I ran a RELION5 Extraction job from PyTOM particles.star files with both _rlnTomoTiltSeriesPixelSize either bin1 (1.98) or bin4 (7.92) and the subtomograms look the same indeed! So as you said the coordinates being in bin1 might already be sufficient! Probably the _rlnTomoTiltSeriesPixelSize value is not used but the field needs to be there I guess.

Good that they look the same, and thanks for checking! That field is probably not used then indeed

Phaips commented 1 month ago

Great thank you! I will follow the _rlnTomoTiltSeriesPixelSize field in the .star file carefully down the RELION5 workflow! Just to make sure it is correct in case it will be used/read from the particle.star at one point. From the tilt-series .star file the field is written in bin1 so I assume it should be the same here. I should also ask the RELION devs actually.

McHaillet commented 4 weeks ago

I made a PR that fixes data_particles and rlnDetectorPixelSize.

The problem of the unbinned versus binned is harder to address as the package currently does not rely on metadata of the original pixel size. As said before, I also don't see why it is needed if the coordinates are already in Angstrom. Perhaps it can be left out entirely, but that needs more investigation...

I should also ask the RELION devs actually.

If you could that would be great! Feel free to ping me in the thread if you do (or link to this issue).

Once the PR is merged, I think we can move this to the Discussions page.

sroet commented 4 weeks ago

220 is merged, moving this to a discussion. Thanks again for the feedback @Phaips, and please let us know if you run into any further compatibility issues!