turonova / novaCTF

3D-CTF correction for cryo-electron tomography
25 stars 4 forks source link

rotate around X axis after reconstruction #8

Closed dgrotjahn closed 6 years ago

dgrotjahn commented 6 years ago

I would like to reorient the final 3D-CTF-corrected, reconstructed tomogram such that it is in the XYZ orientation (Rotate around X axis option in IMOD GUI). However, I'm running into a few errors when I run trimvol on the final tomogram. All of the steps leading up to Reconstruction were done using the aligned stack from IMOD (.ali).

Here is the command I run:

trimvol -rx tomogram_novaCTF.rec test.rec

and here is the error:

ERROR: mrcReadSectionAny - reading data from file. ERROR: NEWSTACK - READING IMAGE FILE ERROR: trimvol - newstack -siz 1920,676 -off 0,0 -ori "tomogram_novaCTF.rec" "tomogram_novaCTF.rec.tmp.15088": exited with status 1

Any advice on the cause of such an error, or suggestions for how to reorient the tomogram after reconstruction using novaCTF would be appreciated!

turonova commented 6 years ago

Can you open the final tomogram without any problems or errors? If so, could you please post the header of your tomogram as well as the size of the file produced by novaCTF. The command you run the final step of novaCTF would also be helpful.

The alternative way how to rotate to the same rotation as with trimvol -rx is using following clip commands from IMOD: clip flipyz novaCTF.rec temp.rec clip flipz temp.rec You have to run both as the flipyz will give you a tomogram that is "upside-down". However, the error you posted seems more like the tomogram is somehow corrupted and comes from newstack command so the clip commands will most likely fail in the same way.

dgrotjahn commented 6 years ago

Thanks for the response. I think you’re right about the tomogram somehow being corrupted since I get this error when I try to open it in 3dmod :

Here’s the header information for the 3D-CTF-corrected tomogram (which I cannot open and appears to be corrupt):

RO image file on unit 1 : tomogram10_novaCTF.rec Size= 4704961 K

Number of columns, rows, sections ..... 1920 676 1856 Map mode .............................. 2 (32-bit real)
Start cols, rows, sects, grid x,y,z ...-1855 -1919 0 1920 676 1856 Pixel spacing (Angstroms).............. 4.260 8.520 4.260
Cell angles ........................... 90.000 90.000 90.000 Fast, medium, slow axes ............... X Y Z Origin on x,y,z ....................... 138.5 -134.2 0.000
Minimum density ....................... -132.26
Maximum density ....................... 134.95
Mean density .......................... 0.58884E-01 tilt angles (original,current) ........ 0.0 0.0 0.0 0.0 0.0 0.0 Space group,# extra bytes,idtype,lens . 0 0 0 0

 7 Titles :

EMAN 1/20/2016 2:31
CCDERASER: Bad points replaced with interpolated values 20-Jan-16 02:31:48
EMAN 0/20/2016 2:35 EMAN 1/20/2016 2:31
NEWSTACK: Images copied 20-Jan-16 03:09:16
CCDERASER: Bad points replaced with interpolated values 21-Jan-16 19:25:00
NEWSTACK: Images copied, transformed 22-Jan-16 09:58:47
clip: flipyz 02-Jan-18 11:56:38

Here are the commands I ran for each step:

  1. Generate defocus files:

CTF -Algorithm defocus -InputProjections tomo10.ali -FULLIMAGE 1920,1856 -THICKNESS 676 -TILTFILE tomo10.tlt -SHIFT 0.0,0.0 -CorrectionType phaseflip -DefocusFileFormat mod -CorrectAstigmatism 1 -DefocusFile ctfparam.log -PixelSize 0.852 -DefocusStep 30

  1. CTF correction (for each defocus file, 31 in total, numbered 0-30):

novaCTF -Algorithm ctfCorrection -InputProjections tomo10.ali -OutputFile corrected_tomo10.ali_11 -DefocusFile ctfparam.log_11 -TILTFILE tomo10.tlt -CorrectionType phaseflip -DefocusFileFormat imod -CorrectAstigmatism 1 -PixelSize 0.852 -AmplitudeContrast 0.07 -Cs 2.7 -Volt 300

  1. Flipping orientation

clip flipyz corrected_tomo10.ali_0 corrected_stack_flipped_tomo10.ali_0

  1. Filtering novaCTF -Algorithm filterProjections -InputProjections corrected_stack_flipped_tomo10.ali_11 -OutputFile filtered_tomo10.ali_11 -TILTFILE tomo10.tlt -StackOrientation xz -RADIAL 0.3,0.16

  2. Reconstruction

novaCTF -Algorithm 3dctf -InputProjections filtered_tomo10.ali -OutputFile tomogram10_novaCTF.rec -TILTFILE tomo10.tlt -THICKNESS 676 -FULLIMAGE 1920,1856 -SHIFT 0.0,0.0 -PixelSize 0.852 -NumberOfInputStacks 31

Please let me know if you need any other information, thanks for your assistance!

~Danielle

On Jan 4, 2018, at 7:27 AM, turonova notifications@github.com wrote:

Can you open the final tomogram without any problems or errors? If so, could you please post the header of your tomogram as well as the size of the file produced by novaCTF. The command you run the final step of novaCTF would also be helpful.

The alternative way how to rotate to the same rotation as with trimvol -rx is using following clip commands from IMOD: clip flipyz novaCTF.rec temp.rec clip flipz temp.rec You have to run both as the flipyz will give you tomogram that is "upside-down". However, the error you posted seems more like the tomogram is somehow corrupted and comes from newstack command so the clip commands will most likely fail in the same way.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/turonova/novaCTF/issues/8#issuecomment-355310970, or mute the thread https://github.com/notifications/unsubscribe-auth/AhbPwU-oOBFPVHboCKGNLs-CedhXpeB1ks5tHO3RgaJpZM4RROtK.

turonova commented 6 years ago

The commands look fine to me (well, except for -DefocusFileFormat mod in the defocus computation, but I assume this to be typo from copy-pasting here as it would crash otherwise).

Based on the header I would say that the reconstruction was not completed/crashed for some reason - the size 4704961 K is way too small. Based on the tomogram's dimensions and map mode (32bit real), the size should be around 9.6GB.

Try following things: 1) Open any of the filtered input stacks filteredtomo10.ali* to see if you can open it normally and without errors. Check if all the input stacks 0-30 has the same size.

2) Check header of filteredtomo10.ali0 - are the max, min and mean values same as for your tomogram? If so, it means that the reconstruction did not finish properly.

3) Try to run the reconstruction again - the program should end with "Reconstruction finished successfully" and the tomogram should have roughly 9.6GB. Try open it and if there is still an error, please send me the complete output produced during the reconstruction.

Before you run the reconstruction again, make sure you have the latest novaCTF version from this page and not from EMBL webpage.

dgrotjahn commented 6 years ago

Thanks for the information, I realized going through your instructions that my Reconstruction command was incorrect, and did not reflect the actual dimensions for the .ali file (which was binned by 2, so all “size” values were off by a factor of 2). Changing these values fixed all of the problems I was having with viewing and trimming tomograms! Thanks so much for your help.

Just one additional question regarding IMOD, do you know which file (.com, .log, etc) includes information on the boundary model step/tomogram positioning step? Just wondering how those values (z shift, for example) is taken into account for the 3D-CTF wbp reconstruction.

Thanks! Danielle

On Jan 4, 2018, at 2:20 PM, turonova notifications@github.com wrote:

The commands look fine to me (well, except for -DefocusFileFormat mod in the defocus computation, but I assume this to be typo from copy-pasting here as it would crash otherwise).

Based on the header I would say that the reconstruction was not completed/crashed for some reason - the size 4704961 K is way too small. Based on the tomogram's dimensions and map mode (32bit real), the size should be around 9.6GB.

Try following things:

Open any of the filtered input stacks filteredtomo10.ali* to see if you can open it normally and without errors. Check if all the input stacks 0-30 has the same size.

Check header of filtered_tomo10.ali_0 - are the max, min and mean values same as for your tomogram? If so, it means that the reconstruction did not finish properly.

Try to run the reconstruction again - the program should end with "Reconstruction finished successfully" and the tomogram should have roughly 9.6GB. Try open it and if there is still an error, please send me the complete output produced during the reconstruction.

Before you run the reconstruction again, make sure you have the latest novaCTF version from this page and not from EMBL webpage.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/turonova/novaCTF/issues/8#issuecomment-355415510, or mute the thread https://github.com/notifications/unsubscribe-auth/AhbPwZrTInIWXXNqV89vWmoh7UBtZ9XQks5tHU6YgaJpZM4RROtK.

turonova commented 6 years ago

I do not know exactly what extension have the files used during positioning but all parameters necessary for reconstruction are saved in tilt.com file. The positioning in x and z is stored in the SHIFT parameter (SHIFT x z). For the detailed description of all the parameters there see the help page for tilt command.

You can directly use tilt.com file to reconstruct using novaCTF - the only thing that needs to be added is the defocus step size or number of input projections:

./novaCTF -param tilt.com -NumberOfInputStacks 31

All the parameters that are not used in novaCTF are going to be ignored. If there are some parameters you want to set differently, you can simply add them to command line and do not have to change them in tilt.com directly. First, the parameters in tilt.com file are processed and then the ones from command line (they override the tilt.com ones in case of duplicity). In other words, you can use the same novaCTF command as before and just add -param tilt.com there which will set all values from eTomo relevant for the reconstruction.