markers_distribution {combiroc}R Documentation

Show distribution of intensity values for all the markers both singularly and all together.

Description

A function that takes as input data in long format, and shows how the signal intensity value of markers are distributed.

Usage

markers_distribution(
  data_long,
  min_SE = 0,
  min_SP = 0,
  x_lim = NULL,
  y_lim = NULL,
  boxplot_lim = NULL,
  signalthr_prediction = FALSE,
  case_class
)

Arguments

data_long

a data.frame in long format returned by combiroc_long()

min_SE

a numeric that specifies the min value of SE that a threshold must have to be included in $Coord.

min_SP

a numeric that specifies the min value of SP that a threshold must have to be included in $Coord.

x_lim

a numeric setting the max values of x that will be visualized in the density plot (zoom only, no data loss).

y_lim

a numeric setting the max values of y that will be visualized in the density plot (zoom only, no data loss).

boxplot_lim

a numeric setting the max values of y that will be visualized in the boxplot (zoom only, no data loss).

signalthr_prediction

a boolean that specifies if the density plot will also show the "suggested signal threshold".

case_class

a character that specifies which of the two classes of the dataset is the case class.

Details

This function returns a named list containing the following objects:

In case of lack of a priori known threshold the user can set set signalthr_prediction= TRUE. In this way the function provides a "suggested signal threshold" that corresponds to the median of the singnal threshold values (in "Coord") at which SE/SP are grater or equal to their set minimal values (min_SE and min_SP), and it adds this threshold on the "Density_plot" object as a dashed black line. The use of the median allows to pick a threshold whose SE/SP are not too close to the limits (min_SE and min_SP), but it is recommended to always inspect "Coord" and choose the most appropriate signal threshold by considering SP, SE and Youden index.

Value

a named list containing 'Coord' and 'Density_summary' data.frames, and 'ROC', 'Boxplot' and 'Density_plot' plot objects.

Examples

## Not run: 
demo_data # combiroc built-in demo data (proteomics data from Zingaretti et al. 2012 - PMC3518104)

demo_data_long <- combiroc_long(data = demo_data) # long format data




# To visualize the distribution of the expression of each marker.

distributions <- markers_distribution(data_long = demo_data_long,
                                       boxplot_lim = 1500, y_lim = 0.001,
                                       x_lim = 3000 , signalthr_prediction = FALSE,
                                       case_class = 'A', min_SE = 40, min_SP = 80)

distributions$Density_plot # density plot
distributions$Density_summary # summary statistics of density plot
distributions$ROC # ROC showing signal threshold range ensuring min SE and/or SP
distributions$Coord # ROC values
distributions$Boxplot # Boxplot

## End(Not run)

[Package combiroc version 0.3.4 Index]