warpSet              package:flowStats              R Documentation

_N_o_r_m_a_l_i_z_a_t_i_o_n _b_a_s_e_d _o_n _l_a_n_d_m_a_r_k _r_e_g_i_s_t_r_a_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     This function will perform a normalization of flow cytometry data
     based on warping functions computed on high-density region
     landmarks for individual flow channels.

_U_s_a_g_e:

     warpSet(x, stains, grouping = NULL, monwrd = TRUE, subsample=NULL,
     peakNr=NULL, clipRange=0.01, nbreaks=11, fres, ...)

_A_r_g_u_m_e_n_t_s:

       x: A 'flowSet'. 

  stains: A character vector of flow parameters in 'x' to be
          normalized. 

grouping: A character indicating one of the phenotypic variables in the
          'phenoData' slot of 'x' used as a grouping factor. The
          within-group and between-group variance is computed and a
          warning is issued in case the latter is bigger than the
          former, indicating the likely removal of signal by the
          normalization procedure.  

  monwrd: Logical. Compute strictly monotone warping functions. This
          gets directly passed on to 'landmarkreg'. 

subsample: Numeric. Reduce the number of events in each 'flowSet' by
          sub sampling for all density estimation steps and the
          calculation of the warping functions. This can increase
          computation time for large data sets, however it might reduce
          the accuracy of the density estimates. To be used with care. 

  peakNr: Numeric scalar. Force a fixed number of peaks to use for the
          normalization.

clipRange: Only use peaks within a clipped data range. Essentially, the
          number indicates the percent of clipping on both sides of the
          data range, e.g. 'min(x) - 0.01 * diff(range(x))'.

 nbreaks: The number of spline sections used to approximate the data.
          Higher values produce more accurate results, however this
          comes with the cost of increaseqd computing times. For most
          data, the default setting is good enough.

    fres: A named list of 'filterResultList' objects. This can be used
          to speed up the process since the 'curv1Filter' step can take
          quite some time.

     ...: Further arguments that are passed on to 'landmarkreg'. 

_D_e_t_a_i_l_s:

     Normalization is archived by first identifying high-density
     regions (landmarks) for each 'flowFrame' in the 'flowSet' for a
     single channel and subsequently by computing warping functions for
     each 'flowFrame' that best align these landmarks. This is based on
     the algorithm implemented in the 'landmarkreg' function in the
     'fda' package. An intermediate step classifies the high-density
     regions, see 'landmarkMatrix' for details.

     Please note that this normalization is on a channel-by-channel
     basis. Multiple channels are normalized in a loop.

_V_a_l_u_e:

     The normalized 'flowSet'.

_N_o_t_e:

     We currently use a patched fda version.

_A_u_t_h_o_r(_s):

     Florian Hahne

_R_e_f_e_r_e_n_c_e_s:

     J.O. Ramsay and B.W. Silverman: Applied Functional Data Analysis,
     Springer 2002

_S_e_e _A_l_s_o:

     'curv1Filter', 'landmarkMatrix'

_E_x_a_m_p_l_e_s:

     data(ITN)
     dat <- transform(ITN, "CD4"=asinh(CD4), "CD3"=asinh(CD3), "CD8"=asinh(CD8))
     lg <- lymphGate(dat, channels=c("CD3", "SSC"),
     preselection="CD4",scale=1.5)
     dat <- Subset(dat, lg$n2gate)
     datr <- warpSet(dat, "CD8", grouping="GroupID", monwrd=TRUE)
     if(require(flowViz)){
     d1 <- densityplot(~CD8, dat, main="original", filter=curv1Filter("CD8"))
     d2 <- densityplot(~CD8, datr, main="normalized", filter=curv1Filter("CD8"))
     plot(d1, split=c(1,1,2,1))
     plot(d2, split=c(2,1,2,1), newpage=FALSE)
     }

