calculate_gene_signatures: Calculate gene signatures on my_dt using a gmt file.

View source: R/stackable_functions.R

calculate_gene_signaturesR Documentation

Calculate gene signatures on my_dt using a gmt file.

Description

Calculates gene signatures on my_dt using a gmt file. The method of calculating the gene signture can be changed using my_fun

Usage

calculate_gene_signatures(
  my_dt = NULL,
  gene_cols = NULL,
  gene_element = 1,
  gmt_file_path,
  min_genes = 1,
  my_fun = mean,
  my_summary =
    "Gene signatures by default are the mean of the genes listed in the signature for each sample.",
  only_return_signatures = TRUE,
  summary_output_path = NULL,
  sample_key = get_default_sample_key(),
  signatures = NULL,
  readme_path = NULL,
  na_remove = TRUE
)

Arguments

my_dt

data.table input

gene_cols

Character vector indicating the columns that should be used in the gene signature. Uses operatable_columns. If NULL if will take all numeric columns.

gene_element

For gene names that have a pipe in them, which position should be used ("1|2 etc"). Integer.

gmt_file_path

String path to the gmt file.

min_genes

Integer for the minimum number of genes that have to be found from a gene signature to keep it.

my_fun

Function used to combine the genes for each sample. Default is mean

my_summary

Character string to change the default comment that will be appended to my_dt.

only_return_signatures

Boolean indicating whether or not all of the non-gene columns should be included in the result. Gene columns will be dropped. This is helpful in returning categories with the gene signature scores

summary_output_path

If specified this is where the summary data for making this gene signature will go.

sample_key

Character string to specify the column that is the sample key. This column will not be operated upon.

signatures

Specifies which gene signtures on the gmt file will be used. If NULL all of the signatures wil be used.

readme_path

Optional path to which the comments will be appended.

col_names

Vector of character strings to name the columns that will have this operation performed on them. Uses operatable_columns

Details

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ calculate_gene_signatures ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Todos

  • Should convert a data.frame to a data.table and then convert it back for the output.

See Also

Other gene_signature: bgv_lab_prep_count_data_for_gene_signature()


Benjamin-Vincent-Lab/binfotron documentation built on Oct. 1, 2024, 8:33 p.m.