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)

