beam1.m


The Matlab function beam1.m takes as input an observed gene expression level and outputs the BEAM estimate of the transcript level, and the standard deviation of this estimate.

Required data files:

  • one_val_est.mat
  • one_val_std.mat
  • x_range.mat

    function [est, std] = beam1(X)
    % [EST, STD] = BEAM1(X)
    %
    %  Given a chip reading X, returns the BEAM estimate of the transcript level
    %  in EST, and the standard deviation in STD.  X may be a vector, in which
    %  case EST and STD are vectors of the same size, returning estimate and
    %  standard deviation for corresponding elements.
    
    % Load lookup table
    load -ascii one_val_est;
    load -ascii one_val_std;
    load -ascii one_val_range;
    
    min_range = min(one_val_range);
    max_range = max(one_val_range);
    if any(X(:) < min_range) | any(X(:) > max_range)
      warning(sprintf('One or more input values is outside the range \n of the precomputed lookup table (i.e., less than %1.0f \n or greater than %1.0f).  The corresponding output \n values will be stored as ''NaN'' (Not a Number)',min_range,max_range));
    end
    
    est = reshape(interp1(one_val_range, one_val_est, X(:), 'linear'), size(X));
    std = reshape(interp1(one_val_range, one_val_std, X(:), 'linear'), size(X));
    
    

  • rif@alum.mit.edu