RtreemixData-class {Rtreemix} | R Documentation

## Class "RtreemixData"

### Description

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.

### Objects from the Class

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).

### Slots

`Sample`:

  Object of class `"matrix"`.

`Patients`:

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

`Events`:

  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).

`Description`:

  Object of class `"character"`.

### Methods

Description

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

Description<-

  `signature(object = "RtreemixData")`: A method for specifying the `Description` of the data object.

Events

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

Events<-

  `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`.

Patients

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

Patients<-

  `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.

Sample

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

eventsNum

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

sampleSize

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

### Author(s)

Jasmina Bogojeska

### See Also

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

### Examples

    ## 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)

[Package Rtreemix version 1.50.0 Index]