stat_summery: Create statistics summary of nodes

View source: R/mapper_vis.R

stat_summeryR Documentation

Create statistics summary of nodes

Description

stat_summery returns statistics summaries of nodes as well as a vector of Javascript codes describing the summaries.

Usage

stat_summery(
  obj_mapper,
  groups_ind,
  dat = NULL,
  folder = "",
  add_surv_analysis = FALSE,
  add_analysis_js = NULL,
  color_code
)

Arguments

obj_mapper

An object of class TDAmapper.

groups_ind

A vector of group names each of the samples belongs to.

dat

Optional. A dataframe contains additional information of samples. If add_surv_analysis==TRUE, dat must be provided with columns age_at_diagnosis and days_to_death describing the time at diagnosis and time to death at the time of observation.

folder

The name of the folder to save the generated networks.

add_surv_analysis

A logical object. TRUE if median time at diagnosis and median time to death should be included.

add_analysis_js

A vector of Javascript codes summerizing customized statistics.

color_code

A color code dataframe.

Details

This function summarizes the nodes returned by mapper. Basic statistics included in this function are the number of samples N, the percentage of samples from different groups groups_per_node, the groups dominate the nodes dominant_group, the percentage of samples from the dominated group dominant_percent. It also generates pie plots for nodes which are saved in /figures.

If additional information is provided, the function can provide further statistics including median time at diagnosis and median time to death.

The users can also define and add customized statistics to this function. The customized statistics should be wraped into a vector of Javascript codes for each of the nodes and passed to add_analysis_js following the same order of nodes as in obj_mapper.

Value

A list includes the statistics and pie plots in folder /figures. Details of elements in the list can be found in Detail.

Examples

# See ?network_visualization


TianshuFeng/SemiMapper documentation built on Sept. 16, 2022, 10:26 p.m.