KS                  package:dualKS                  R Documentation

_C_a_l_c_u_l_a_t_e _K_o_l_m_o_g_o_r_o_v _S_m_i_r_n_o_v _r_a_n_k _s_u_m _s_c_o_r_e_s.

_D_e_s_c_r_i_p_t_i_o_n:

     This function calculates the degree to which a subset of genes
     (i.e.  a "signature") is biased in the ordered list of all genes. 
     The  function is typically used internally by 'dksClassify',  but
     the user may want to call it directly to inspect the running 
     sums.

_U_s_a_g_e:

     KS(data, geneset, decreasing=TRUE, method="kort")

_A_r_g_u_m_e_n_t_s:

    data: A vector of gene expression data.  The data need not  be
          sorted, as the function will sort it itself.

 geneset: A 'DKSGeneSet' object, such as one of  the slots of the
          'DKSClassifier' returned by  'link{dksClassify}'.

decreasing: Indicates which way 'data' should be sorted.  If TRUE, the
          degree of upregulation will be scored.  If FALSE,  the degree
          of down regulation will be scored.

  method: Two methods are supported.  The 'kort' method returns  the
          maximum of the running sum.  The 'yang' method  returns the
          sum of the maximum and the minimum of the  running sum,
          thereby penalizing classes that are highly enriched in a
          subset of genes of a given signature, but highly  down
          regulated in another subset of that same signature.

_V_a_l_u_e:

runningSums : A matrix with 1 row per gene and 1 column per  signature.
          The value is the running sum of the KS metric  at each point
          along the sorted list of genes.  The maximum  of this column
          vector corresponds to the KS score for the  corresponding
          signature.

ksScores: A named vector giving the KS score for each signature.

_A_u_t_h_o_r(_s):

     Eric J. Kort, Yarong Yang

_S_e_e _A_l_s_o:

     'dksTrain', 'dksSelectGenes', 'dksClassify', 'DKSGeneScores',
     'DKSPredicted',  'DKSClassifier'

_E_x_a_m_p_l_e_s:

             data("dks")
             tr <- dksTrain(eset, 1, "both")
             cl <- dksSelectGenes(tr, 100)
             sc <- KS(exprs(eset)[,1], cl@genes.up)
             plot(sc$runningSums[,1], type='l')

