ic_score: ic_score

View source: R/ic_score.R

ic_scoreR Documentation

ic_score

Description

Calculates and plots immunophenogram (IPG) and immunophenoscores (IPS) for each sample and each group of study.

Usage

ic_score(
  tpm,
  metadata,
  response,
  compare = NULL,
  p_label = "p.format",
  colors = c("orange", "black")
)

Arguments

tpm

Output from the ic_raw_to_tpm function. This is a matrix containing expression counts as TPM with HGNC gene symbols as rownames and samples identifiers as colnames.

metadata

Data frame that contains supporting variables to the data.

response

Unquoted name of the variable indicating the groups to analyse.

compare

A character string indicating which method to be used for comparing means. Options are 't.test' and 'wilcox.test' for two groups or 'anova' and 'kruskal.test' for more groups. Default value is NULL.

p_label

Character string specifying label type. Allowed values include 'p.signif' (shows the significance levels), 'p.format' (shows the formatted p-value).

colors

Character vector indicating the colors of the different groups to compare. Default values are two: black and orange.

Value

Returns ggplot objects and a data frame.

Examples

tpm <- ic_raw_to_tpm(counts = sample_counts,
                     genes_id = 'entrezgene_id',
                     biomart = ensembl_biomart_GRCh38_p13)
ips <- ic_score(tpm = tpm,
                metadata = sample_metadata,
                response = MSI_status,
                compare = 'wilcox.test',
                p_label = 'p.format',
                colors = c('orange', 'black'))


oriolarques/GEGVIC documentation built on Oct. 30, 2024, 10:44 p.m.