RtreemixData-class         package:Rtreemix         R Documentation

_C_l_a_s_s "_R_t_r_e_e_m_i_x_D_a_t_a"

_D_e_s_c_r_i_p_t_i_o_n:

     This class is used to represent the results of genetic
     measurements of the occurence of subsets of a given set of genetic
     events in a group of patients. Each observation is a binary vector
     that indicates which events occured in a specific patient. The
     length of the vector equals the size of the set of genetic events
     that is taken into consideration.

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

     Objects can be created by calls of the form 'new("RtreemixData",
     Sample, Patients, Events, Description, File)'. The 'RtreemixData'
     class represents patterns of occurences of subsets of a given set
     of genetic events in a specific group of patients. The patterns
     are given as binary vectors with length equal to the size of the
     set of genetic events. In other words, it provides a
     representation of the dataset used for learning an mutagenetic
     trees mixture model.  

     The 'Sample' is a binary 'matrix' where each row corresponds to
     the pattern of genetic events observed in one of the given
     patients. Hence, the number of rows gives the number of patients,
     i.e. the size of the dataset. Each column corresponds to one of
     the genetic events.   Missing measurement for the presence or
     absence of a certain genetic event in a given pattern is marked
     with -1. The initial null event (that initially occurs in all
     patients) is not present in the sample, i.e. the first component
     in each observation (which is always equal to 1) is left out. This
     is done for saving space and avoiding the process of checking for
     correctly specified samples. 

     The 'Patients' is a character 'vector' that contains the IDs of
     the patients. The length of this vector must be equal to the
     number of rows in the 'Sample'.

     The 'Events' is a character 'vector' that contains the labels of
     the genetic events taken into consideration. Its length equals one
     plus the number of columns in the 'Sample'. This is because of the
     label of the null event. When the object of class 'RtreemixData'
     is a parent of a randomly generated 'RtreemixModel' object, the
     events specify the labels of the genetic events present in the
     random model, although the 'Sample' slot is an empty 'matrix'.
     This is because the random mixture models are not estimated from a
     given dataset, but generated randomly for some set of genetic
     events.

     The 'Description' is a character giving a short description for
     the created object.

     The 'File' specifies the path to a text file with a specific
     format which contains the infromation needed to create an
     'RtreemixData' object (the patient IDs, the names of the events,
     the matrix with the observations).

_S_l_o_t_s:


     '_S_a_m_p_l_e': Object of class '"matrix"'.

     '_P_a_t_i_e_n_t_s': Object of class '"character"'. The 'Patients' must be
          of same length as the number of rows in 'Sample'.

     '_E_v_e_n_t_s': Object of class '"character"'. The length of 'Events'
          must be identical to the number of columns in 'Sample' plus
          one (for specifying the label of the null event).  

     '_D_e_s_c_r_i_p_t_i_o_n': Object of class '"character"'.

_M_e_t_h_o_d_s:


     _D_e_s_c_r_i_p_t_i_o_n 'signature(object = "RtreemixData")': A method for
          obtaining the description of the '"RtreemixData"' object.

     _D_e_s_c_r_i_p_t_i_o_n<- 'signature(object = "RtreemixData")': A method for
          specifying the 'Description' of the data object. 

     _E_v_e_n_t_s 'signature(object = "RtreemixData")': A method for
          obtaining the labels of the genetic events. 

     _E_v_e_n_t_s<- 'signature(object = "RtreemixData")': A method for
          replacing the names of the genetic events in the data object.
          It checks to be sure the values have the right length. As a
          parent data of a random 'RtreemixModel' object the suitable
          labels of events present in the model components can be
          specified although the 'Sample' slot is an empty 'matrix'.

     _P_a_t_i_e_n_t_s 'signature(object = "RtreemixData")': A method for
          obtaining the IDs of the patients. 

     _P_a_t_i_e_n_t_s<- 'signature(object = "RtreemixData")': A method for
          replacing the IDs of the patients in the data object. It
          checks to be sure the values have the right length. 

     _S_a_m_p_l_e 'signature(object = "RtreemixData")': A method for
          obtaining the matrix of observations. 

     _e_v_e_n_t_s_N_u_m 'signature(object = "RtreemixData")': A method for
          obtaining the number of genetic events. 

     _s_a_m_p_l_e_S_i_z_e 'signature(object = "RtreemixData")': A method for
          obtaining the size of the sample (the number of patients). 

_A_u_t_h_o_r(_s):

     Jasmina Bogojeska

_S_e_e _A_l_s_o:

     'RtreemixGPS-class', 'RtreemixStats-class', 'RtreemixModel-class',
     'fit-methods', 'bootstrap-methods'

_E_x_a_m_p_l_e_s:

     ## Create an RtreemixData object from a file given in the examples directory of the package.
     data1 <- new("RtreemixData", File = paste(system.file(package = "Rtreemix"), "/examples/treemix.pat", sep = ""))
     show(data1) ## show the RtreemixData object

     ## Create an RtreemixData object from a randomly generated RtreemixModel object.
     rand.mod <- generate(K = 3, no.events = 9, noise.tree = TRUE, prob = c(0.2, 0.8))
     data2 <- sim(model = rand.mod, no.draws = 300)
     show(data2)

     ## Create an RtreemixData object from a given binary matrix.
     bin.mat <- cbind(c(1, 0, 0, 1, 1), c(0, 1, 0, 0, 1), c(1, 1, 0, 1, 0))
     data3 <- new("RtreemixData", Sample = bin.mat, Events = c("0", "1", "2",
     "3"))
     show(data3)

