doccalc   Carry out calculations on document file columns. 
 

file format: input: SPIDER document file

USAGE:        doccalc

        .Input document file: doc001
        [Enter document file name.]
        
        .New (default) or old docfile format (N/O): N
        [Specify  if the document file follows the current (new) space
         separated column format, of the old strict format. If its the
         old format, continuation lines will be ignored though.]
         
        .Name for outpt variable: v.values
        [Enter the name for an output variable that will receive the
         results of the calculations. This is a python named tuple. 
         Specific values returned, see below, depends on option.]
         
                
        the following arithmatic is possible:
                1. 1D statistics (min,max,average,sigma)
                2. 2D vector lenght statistics
                3. Average length & direction of polar vector
                4. Find threshold location descending
        
        .Specify type of calculation (1,2,3 or 4): 1
        
        if "1" was specified, calculate statistics of a single column:
            .Column number: 3
            [Enter column number in document file.]
            
        v.values will contain (example):
        docarith(min=-0.05496, max=0.99998, avg=0.260748, sig=0.395849)

            
        if "2" was specified, calculate statistics of a 2d vector 
             with x in first column and y in second column.
            .Column numbers: 3,4
            [Enter column numbers in document file for the components of
             the 2D vectors.]

        v.values will contain (example):
        docarith(min=0.162052, max=1.00006, avg=0.493869, sig=0.276385)
          where min is minimum length, max is maximum length, 
          avg is average length, sig is the standard deviation. 


        if "3" was specified, calculate statistics of a 2d vector 
             in polar coordinates. 
            .Column numbers: 3,4
            [Enter column numbers in document file for radius and angles 
             of the 2D vectors.]

        v.values will contain (example):
        docarith(x=0.260747, y=0.000331465, rad=0.260748, ang=0.072835)
          where x and y are the coordinates of the average vector, rad
          is the average length and is the average angle (Note: the average
          angle only is meaningfull, if the angular range in the document
          file makes sense. It is simply the straight average of the numbers
          the program finds. No adjustment for any redundancy.]
          
         
        if "4" was specified, calculate location of a threshold value 
             determined in descending order. Purpose is to find the radius
             in a Fourier Ring Correlation file, where the curve crosses
             a certain threshold. 
            .Check (e.g. FRC) column, coord. column: 3,1
            [Enter column numbers of the Fourier Ring correlation and 
             specify the column number for the x-coordinate. The return
             will be the interpolated x-coordinate for the location  of the
             threshold value (s. below)]
             
            .threshold value: 0.3
            [Specify the threshold value, for which the interpolated
             corrdinate is determined.] 

        v.values will contain (example):
        docarith(key=23.0, rad=0.139642, frc1=0.3612, frc2=0.18262)          
        where key is the key after crossing the threshold, rad is the
        interpolated Fourier radius where the threshold is crossed (assuming
        that in the example column 1 contains the radius in absolute Fourier
        units), frc1 is the value above the threshold, frc2 the first value
        below the threshold. This example uses threshold 0.3. ]


PROGRAMS: docarith.f

Author(s): M. Radermacher