showgate.FCS            package:rflowcyt            R Documentation

_S_h_o_w_i_n_g _t_h_e _g_a_t_e _a_n_d _t_h_e _d_a_t_a_p_o_i_n_t_s _w_i_t_h_i_n _t_h_e _g_a_t_e _o_n _a _p_r_e_v_o_u_s _p_l_o_t

_D_e_s_c_r_i_p_t_i_o_n:

     On an exisiting plot, the gate specified will be plotted and the
     datapoints lying within the gating range will be colored (default
     is the color purple).

_U_s_a_g_e:

     showgate.FCS(data.mat, gatingrange, Index,
            type = c("uniscut", "biscut", "bidcut", "bipcut"),
            IndexValue.In = 1,
            coltype = 12, pchtype = 8,
            biscut.quadrant = c("+/-","-/-", "+/+", "-/+")) 

_A_r_g_u_m_e_n_t_s:

data.mat: the data to be gated:

     _u_n_i_v_a_r_i_a_t_e _c_a_s_e single column of values: a (m X 1) data vector
          where m is the number of cells/rows

     _b_i_v_a_r_i_a_t_e _c_a_s_e matrix of two column variables: a (m X 2) data
          matrix where m is the number or cells/rows 

gatingrange: gating threshold range in one of the following formats for
          each type of gating:

     "_u_n_i_s_c_u_t" univariate single cut; gatingrange $=$ x1 will
          select/include all  points $>=$ x1 , x1 is numeric value

     "_b_i_d_c_u_t" bivariate double cut:  gatingrange $=$ c(x1,x2, y1,y2), a
          numeric vector of lowerbound, upperbound cutoffs for x and y
          variables

     "_b_i_s_c_u_t" bivariate single cut:gatingrange$=$c(x1,y1), a numeric
          vector of the cutoffs for x and y variables 

     "_b_i_p_c_u_t" bivariate polygonal cut: polygonal thresholds for an
          n-sided polygon with  gatingrange $=$ cbind(c(x1, x2, ...,xn,
          x1), c(y1, y2, ...,yn, y1)), a vector of vectors which denote
          the outer points of the polygonal vertices)

   Index: a vector of 0's and 1's denoting the selection of row
          observations of 'data.mat'

    type: character string of the type of cut/gating:

     "_u_n_i_s_c_u_t" univariate single cut: selects datapoints that are
          greater than or equal to the cutoff value denoted in
          gatingrange

     "_b_i_d_c_u_t" bivariate double cut: selects datapoints in the central
          rectangle formed by two vertical lines (x variable cutoffs)
          and two horizontal lines (y variable cutoffs)

     "_b_i_s_c_u_t" bivariate single cut: cuts graph into quadrants (selects
          datapoints in the quadrant denoted by biscut.quadrant)

     "_b_i_p_c_u_t" bivariate polygonal cut: selects the datapoints in a
          polygon 

IndexValue.In: The value of 'Index' to be selected; default is 1

 coltype: a character string or a numerical value describing the option
          for the color of the data point inside the gating range

 pchtype: a character string or a numerical value describing the option
          for the point size and type of data point inside the gating
          range

biscut.quadrant: character string value denoting the (x,y) quadrant
          that is to be selected; Values are one of the following:

     "$+$/$+$" selects the upper right quadrant, where x is positive
          and y is positive

     "$-$/$+$" selects the upper left quadrant, where x is negative and
          y is positive

     "$+$/$-$" selects the lower right quadrant, where x is positive
          and y is negative

     "$-$/$-$" selects the lower left quadrant, where x is negative and
          y is negative 

_V_a_l_u_e:

     The gating range or gate will be displayed and the data points
     within  the gating range will be colored.

_N_o_t_e:

     The coloring in of data points may take a while to process.  The
     gate selection can only be shown using rectangular binning of the
     image plots using 'ContourScatterPlot'.  The 'showgate.FCS' does
     not work with hexagonal binning.

_A_u_t_h_o_r(_s):

     A.J. Rossini and J.Y. Wan

_S_e_e _A_l_s_o:

     'FHCRC.HVTNFCS','VRC.HVTNFCS', 'plotvar.FCS','createGate',
     'icreateGate'

_E_x_a_m_p_l_e_s:

       if (interactive()){
       if (require(rfcdmin)){
         ## obtaining the FCS objects from VRC data
         if ( !(is.element("unst.1829", objects())
                         & is.element("st.1829", objects())) ){
           data(VRCmin)
         }

         ## univariate plot
         plotvar.FCS(unst.1829, type="uni", varpos=1, plotType=hist)
         ## show cut off at 350
         showgate.FCS(unst.1829@data[,1], type="uniscut", gatingrange=350)
         ## show different cutoff at 500
         showgate.FCS(unst.1829@data[,1], type="uniscut", gatingrange=500,
                      coltype="green")

         ## bivariate plot : rectanglar bins in which the gate can be shown
         plotvar.FCS(unst.1829, type="bi", varpos=c(1,2), hexbin.CSPlot=FALSE)
         ## show cutoff at 275 to 600 for both variables
         ## may take a while
         ## create the gate index as the first column entry of the "gate" matrix
         unst.1829.gt<-createGate(unst.1829, varpos=1:2, type="bidcut",
               gatingrange=c(275, 600, 275, 600))

         ## show the gate
         showgate.FCS(unst.1829.gt@data[,c(1,2)], unst.1829.gt@gate[,1],
            type="bidcut", gatingrange=c(275, 600, 275, 600))

         }
       }

