CP TO MRC - Copy SPIDER file To MRC (CCP4) format file

(1/23/18)

PURPOSE

Copies a SPIDER-format image/volume file into a MRC-format file. As of 2015 this operation converts to the new MRC 2014 format. Note; MRC format is sometimes referred to as CCP4. Starting with SPIDER version: 22.11 this operation creates little-endian (native Intel) byte order output files.   Example.

SEE ALSO

CP FROM ASCII [Copy ASCII text file to SPIDER file]
CP FROM EMI [Copy EMISPEC format file to SPIDER file]
CP FROM MRC [Copy MRC file to SPIDER file]
CP FROM NIK [Copy Nikon Coolscan format file to SPIDER file]
CP FROM PDB [Copy PDB file to SPIDER format]
CP FROM RAW [Copy Raw Image to SPIDER file]
CP FROM TERM [Copy Terminal input to SPIDER image/volume]
CP FROM TIFF [Copy TIFF format file to SPIDER file]
CP FROM VAX [Copy VAX SPIDER file to a Unix SPIDER file]
CP TO ASCII [Copy SPIDER file to ASCII text format]
CP TO BRIX [Copy SPIDER volume to BRIX file for "O" input]
CP TO MRC [Copy SPIDER file To MRC (CCP4) format file]
CP TO OPEND [Copy SPIDER file To Opposite Byte Endian]
CP TO POST [Copy SPIDER image to a POSTscript image]
CP TO RAW [Copy SPIDER file to a 8-bit raw image]
CP TO TIFF [Copy SPIDER file to a TIFF format]

USAGE

.OPERATION: CP TO MRC

.SPIDER INPUT FILE: SPI000
[Enter the SPIDER file you want to copy. It can be an image, image stack, volume, or volume stack.]

.MRC OUTPUT FILE: MRC000
[Enter name for MRC format output file.]

If input contains a whole bare stack (e.g. images@) then output is always MRC MODE: 2 floating point data and SPIDER asks:

.'MRC VERSION (0 or 20140), ORIGIN AT BOTTOM LEFT (YES==1): 0 , 0
[Can create MRC 2014+ format output or a file which has a different set of values for undetermined minimum, maximum, and mean density which is not compliant with 2014 format but can be used with Relion. Some softwares expect MRC files with image origin at upper left, some with origin at lower left. Use 0 for use with Relion.]

.PIXEL SIZE (A) FOR X, Y, & Z AXIS: 1.4, 1.4, 1.4
[Pixel size value will be be multiplied by the number of pixels in each axis to get the MRC cell dimensions.]

If input contains an image or volume (not a stack) SPIDER asks:

.MRC DATA LENGTH (8/32 BITS), ORIGIN AT BOTTOM LEFT (YES==1): 32 , 0
[Can create either a MRC MODE=0 file containing 8 bit integer values or a MRC MODE=2 file containing 32 bit floating point values with little-endian byte-ordering. Some softwares expect MRC files with image origin a upper left, some with origin a lower left.]

.STARTING X, Y, & Z OF MRC IMAGE: <CR>
[Default value for start: (NX/2)+ 1, (NY/2)+1, (NZ/2)+1 where (+1 added only if axis length is odd)
Enter <CR> or '*' if you want to use the default values.]

.ANGSTROMS/PIXEL FOR X, Y, & Z AXIS: 12.0, 12.0, 5.0
[Angstroms/pixel value will be be multiplied by the number of pixels in each axis to get the cell dimensions.]

.X, Y, & Z ORIGIN OF MRC IMAGE: <CR>
[Default value for origin: (NX/2)+ 1, (NY/2)+1, (NZ/2)+1 where (+1 added only if axis length is odd)
Enter <CR> or '*' if you want to use the default values.]

NOTES

  1. Can not copy SPIDER Fourier format files.

  2. Procedure "fit_ccp4_to_pdb.spi" below creates a CCP4 file aligned for use in 'O'.

  3. As of SPIDER release 22.12 the first line of the MRC image file always contains the bottem left corner of the image which is consistent with MRC files made since 1999.

SUBROUTINES

COPYTOMRC, SETHEDCCP4, OPFILES

CALLER

COPY1
; fit_ccp4_to_pdb.spi
;
; THIS PROCEDURE ORIENTS AND SHIFTS A SPIDER VOLUME THAT HAS BEEN CONVERTED TO
; A BRIX VOLUME BY "CP TO BRIX" AND HAS BEEN USED (THE BRIX VOLUME) TO
; FIT A PDB STRUCTURE USING "O" OR REAL SPACE REFINEMENT (RSR). THE OUTPUT 
; OF THIS PROCEDURE IS A CCP4 VOLUME WHICH IS AT THE CORRECT LOCATION AND 
; ORIENTATION AS THAT OF THE FITTED PDB STRUCTURE. THIS CAN BE VISUALIZED 
; USING "O", "CHIMERA" OR "PYMOL".

; ALTERNATIVELY, 

; (1) ONE CAN ALSO ORIENT AND SHIFT THE FITTED PDB FILE TO FIT THE CCP4 
; VOLUME WHICH IS GENERATED FROM THE UNROTATED AND UNSHIFTED SPIDER VOLUME,
; WHICH CAN BE VISUALIZED BY USING "O", "CHIMERA" OR "PYMOL". USE PROCEDURE 
; "fit_pdb_to_ccp4.spi" IN THE SPIDER PROCEDURE DIRECTORY"spider/proc/".

; (2) ONE CAN USE "CP TO BRIX" TO CONVERT THE UNROTATED AND UNSHIFTED 
; SPIDER VOLUME TO A BRIX VOLUME WHICH CAN BE USED TO VISUALIZE THE
; FITTED PDB STRUCTURE IN "O", "CHIMERA" OR "PYMOL".

;;;;;;;;;;;;;;;;;;;;;; BEGINING OF INPUT PARAMETERS ;;;;;;;;;;;;;;;;;;

 [input]  = 'vol_spi'

 [output] = 'vol_ccp4.ccp4'

 ; PIXEL SIZE 
 [ps] = 2.82    ; PIXEL SIZE

 ; DATA LENGTH FOR CCP4 FILE 
 [len] = 32     ; DATA LENGTH FOR CCP4 FILE  

 ;;;;;;;;;;;;;;;;;;;;;; END OF INPUT PARAMETERS ;;;;;;;;;;;;;;;;;;;;;;;;

 ; ROTATE THE VOLUME SO THAT X = Y, Y = X AND Z = -Z
 RT 3D
   [input]
   _1
   90, 0, 0

 RT 3D
   _1
   _2
   0, 180, 0

 RT 3D
   _2
   _3
   180, 0, 0

 ; FIND NX, NY AND NZ
 FI [NX],[NY],[NZ]
   [input]
   12, 2, 1

 ; FIND THE CENTER IN PIXELS, FOR EVEN DIMENSION, IT IS NX/2 ETC..
 ; FOR ODD DIMENSION, IT IS (NX/2 + 1) ETC..

 [xc] = INT([NX]/2)
 [yc] = INT([NY]/2)
 [zc] = INT([NZ]/2)

 [x]  = ([NX] - 2*[xc]) + [xc]
 [y]  = ([NY] - 2*[yc]) + [yc]
 [z]  = ([NZ] - 2*[zc]) + [zc]

 ; CALCULATE THE CENTER IN ANGSTROMS
 [xa] = [x] * [ps]
 [ya] = [y] * [ps]
 [za] = [x] * [ps]

 ; CREATE THE MRC (CCP4) FILE
 ; NOTE: FOR DISPLAY, "CHIMERA" READS THE ORIGIN WHEREAS "O" READS THE STARTING 
 ; POINTS OF XYZ. ORIGIN IS GIVEN IN ANGSTROMS, STARTING POINTS ARE GIVEN IN PIXELS.

 CP TO MRC
   _3
   [output] 
   [len]
   -[x], -[y], -[z]
   [ps], [ps], [ps]    
   -[xa], -[ya], -[za]
 
 EN
 

© Copyright Notice /       Enquiries: spider@wadsworth.org