Additional supplemental material – Image processing scripts. Particle picking done in SPIDER ; SPIDER based script pick-particles.tst ; used for automated particle picking from micrographs acquired by CCD ; requires a reference made from aligning and averaging hand picked ; particles. ; assumes protein is white. (inverts micrograph contrast) ; generates coordinates for boxing particles. ; call two other scripts box-particles.tst which boxes particles based ; on coordinates saved. Sort-particles masks, normalizes and realigns ; boxed images to the original reference any boxed images with large x ; or y shifts are excluded based on the empirical observation that ; large shifts after masking usually indicate an incorrectly picked ; particle. For explanation of function and syntax consult the SPIDER ; web page http://www.wadsworth.org/spider_doc/spider/docs/spider.html ; The directories and file organization reflect the automated data ; acquisition scheme. 8 images each with a different defocus are ; acquired ; around a central position where beam illumination and defocus are ; determined. The images are group by intended defocus. The defocus ; is determined and a phase correction is applied. Images are ; determined to ; be bad or good or defocus is bad or good and this information is ; stored in ; the masterdoc*** ; files to be read during picking. The subdirectory ; structure under the main directory, which contains a singles dataset, ; is: ./CTF/exp*, ./docs, ./particles, and ./scripts. md tr on md set mp 6 cp ref000 refpart fs refpart [ref-dimx]=x1 [ref-dimy]=x2 [how-many-parts-to-pick]=900 ;?how_many_particles? [part-diam-angs]=150 ;?particle diameter angstroms? [CCDdimension]=4096 [image-angs-per-pixel]=1.78 ; ?scale angstroms/pixel? [const1]=1 [cc-peak-excl-factor]=1.4 ; exclude peaks/particles closer than [cc-peak-excl-factor]*diam [reduction-factor]=4 ; ?reduction factor? [ccfdimension]=[CCDdimension]/[reduction-factor] [final-angs-per-pixel]=[image-angs-per-pixel]*[reduction-factor] [part-spacing]=([part-diam-angs]/[final-angs-per-pixel])*[cc-peak-excl-factor] x91=1 [first-exp]=1 [last-exp]=8 x51=0 [boxsize]=140 [low-pass-filt]=3 [low-pass-cutoff]=0.06 [hi-pass-filt]=4 [hi-pass-cutoff]=0.005 sd [const1],[part-diam-angs],[final-angs-per-pixel],[reduction-factor] ../docs/params do lb43 [exp-num]=[first-exp],[last-exp] x81=0 ud n [num-images],x48 ../CTF/exp{*[exp-num]}/masterdoc_exp{*[exp-num]} do lb42 [current-image]=x91,[num-images] ud [current-image],x71,x72,x73,x74,x75,x76,x77,x78 ../CTF/exp{*[exp-num]}/masterdoc_exp{*[exp-num]} if(x76.eq.[const1])goto lb89 x81=x81+1 x51=x51+1 cp ../CTF/exp{*[exp-num]}/pha_exp{*[exp-num]}_{***[current-image]} ___out001 ra ___out001 ___out002 fs ___out002 [mean]=x5 [sd-factor]=x6/20 [ccfdimx]=[CCDdimension]/[reduction-factor] [padx]=(([CCDdimension]-[ref-dimx])/2)+1 [pady]=(([CCDdimension]-[ref-dimy])/2)+1 pd refpart ___ref003 [CCDdimension],[CCDdimension] n (0) [padx],[pady] ip ___ref003 ___ref004 [ccfdimx],[ccfdimx] cp ___ref004 refout ip ___out002 ___out001 ([ccfdimx],[ccfdimx]) cp ___out001 ipout fs ___out001 [temp]=x6 [mean]=x5 fs ___out001 [mean]=x5 [sdev]=x6 [sd-factor]=[sdev]/20 x33=-1 ar ___out001 ___out002 ((p1-[mean])/[sd-factor]) ar ___out002 ___out001 (p1*x33) cp ___out001 arout x81=[part-diam-angs]/[final-angs-per-pixel] x93=([ccfdimx])/(x81/1.5) [low-pass-cutoff]=x93/[ccfdimx] x94=([ccfdimx])/(x81*4) [high-pass-cutoff]=x94/[ccfdimx] fq ___out001 ___out002 [hi-pass-filt] [hi-pass-cutoff] fq ___out002 ___out001 [low-pass-filt] [low-pass-cutoff] cp ___out001 filtout cc ___out001 ___ref004 ___ccf005 cp ___ccf005 ccfout pk dr x11,x12,x13,x14,x15,x16,x17 ___ccf005 [how-many-parts-to-pick],[const1] [const1],[const1] [part-spacing] ../docs/peakdoc_exp{*[exp-num]}_{***[current-image]} ud n [num-parts-passed],x72 ../docs/peakdoc_exp{*[exp-num]}_{***[current-image]} [counter]=1 [maxxy]=[ccfdimension]-(([boxsize]/[reduction-factor])+(50/[reduction-factor])) [minxy]=([boxsize]/[reduction-factor])+(50/[reduction-factor]) do lb21 [current]=[carbon],[num-parts-passed] ud [current],x21,x22,x23,x24 ../docs/peakdoc_exp{*[exp-num]}_{***[current-image]} [top-x-corner]=x21-int(([boxsize]/2)/[reduction-factor]) [top-y-corner]=x22-int(([boxsize]/2)/[reduction-factor]) if([top-x-corner].lt.[const1])then goto lb33 endif if([top-y-corner].lt.[const1])then goto lb33 endif if([top-x-corner].gt.[maxxy])then goto lb33 endif if([top-y-corner].gt.[maxxy])then goto lb33 endif [realx]=int([top-x-corner]*[reduction-factor]) [realy]=int([top-y-corner]*[reduction-factor]) sd [counter],[realx],[realy],[top-x-corner],[top-y-corner],x21,x22,x51 ../docs/peakdocs_exp{*[exp-num]}_{***[current-image]} [counter]=[counter]+1 lb33 lb21 sd e ../docs/peakdoc_exp{*[exp-num]}_{***[current-image]} sd e ../docs/peakdocs_exp{*[exp-num]}_{***[current-image]} lb89 lb42 lb43 sd e ../docs/params @box-particles @sort-particles En ; box-particles.tst windows particles from micrographs. [how-many-parts-to-pick]=1400 ;?how_many_particles? [part-diam-angs]=150 ;?particle diameter angstroms? [ccf-dimension]=4096 [image-angs-per-pixel]=1.78 ; ?scale angstroms/pixel? [const1]=1 [cc-peak-excl-factor]=1.5 ; exclude peaks/particles closer than [cc-peak-excl-factor]*diam [part-spacing]=([part-diam-angs]/[image-angs-per-pixel]) [reduction-factor]=1 ; ?reduction factor? [final-angs-per-pixel]=[image-angs-per-pixel]*[reduction-factor] [first-exp]=4 [last-exp]=8 [boxdim]=140 [const1]=1 x91=1 x51=0 x33=20 ud [const1],[part-diam-angs],[final-angs-per-pixel],[reduction-factor] ../docs/params do lb43 [exp-num]=[first-exp],[last-exp] ud n x57,x58 ../CTF/exp{*[exp-num]}/masterdoc_exp{*[exp-num]} do lb42 [current-image]=x91,x57 ud ic [current-image],x71,x72,x73,x74,x75,x76,x77,x78 ../CTF/exp{*[exp-num]}/masterdoc_exp{*[exp-num]} if(x76.eq.[const1])goto lb89 x51=x51+1 cp ../CTF/exp{*[exp-num]}/pha_exp{*[exp-num]}_{***[current-image]} ___out001 ud n x12,x13 ;?last key? ../docs/peakdocs_exp{*[exp-num]}_{***[current-image]} do lb2 x80=[const1],x12 ud ic x80,x31,x32 ../docs/peakdocs_exp{*[exp-num]}_{***[current-image]} wi ___out001 ../particles/imgpha_exp{*[exp-num]}_{***[current-image]}_@{*****x80} [boxdim],[boxdim] x31,x32 sd x80,x31,x32,[boxdim],x76,x90 ../docs/pickeddoc_exp{*[exp-num]}_{***[current-image]} lb2 sd e ../docs/pickeddoc_exp{*[exp-num]}_{***[current-image]} ud ice ../docs/peakdocs_exp{*[exp-num]}_{***[current-image]} lb89 lb42 ud ice ../CTF/exp{*[exp-num]}/masterdoc_exp{*[exp-num]} lb43 lb1 sd e ../docs/params Re SPIDER script box-particles ; box-particles.tst windows particles from micrographs. [const1]=1 [first-exp]=1 [last-exp]=8 [boxdim]=140 [const1]=1 x91=1 x51=0 x33=20 ud [const1],[part-diam-angs],[final-angs-per-pixel],[reduction-factor] ../docs/params do lb43 [exp-num]=[first-exp],[last-exp] ud n x57,x58 ../CTF/exp{*[exp-num]}/masterdoc_exp{*[exp-num]} do lb42 [current-image]=x91,x57 ud ic [current-image],x71,x72,x73,x74,x75,x76,x77,x78 ../CTF/exp{*[exp-num]}/masterdoc_exp{*[exp-num]} if(x76.eq.[const1])goto lb89 x51=x51+1 cp ../CTF/exp{*[exp-num]}/pha_exp{*[exp-num]}_{***[current-image]} ___out001 ud n x12,x13 ;?last key? ../docs/peakdocs_exp{*[exp-num]}_{***[current-image]} do lb2 x80=[const1],x12 ud ic x80,x31,x32 ../docs/peakdocs_exp{*[exp-num]}_{***[current-image]} wi ___out001 ../particles/imgpha_exp{*[exp-num]}_{***[current-image]}_@{*****x80} [boxdim],[boxdim] x31,x32 sd x80,x31,x32,[boxdim],x76,x90 ../docs/pickeddoc_exp{*[exp-num]}_{***[current-image]} lb2 sd e ../docs/pickeddoc_exp{*[exp-num]}_{***[current-image]} ud ice ../docs/peakdocs_exp{*[exp-num]}_{***[current-image]} lb89 lb42 ud ice ../CTF/exp{*[exp-num]}/masterdoc_exp{*[exp-num]} lb43 lb1 sd e ../docs/params re SPIDER script sort-particles ; sort-particles.tst Normalizes, masks and align particles to original ; reference. Large x or y shifts are a good indicator for incorrectly ; picked junk. These are not included in the image stacks. ; All data from a single dataset is combined into a single stack. md tr on md set mp 6 x52=0 x35=-1.0 x53=0 [part-diam-angs]=110 ;?particle diameter angstroms? [ccf-dimension]=4096 [image-angs-per-pixel]=1.78 ; ?scale angstroms/pixel? [const1]=1 [final-angs-per-pixel]=[image-angs-per-pixel]*[reduction-factor] x91=1 fr g [file-name]T55-080509big x33=20 [first-exp]=1 [last-exp]=8 x51=0 [boxdim]=140 [const1]=1 ud [const1],[part-diam-angs],[final-angs-per-pixel],[reduction-factor] ../docs/params x65=([part-diam-angs]/([final-angs-per-pixel]/[reduction-factor]))/2 [maskouter]=int(1.2*x65) [maskinner]=0 fs refpart x29=x1 x30=(512-x29) x31=int((x30/2)+1) x32=x31 pd refpart ___out001 (512,512) n (0) x31,x32 ma ___out001 ___ref005 [maskouter],[maskinner] g e (0) (257,257) (3.5) cp ___ref005 bigref do lb44 [exp-num]=[first-exp],[last-exp] x51=x51+1 ud n x57,x58 ../CTF/exp{*[exp-num]}/masterdoc_exp{*[exp-num]} do lb42 [current-image]=x91,x57 ud ic [current-image],x71,x72,x73,x74,x75,x76,x77,x78 ../CTF/exp{*[exp-num]}/masterdoc_exp{*[exp-num]} if(x76.eq.[const1])goto lb89 x83=1 ; ?first? ud n x84,x85 ../docs/pickeddoc_exp{*[exp-num]}_{***[current-image]} sd x51,x83,x84,x74,[current-image] checkme1 do lb1 x80=x83,x84 cp ../particles/imgpha_exp{*[exp-num]}_{***[current-image]}_@{*****x80} ___out001 fs ___out001 x31=x5 du v ___out001 (4) (3) x31 fs ___out001 x31=x5 x32=x6 x20=x6/x33 x34=x20*x35 x40=(512-x1) x41=int((x40/2)+1) x42=x41 ar ___out001 ___out002 ((p1-x31)/x34) cp ___out002 ../particles/imgphanorm_exp{*[exp-num]}_{***[current-image]}_@{*****x80} pd ___out002 ___out003 (512,512) n (0) x41,x42 ma ___out003 ___out002 [maskouter],[maskinner] g e (0) (257,257) (3.5) cc ___out002 ___ref005 ___ccf004 pk x11,x12,x13,x14,x15,x16,x17 ___ccf004 (1,0) sd x80,x11,x12,x13,x14,x15,x16 ../docs/shcenterpha_exp{*[exp-num]}_{***[current-image]} lb1 x53=x53+1 as r ../particles/imgphanorm_exp{*[exp-num]}_{***[current-image]}_@***** x83-x84 a imgphanormbigfavg_@{****x53} imgphanormbigvar_@{****x53} sd e ../docs/shcenterpha_exp{*[exp-num]}_{***[current-image]} do lb2 x80=x83,x84 ud ic x80,x11,x12,x13,x14,x15,x16 ../docs/shcenterpha_exp{*[exp-num]}_{***[current-image]} x21=abs(x15) x22=abs(x16) if(x21.gt.8)goto lb5 if(x22.gt.8)goto lb5 if(x14.eq.0.0)goto lb5 x52=x52+1 x97=0 fs ../particles/imgphanorm_exp{*[exp-num]}_{***[current-image]}_@{*****x80} ra ../particles/imgphanorm_exp{*[exp-num]}_{***[current-image]}_@{*****x80} ___out001 fs ___out001 sh f ___out001 ___out003 -x15,-x16 cp ___out003 ../alignment/[file-name]pha_@{******x52} fq ___out003 ../alignment/[file-name]phaF_@{******x52} (3) (0.17) fs ../alignment/[file-name]pha_@{******x52} sd x52,x90,x80,x3,x4,x5,x6 [file-name]imagestats sd x52,x52,x73,[exp-num],[current-image],x80,x15,x16 [file-name]good lb5 lb2 [sum]=[sum]+x84 [good]=x52 sd x51,x52,x53,x83,x84,[current-image],[sum],[good] checkme2 ud ice ../docs/shcenterpha_exp{*[exp-num]}_{***[current-image]} sd x91,x80,x52 last-good lb89 lb42 ud ice ../CTF/exp{*[exp-num]}/masterdoc_exp{*[exp-num]} lb44 lb22 sd e [file-name]imagestats sd e [file-name]good sd e last-good as r ../alignment/[file-name]pha_@****** x91-x52 a ../alignment/goodphabigavg ../alignment/goodphabigvar re Alignment Reconstruction and classifcation SPIDER script make-refs-align ; This script launches 15 rounds of alignment increasing ref. number ; after each 5 rounds and classifying the aligned images every 5th ; round. Reference projections are made using a set of euler ; angles generated by SPIDER. Aligned images are reconstructed and the ; new reconstruction becomes the current reference. For explanation of ; syntax and functions see ; http://www.wadsworth.org/spider_doc/spider/docs/spider.html ; for questions contact thomas@biochem.mpg.de [first]=1 [A]=1 [B]=2 [C]=3 [D]=5 [E]=6 [F]=10 [G]=11 [H]=15 [refs0]=287 [refs1]=447 [refs2]=879 [set]=1 md set mp 7 md tr on fr g [file-name]AllTOB-His55 ; global variable for constructing file names do lb57 [round]=[A],[B] [numrefs]=[refs0] th f ../alignment/newref{*[set]} ___out001 b (0.05) (0) pj 3q ___out001 (64) [first]-[numrefs] ../alignment/{***[refs0]}refs ../alignment/ref{*[set]}_{**[round]}_@**** as r ../alignment/ref{*[set]}_{**[round]}_@**** [first]-[numrefs] a ../alignment/ref{*[set]}_{**[round]}avg ../alignment/ref{*[set]}_{**[round]}var ap shc ../alignment/ref{*[set]}_{**[round]}_@**** [first]-[numrefs] (12,2) (1,56,2,1) ../alignment/{***[refs0]}refs ../alignment/[file-name]F_@****** ./AllTOB-His55good01 * (0.0,0.0) (0) ../alignment/[file-name]_out_{*[set]}_{**[round]} @rot-shift-recon3D-Tob([round],[numrefs],[set]) lb57 do lb58 [round]=[C],[D] [numrefs]=[refs0] th f ../alignment/newref{*[set]} ___out001 b (0.05) (0) pj 3q ___out001 (64) [first]-[numrefs] ../alignment/{***[refs0]}refs ../alignment/ref{*[set]}_{**[round]}_@**** as r ../alignment/ref{*[set]}_{**[round]}_@**** [first]-[numrefs] a ../alignment/ref{*[set]}_{**[round]}avg ../alignment/ref{*[set]}_{**[round]}var ud n [last],x98 ./AllTOB-His55good01 ap shc ../alignment/ref{*[set]}_{**[round]}_@**** [first]-[numrefs] (8,2) (1,58,1,1) ../alignment/{***[refs0]}refs ../alignment/al[file-name]_{*[set]}_02_@****** [first]-[last] * (0.0,0.0) (0) ../alignment/[file-name]_out_{*[set]}_{**[round]} @rot-shift-recon3D([round],[numrefs],[set]) lb58 @classify([round],[numrefs],[set]) do lb59 [round]=[E],[F] [numrefs]=[refs1] th f ../alignment/newref{*[set]} ___out001 b (0.04) (0) pj 3q ___out001 (64) [first]-[numrefs] ../alignment/{***[refs1]}refs ../alignment/ref{*[set]}_{**[round]}_@**** as r ../alignment/ref{*[set]}_{**[round]}_@**** [first]-[numrefs] a ../alignment/ref{*[set]}_{**[round]}avg ../alignment/ref{*[set]}_{**[round]}var ud n [last],x96 ./AllTOB-His55good01 ap shc ../alignment/ref{*[set]}_{**[round]}_@**** [first]-[numrefs] (6,1) (1,60,1,1) ../alignment/{***[refs1]}refs ../alignment/al[file-name]_{*[set]}_02_@****** [first]-[last] * (0.0,0.0) (0) ../alignment/[file-name]_out_{*[set]}_{**[round]} @rot-shift-recon3D-Tob-4([round],[numrefs],[set]) lb59 @classify([round],[numrefs],[set]) do lb60 [round]=[G],[H] [numrefs]=[refs2] th f ../alignment/newref{*[set]} ___out001 b (0.04) (0) pj 3q ___out001 (60) [first]-[numrefs] ../alignment/{***[refs2]}refs ../alignment/ref{*[set]}_{**[round]}_@**** as r ../alignment/ref{*[set]}_{**[round]}_@**** [first]-[numrefs] a ../alignment/ref{*[set]}_{**[round]}avg ../alignment/ref{*[set]}_{**[round]}var ud n [last],x96 ../alignment/how-many ap shc ../alignment/ref{*[set]}_{**[round]}_@**** [first]-[numrefs] (6,1) (1,60,1,1) ../alignment/{***[refs2]}refs ../alignment/al[file-name]_{*[set]}_02_@****** [first]-[last] * (0.0,0.0) (0) ../alignment/[file-name]_out_{*[set]}_{**[round]} @rot-shift-recon3D-Tob-4([round],[numrefs],[set]) lb60 @classify([round],[numrefs],[set]) @calc-changes([round],[numrefs],[set]) en SPIDER script rot-shift-recon3D ; applies determined in-plane rotation and x and y shifts to images, ; then calculates backprojection in Fourier space. Filters new map and ; creates a new reference from it. Also calls subscript to generate ; class averages. ([round],[numrefs],[set]) ; first line of script lists passed variables [first]=1 [gausslowpass]=3 [lowpasscutoff]=0.18 [upper]=1.4 [lower]=0.6 [maxangle]=90 [noisethresh]=3 doc sort ../alignment/[file-name]_out_{*[set]}_{**[round]} ../alignment/[file-name]_out_{*[set]}_{**[round]} 0 y ud n [howmany],x82 ../alignment/[file-name]_out_{*[set]}_{**[round]} do lb11 [num]=[first],[howmany] ud ic [num],x60,x61,x62,[refproj],x64,[rot],[xsh],[ysh],x68,x69,x70,x71,x72,x73,x74 ../alignment/[file-name]_out_{*[set]}_{**[round]} rt sq ../alignment/al[file-name]_{*[set]}_02_@{******[num]} ../alignment/al[file-name]_{*[set]}_{**[round]}_@{******[num]} [rot],[first] [x-sh],[y-sh] sd [num],[num] ../docs/[file-name]_class_{*[set]}_{**[round]}_{****[refproj]} lb11 ud ice ../alignment/[file-name]_out_{*[set]}_{**[round]} as r ../alignment/al[file-name]_{*[set]}_{**[round]}_@****** [first]-[howmany] a ../alignment/al[file-name]_{*[set]}_avg{**[round]} ../alignment/al[file-name]_{*[set]}_var{**[round]} bp 32f ../alignment/al[file-name]_{*[set]}_{**[round]}_@****** [first]-[howmany] ../alignment/[file-name]_out_{*[set]}_{**[round]} * ../alignment/[file-name]_3D_{*[set]}_{**[round]} ../alignment/even_{*[set]}_{**[round]} ../alignment/odd_{*[set]}_{**[round]} rf 3 ../alignment/even_{*[set]}_{**[round]} ../alignment/odd_{*[set]}_{**[round]} [first] [lower],[upper] c [maxangle] [noisethresh] ../alignment/[file-name]3D_fsc_{*[set]}_{**[round]} fq ../alignment/[file-name]_3D_{*[set]}_{**[round]} ../alignment/[file-name]_3Df_{*[set]}_{**[round]} [gausslowpass] [lowpasscutoff] cp ../alignment/[file-name]_3Df_{*[set]}_{**[round]} ../alignment/newref{*[set]} @make-classavgsall([round],[numrefs],[set]) re SPIDER script make-classavgsall ; Make-classavgsall calculates the averages of all images matching a ; given reference. The average cc value for each reference class is ; also calculated and saved. ([round],[numrefs],[set]) [first]=1 [zero]=0 do lb1 [classnum]=[first],[numrefs] doc sort ../docs/[file-name]_class_{*[set]}_{**[round]}_{****[classnum]} ../docs/[file-name]_class_{*[set]}_{**[round]}_{****[classnum]} (0) y ud n [howmany],x84 ../docs/[file-name]_class_{*[set]}_{**[round]}_{****[classnum]} sd [classnum],[classnum],[howmany],[zero] how-many-classavg_{*[set]}_{**[round]} as r ../alignment/al[file-name]_{*[set]}_{**[round]}_@****** ../docs/[file-name]_class_{*[set]}_{**[round]}_{****[classnum]} a ../alignment/[file-name]classavgs_{*[set]}_{**[round]}_@{****[classnum]} ../alignment/[file-name]classvars_{*[set]}_{**[round]}_@{****[classnum]} [sum]=0 do lb26 [num]=[first],[howmany] ud ic [num],[imagenum] ../docs/[file-name]_class_{*[set]}_{**[round]}_{****[classnum]} ud ic [imagenum],x60,x61,x62,x63,x64,x65,x66,x67,x68,x69,[ccval],x71,x72,x73,x74 ../alignment/[file-name]_out_{*[set]}_{**[round]} [sum]=[sum]+[ccval] lb26 ud ice ../docs/[file-name]_class_{*[set]}_{**[round]}_{****[classnum]} ud ice ../alignment/[file-name]_out_{*[set]}_{**[round]} [avgccval]=[sum]/[howmany] sd [classnum],[avgccval],[howmany] ../alignment/average-cc-{*[set]}-{**[round]} lb1 re SPIDER script Classify performs K-means classification on aligned images. ([round],[numrefs],[set]) [first]=1 [numclasses]=[numrefs]+60 ; number of classes [weight]=0 [factors2]=60 [factors1]=80 ud n [how-many],x99 ./AllTOB-His55good01 ca s ../alignment/al[file-name]_{*[set]}_{**[round]}_@****** [first]-[how-many] ../alignment/msk004 [factors1] i ../alignment/[file-name]classify_{*[set]}_{**[round]} cl km ../alignment/[file-name]classify_{*[set]}_{**[round]}_IMC [numclasses] [first]-[factors2] [weight] (6732) ../docs/[file-name]classify_{*[set]}_{**[round]}_doc**** map022 @make-classavgs([round],[numclasses],[set]) re SPIDER script make-classavgs averages images belonging to classes determined by k-means classification. ; make-classavgs calculates classification based class averages. ([round],[numclasses],[set]) [first]=1 [zero]=0 do lb1 [classnum]=[first],[numclasses] ud n [how-many],x85 ../docs/[file-name]classify_{*[set]}_{**[round]}_doc{****[classnum]} as r ../alignment/al[file-name]_{*[set]}_{**[round]}_@****** ../docs/[file-name]classify_{*[set]}_{**[round]}_doc{****[classnum]} a ../alignment/[file-name]classifiedavgs_{*[set]}_{**[round]}_@{****[classnum]} ../alignment/[file-name]classifiedvars_{*[set]}_{**[round]}_@{****[classnum]} sd [classnum],[how-many],[zero] how-many-classified_{*[set]}_{**[round]} lb1 re Spider script Cal-changes ; determines how much alignment parameters have changed during 4 rounds of alignment. ([round],[numrefs]) [first]=1 x12=[round]-1 x13=[round]-2 x14=[round]-3 md set mp 7 ud n [last],x99 ../alignment/[file-name]_out_{**[round]} md set mp 7 do lb1 x90=[first],[last] ud ic x90,[phi1],[theta1],[psi1],[ref1],[imgnum],[inplane1],[x1],[y1],[numrefs],[crap],[cc1] ../alignment/[file-name]_out_{**[round]} ud ic x90,[phi2],[theta2],[psi2],[ref2],[imgnum],[inplane2],[x2],[y2],[numrefs],[crap],[cc2] ../alignment/[file-name]_out_{**x12} ud ic x90,[phi3],[theta3],[psi3],[ref3],[imgnum],[inplane3],[x3],[y3],[numrefs],[crap],[cc3] ../alignment/[file-name]_out_{**x13} ud ic x90,[phi4],[theta4],[psi4],[ref4],[imgnum],[inplane4],[x4],[y4],[numrefs],[crap],[cc4] ../alignment/[file-name]_out_{**x14} [refchange]=abs([ref1]-[ref2])+abs([ref2]-[ref3])+abs([ref3]-[ref4]) [ccchange]=([cc1]-[cc2])+([cc2]-[cc3])+([cc3]-[cc4]) [inplanechange]=([inplane1]-[inplane2])+([inplane2]-[inplane3])+([inplane3]-[inplane4]) [xtotal]=([x1]-[x2])+([x2]-[x3])+([x3]-[x4]) [ytotal]=([y1]-[y2])+([y2]-[y3])+([y3]-[y4]) [psitotal]=abs(([psi1]-[psi2])+([psi2]-[psi3])+([psi3]-[psi4])) [thetatotal]=abs(([theta1]-[theta2])+([theta2]-[theta3])+([theta3]-[theta4])) [high]=349.9 [low]=10.1 [temp]=([psitotal]) if([temp].gt.[high])then [psitotal]=abs(360-[temp]) elseif([temp].lt.[low])then [psitotal]=[temp] else [psitotal]=abs(180-[temp]) endif sd x90,[refchange],[ccchange],[inplanechange],[xtotal],[ytotal],[thetatotal],[psitotal],[temp] ../alignment/total-changes lb1 ud ice ../alignment/[file-name]_out_{**[round]} ud ice ../alignment/[file-name]_out_{**x12} ud ice ../alignment/[file-name]_{**x13} ud ice ../alignment/[file-name]_out_{**x14} ud ice ../alignment/[file-name]_out_{**x13} @get-allno-changes([round]) en Script – get-all-nochanges Gets “good” images averages and reconstructs them. ; make a new image stack, average and reconstruction from images with stable alignment ; parameters. Only psi and theta seem to be relavent. One can use no change or some small ; allowed change 10 degrees or less for example. There is not very much difference. ; Unstable X and shifts and inplane rotation changes are mostly excluded by the Psi and ; theta criteria. (x11) [first]=1 [counter]=0 ud n [last],x99 ../alignment/[file-name]_out_{**x11} md set mp 7 do lb1 [num]=[first],[last] ud ic [num],[refchange],[ccchange],[inplane],[xtot],[ytot],[thetatot],[psitot],[temp] ../alignment/total-changes [xmax]=1 [ymax]=1 [thetamax]=10 [psimax]=10 [dtheta]=abs([thetatot]) [dpsi]=abs([psitot]) if([dtheta].gt.[thetamax])goto lb89 if([dpsi].gt.[psimax])goto lb89 [counter]=[counter]+1 sd [counter],[refchange],[ccchange], ],[inplane],[xtot],[ytot],[thetatot],[psitot],[temp] ../alignment/totchange-anglesgood cp ../alignment/al[file-name]_{**x11}_@{******[num]} ../alignment/totchange-anglesgood_{**x11}_@{******[counter]} lb89 lb1 as r ../alignment/totchange-anglesgood_{**x11}_@****** [first]-[counter] a ../alignment/totchange-anglesgood-avg ../alignment/totchange-anglesgood-var bp 32f ../alignment/al[file-name]_{**x11}_@****** ../alignment/totchange-anglesgood ../alignment/[file-name]_out_{**x11} * ../alignment/totchange-anglesgood_3D ../alignment/even1 ../alignment/odd1 fq ../alignment/totchange-anglesgood_3D ../alignment/totchange-anglesgood_3Df 3 0.20 re MATLAB/Tom_toolbox script for CTF correction % MATLAB script for determining and correcting CTF function fit_script %************************ %CONFIGURATION %************************ all_pathname{1}='/TOB/080509//CTF/exp1/em/'; all_pathname{2}='/TOB/080509//CTF/exp2/em/'; all_pathname{3}='/TOB/080509//CTF/exp3/em/'; all_pathname{4}='/TOB/080509//CTF/exp4/em/'; all_target_path{1}='/TOB/080509//CTF/exp1/em_corr/'; all_target_path{2}='/TOB/080509//CTF/exp2/em_corr/'; all_target_path{3}='/TOB/080509//CTF/exp3/em_corr/'; all_target_path{4}='/TOB/080509//CTF/exp4/em_corr/'; search_range{1}=-2.7000e-06:2.0000e-08:-0.4000e-06; search_range{2}=-2.7000e-06:2.0000e-08:-0.4000e-06; search_range{3}=-2.7000e-06:2.0000e-08:-0.5000e-06; search_range{4}=-2.8000e-06:2.0000e-08:-0.5000e-06; for i=1:length(all_pathname) %input I/O in_pathname=all_pathname{i}; in_ext='.em'; %phys parameter Fit.EM.Objectpixelsize=1.7800e-10; % in m Fit.EM.Voltage=120000; % in V Fit.EM.Cs=0.0020; %in m Fit.EM.Cc=0.0022; %in m %Periodogram Search.ps_size=[256 256]; %Background and Mask Search.mask_inner_radius=9; % in pix ... Search.mask_outer_radius=70; Search.mask_inner_radius_bg=8; Search.mask_outer_radius_bg=128; %Fitting parameter %Search.Dz_search=-4.0000e-06:1.0000e-07:-2.0000e-06; %vector in m Search.Dz_search=search_range{i}; Search.Dz_delta_search=0:2.0000e-08:1.0000e-06; %vector in m Search.Phi_0_search=0:0.5:179.5; %vector in deg Search.decay_search=0; Search.amplitude_contrast_search=0.0700; Search.decay_part_coh_ill_search=0; Search.decay_energy_spread_search=0.8; %parameter for image correction target_path=all_target_path{i}; %path for corr img corr_cut_off_pix=2048; %cut off in pix method='flip'; %transfer and pack Data Fit.mask_inner_radius=Search.mask_inner_radius; % in pix ... Fit.mask_outer_radius=Search.mask_outer_radius; Fit.mask_inner_radius_bg=Search.mask_inner_radius_bg; Fit.mask_outer_radius_bg=Search.mask_outer_radius_bg; ctf.Fit=Fit; ctf.Search=Search; %check for overwrite !!!!!!!!!!!! % if (strcmp(in_pathname,target_path)) % Answ=questdlg('source path == target path '); % if (strcmp(Answ,'Yes')==0) % return; % end; % end; %***************************** %Calls %***************************** %call for Fit %tom_fit_ctf_folder(in_pathname,in_ext,'',ctf,'none'); %call for Fit&Correct tom_fit_ctf_folder(in_pathname,in_ext,target_path,ctf,method,corr_cut_off_pix); %call for Correct %ctf.no_fit=1; %do not set 0 for switch on ...just leave the line ...existence of no_fit is tested %tom_fit_ctf_folder(in_pathname,in_ext,target_path,ctf,method,corr_cut_off_pix); end;