MD SET MP 0 ; SOURCE: mrc.spi ; ; PURPOSE: Get defocus using MRC program CTFFIND2 ; ; REQUIRES ; ctffind* a shell script ; readmrc.py a python script ; ; INPUTS: ; micrographs (in SPIDER format) ; start, end micrograph numbers ; parameters to ctffind, including ; - spherical aberration ; - electron beam voltage (in kV) ; - amplitude contrast ratio ; - magnification ; - pixel size on scanner (in microns) ; (see ctffind script for more) ; OUTPUTS: ; doc file of defocus and astigmatism information. ; power spectrum generated by ctffind2 (in SPIDER format). ; text report generated by ctffind2. ; Exclude the edges of the micrograph [v27] = 100 ; X distance from border [v28] = 100 ; Y distance from border ; Parameters for CTFFIND2. Use symbolic vars to send to shell script. [cs] = '2.26' ; Spherical aberration [kv] = ' 300' ; Electron beam voltage in kV [ac] = ' 0.1' ; amplitude contrast ratio FR G <<<<<<< mrc.spi [mag] = ' 50000' ; Magnification of original image (final mag on the F30) ======= [mag] = '100000' ; Magnification of original image (final mag on the F30) >>>>>>> 1.5 [scansize] 15 ; Pixel size on scanner in microns (7, 14, etc.) ; ----------- Input files -------------- FR G <<<<<<< mrc.spi [FILENUMS] = 'filenum1' ; ../all_micrographs ; file numbers ======= [FILENUMS] = '../all_micrographs' ; file numbers >>>>>>> 1.5 FR G <<<<<<< mrc.spi [mic] = '../Micrographs/mic{****[v11]}' ; input template for micrographs ======= [mic] = '../Micrographs/mic{*****[v11]}' ; input template for micrographs >>>>>>> 1.5 ; ----------- Output files -------------- [defocus] = 'new/defocus' ; output doc file [mrc_out] = 'new/powmrc' ; output power spectrum template [report] = 'new/report' ; output report file, created by CTFFIND2 ; -------------------- END BATCH HEADER ----------------------- MD SET MP 0 [v15]= [scansize]/[mag]*10000 ; pixel size DE [defocus] ; Temporary files [tmp1] = 'tmp89769' [tmp2] = 'tmp92451.mrc' ; use for MRC power spectrum [mrc_mic] = 'tmpmic45.mrc' ; Column labels for the output file SD / micrograph avg.defocus defocus1 defocus2 angle astigmatism [defocus] SD E [defocus] ; Get the filenumbers UD N [v20] [FILENUMS] DO [v65] = 1,[v20] UD [v65],[v11] [FILENUMS] ; [v11] is now the file number FI [v21],[v22] [mic] (12,2) [v31] = [v21] - (2*[v27]) ; dimensions [v32] = [v22] - (2*[v28]) WI [mic] ; input [tmp1] ; output ([v31],[v32]) ; dimensions ([v27],[v28]) ; start coords CP TO CCP4 [tmp1] [mrc_mic] <<<<<<< mrc.spi (32) ([v15],[v15],[v15]) ; pixel size ; let the blank above and below (call default values) ======= (32) ([v15],[v15],[v15]) ; pixel size ; leave blanks above and below (call default values) >>>>>>> 1.5 <<<<<<< mrc.spi ; ; ======= ; VM echo "calling ctffind with micrograph {****[v11]}" ; >>>>>>> 1.5 VM ./ctffind [mrc_mic] [tmp2] [cs] [kv] [ac] [mag] [scansize] > [report]{****[v11]} <<<<<<< mrc.spi CP FROM MRC ; Comment out these 3 lines if you [tmp2] ; don't want to keep the output [mrc_out]{****[v11]} ; power spectrum generated by CTFFIND2. ======= CP FROM CCP4 ; Comment out these lines if you [tmp2] ; don't want to keep the output [mrc_out]{****[v11]} ; power spectrum generated by CTFFIND3. N >>>>>>> 1.5 VM \rm [tmp2] VM ./readmrc.py [report]{****[v11]} {****[v11]} >> [defocus].$DATEXT ;VM ; Comment out these 2 lines if ;\rm [report]{****[v11]} ; you want to keep the report. ENDDO DE [tmp1] VM \rm [mrc_mic] EN