# Step-by-step testing of Reconstruction Protocol using
 # data from Nature Protocols paper without defocus groups

 cd /usr8/spider/test/d_recon1             
    cp $SPIDER_DIR/docs/techs/recon1/spiproject.tar.gz .
    tar -xvf spiproject.tar.gz 

 cd myproject    
    cp `which spider`  ./spider            

    # If using test data:
    tar -xvf $SPIDER_DIR/docs/techs/recon1/natproc_data_mics.tar.gz             

    # If using your own data set
    # ../spider spi/dat    @make-params
    # ../spider spi/dat    @resizevol      

 cd Micrographs 
    ../spider  spi/dat     @make-mic-list                                         
    ../spider  spi/dat     @shrink-mic                                               
    montagefromdoc         ../sel_micrograph.dat  sm_mic_*  & 

 cd ../Power_Spectra 
    # Create power spectra and determine defocus
    ../spider  spi/dat     @ctffind                                   
                                    
    montagefromdoc         ../sel_micrograph.dat  power/pw_avg_*  &

    ctfmatch               power/ctf*   &                           
    ../spider  spi/dat     @make-ctf-cor                                          

    # If phase flipping micrographs:
    ../spider  spi/dat     @apply-ctfcor-mic                                          
 
 cd ../Particles 
    ../spider spi/dat      @make-noise-img
          
    # Particle picking choices;
    ../spider spi/dat      @pick-at           
    ../spider spi/dat      @pick-lfc           

    # [Optional]  Initial verification
    ../spider spi/dat      @denoise-imgs                

    ../spider spi/dat      @micmontagedocs           

    montagefromdoc         win/sel_part_0001.dat  filt/data_bymic_0001.dat & 
    montagefromdoc         win/sel_part_0002.dat  filt/data_bymic_0002.dat & 
    montagefromdoc         win/sel_part_0003.dat  filt/data_bymic_0003.dat & 
    montagefromdoc         win/sel_part_0004.dat  filt/data_bymic_0004.dat & 
      
    # Set input file location first!
    ../spider spi/dat   @number-parts          

 cd ../Reconstruction 
    ../spider spi/dat   @stackwins-n-ctf      
    ../spider spi/dat   @make-ref-views 
       
    # Alignment choices:
    ../spider spi/dat   @align
    ../spider spi/dat   @pub-align   
     
 cd ../Averages 

    ../spider spi/dat   @select-byview     
    ../spider spi/dat   @avg-filt-byview 
    ../spider spi/dat   @plot-cc-vs-view   
    ../spider spi/dat   @show-ref-views    
    ../spider spi/dat   @plot-ref-views         

    # [Optional] Classification-based verification:
     ../spider spi/dat  @verify-class-byview 
   
    # Select good particles
    verifybyview.py        views/prj001            
    # For testing only to just use all class 1 particles
    ../spider spi/dat   @make-good-classes   

    ../spider spi/dat   @verify-combine-classes 
    ../spider spi/dat   @plot-cc-vs-view        
    ../spider spi/dat   @show-ref-views         
    ../spider spi/dat   @plot-ref-views 
    ../spider spi/dat   @verify-recheck 

    ../spider spi/dat   @parts-vs-defocus       
    
    ../spider spi/dat   @best-imgs
    
 cd ../Reconstruction 
    ../spider spi/dat   @recon-regroup         

    # Reconstruction choices:
    cp ../spider .  ; spider spi/dat @pub-recon   
    ../spider spi/dat   @recon 
      
    ../spider spi/dat   @plot-fsc-curve        

 cd ../Refinement 

    # Refinement choices:
    cp ../spider . ;  ./spider spi/dat @pub-refine  
    ../spider spi/dat   @refine      
       
    ../spider spi/dat   @plot-fsc-curves