tbepler / topaz

Pipeline for particle picking in cryo-electron microscopy images using convolutional neural networks trained from positive and unlabeled examples. Also featuring micrograph and tomogram denoising with DNNs.
GNU General Public License v3.0
171 stars 63 forks source link

Folder hierarchy not fully preserved for *_topazpicks.star #84

Open zruan opened 3 years ago

zruan commented 3 years ago

I usually organize my cryo-EM data based on relion recommendations. See section 2.1 of Link.

For example, I put my tif files under Movies/10Feb2021 and import the movies into relion for the rest of the data analysis.

However, the relion wrapper of topaz only recognizes the last folder element in the hierarchy. In this case, 10Feb2021. This causes the picking result not able to display from relion gui.

The solution is to manually make a Movies folder under the External/jobXXX/ and move all the 10Feb2021/*_topazpicks.star files into it. However, it would be nice to recognize the folder hierarchy directly by the topaz wrapper.

This can be fixed by changing the following code https://github.com/tbepler/topaz/blob/617547c39d29eceb38de36eaf832432e08f0997d/relion_run_topaz/run_topaz_pick.py#L96 to something like os.system(str('''relion_star_printtable ''')+inargsMics+str(''' data_micrographs _rlnMicrographName | awk -F'job[0-9]*/' '{print $2}' | sed 's|/[^/]*.mrc||' > ''')+tmpfile)

tbepler commented 3 years ago

This should be addressed by the "--per-micrograph" flag that I added to Topaz a few months ago. It causes the commands to write star files directly to the same location as the input files for better RELION compatibility and should simplify this issue dramatically.

If you'd like to make a pull request updating the RELION scripts, I'm happy to accept it. @alexjnoble do you have any plans to update the RELION scripts?

alexjnoble commented 3 years ago

I anticipate that the current Relion scripts will be superseded by Topaz integration in the next official Relion release, version 3.2. So the current scripts will likely not be updated further, unless by user contribution.

-Alex

tbepler commented 3 years ago

@alexjnoble Ok, are you able to test this user contribution? https://github.com/tbepler/topaz/pull/85

alexjnoble commented 3 years ago

I have very little experience with Relion so I don't have a proper test case for this or other contributions. Perhaps @rfleiro can help with this?

rfleiro commented 3 years ago

Hi, agree with Alex, these scripts will be soon superseded by the new integration in Relion. I will test the new code