Learn R Programming

ODT (version 1.0.0)

trainTree: trainTree Function

Description

This function trains a decision tree model based on patient data, which can either be gene expression levels or a binary matrix indicating mutations.

Usage

trainTree(PatientData, PatientSensitivity, minbucket = 20)

Value

An object of class 'party' representing the trained decision tree, with the assigned treatments for each node.

Arguments

PatientData

A matrix representing patient features, where rows correspond to patients/samples and columns correspond to genes/features. This matrix can contain:

  • Binary mutation data (e.g., presence/absence of mutations).

  • Continuous data from gene expression profiles (e.g., expression levels).

PatientSensitivity

A matrix representing drug response values, where rows correspond to patients in the same order as in `PatientData`, and columns correspond to drugs. Higher values indicate greater drug resistance and, consequently, lower sensitivity to treatment. This matrix can represent various measures of drug response, such as IC50 values or area under the drug response curve (AUC). Depending on the interpretation of these values, users may need to adjust the sign of this data.

minbucket

An integer specifying the minimum number of patients required in a node to allow for a split.

Examples

Run this code

# \donttest{
  # Basic example of using the trainTree function with mutational data
  data("drug_response_w12")
  data("mutations_w12")
  ODTmut <- trainTree(PatientData = mutations_w12, 
                      PatientSensitivity = drug_response_w12,
                      minbucket = 10)
  plot(ODTmut)

  # Example using gene expression data instead
  data("drug_response_w34")
  data("expression_w34")
  ODTExp <- trainTree(PatientData = expression_w34,
                      PatientSensitivity = drug_response_w34,
                      minbucket = 20)
  plot(ODTExp)
# }

Run the code above in your browser using DataLab