Skip to contents

Calculate immune and infiltration scores.

Usage

int_calc_score(
  this_data = NULL,
  variable = NULL,
  gene_id = "hgnc_symbol",
  adjust = TRUE,
  adj_factor = 5.1431,
  verbose = TRUE
)

Arguments

this_data

Required parameter. Data frame or matrix with expression values.

variable

Required parameter. Input should be one of the following; immune or score141up.

gene_id

Specify the type of gene identifier used in this_data. Accepted values are; hgnc_symbol (default) or ensembl_gene_id.

adjust

Boolean parameter. If TRUE, the function will proceed with adjusting the scores based on stable genes. If FALSE (default), no adjustment will be made and the original score values will be retained.

adj_factor

Only applicable if adjust is set to TRUE. Allows users to apply a proportional adjustment to the normalized scores, enabling finer control over the final output values. After dividing each score by the mean expression of stable genes, the result is multiplied by this factor. Default is 5.1431

verbose

A logical value indicating whether processing messages will be printed or not. Default is TRUE.

Value

A list with two objects. 1, A data frame with scores for the selected variable. 2, A data frame indicating what genes from the incoming data are missing, based on the expected genes for signature calculations.

Details

Internal function called by int_calc_signatures(). Not meant for out of package use. Takes a data frame of matrix with expression values and calculates scores based on gene expression.