PercentPos.FCS           package:rflowcyt           R Documentation

_C_a_l_c_u_l_a_t_e _t_h_e _P_e_r_c_e_n_t _P_o_s_i_t_i_v_e _g_i_v_e_n _a _p_e_r_c_e_n_t_i_l_e

_D_e_s_c_r_i_p_t_i_o_n:

     From a sample of observations, the percentile for a given percent
     is computed as the value in which there is a given percent of
     observations that are lower than it.  Using 'percentile.FCS' will
     obtain the percentile of interest in a given vector of values.

     Given a sample of observed values, the percent positive over a
     certain percentile value will be calculated and output by using
     'PercentPos.FCS'.

_U_s_a_g_e:

     percentile.FCS(x.vector, percent = 0.999)

     PercentPos.FCS(st.data, percentile)

_A_r_g_u_m_e_n_t_s:

x.vector: numerical vector of observations usually from the control
          data

 percent: numeric; the percent at which to obtain the percentile

 st.data: numerical vector of observations; usually of the cytokine
          response of the stimulated sample

percentile: numerical value of the threshold; usually the 99.9th
          percentile of the corresponding unstimulated/control sample

_D_e_t_a_i_l_s:

     Specifically 'percentile.FCS' is used to obtain the percentiles
     for 'PercentPos.FCS' and 'ROC.FCS' in the analysis of the upper
     tail distributions of the stimulated and controls samples of
     cytokine responses, especially of the Interferon Gamma variable,
     among HIV positive and HIV negative individuals.  This function
     and analysis can be applied to different scenerios as well.

     Usually the Interferon Gamma variable from the FCS object (after
     gating and subsequent subsets (See 'createGate' and
     'extractGatedData')), is of interest. The percentile is obtained
     from the unstimulated or control sample and 100* Percent positives
     among the cells/observations of the stimulated sample is obtained
     based on the 99.9th percentile of the control sample. There are
     differences in the tails of these distributions (stimulated versus
     control) between HIV positive and HIV negative samples that might
     better distinguish HIV positive and HIV negative samples. This
     method was proposed by Zoe Moodie.

_V_a_l_u_e:

     For 'percentile.FCS':

     the percentile is returned; the percentile is defined as the
     numeric value of the observation at the which there is a given
     percent of observations below this value; the value's label or
     name is the position of the value in the input vector
     'controldata'

     For 'PercentPos.FCS':  

percent.pos: the fraction of the observations above or equal to the
          threshold/percentile

total.num: total number of observations in the sample

_N_o_t_e:

     Please note that Percentage Positive = 100 * (percent positive).

_A_u_t_h_o_r(_s):

     A.J. Rossini and J.Y. Wan

_R_e_f_e_r_e_n_c_e_s:

     Zoe Moodie and Mario Roederer

_S_e_e _A_l_s_o:

     data 'PerPosROC' in 'rfcdorig' package, 'ROC.FCS'

_E_x_a_m_p_l_e_s:

     if (require(rfcdmin)){

     data.there<-is.element(c("st.1829", "unst.1829", "unst.DRT", "st.DRT"),objects())
     if ( ( sum(data.there) != length(data.there) )){
     ## obtaining the FCS objects from VRC data
     data(VRCmin)
     }
     #hiv negative one individual, 1829
     #stimulated sample
     INFg.st.neg<-st.1829@data[,4]
     #control sample
     INFg.unst.neg<-unst.1829@data[,4]

     #hiv positive one individual, DRT
     #stimulated sample
     INFg.st.pos<-st.DRT@data[,4]
     #control sample
     INFg.unst.pos<-unst.DRT@data[,4]

     c.neg<-percentile.FCS(INFg.unst.neg)
     c.pos<-percentile.FCS(INFg.unst.pos)

     #percent positive for two individuals
     p.neg<-PercentPos.FCS(INFg.st.neg, c.neg)
     p.pos<-PercentPos.FCS(INFg.st.pos, c.pos)

     ### percentage positive
     ptg.neg<-100*p.neg$percent.pos
     ptg.pos<-100*p.pos$percent.pos
     }

