regulation_test_1ctrl: Test gene expression variation for a given gene

View source: R/version1ctrl.R

regulation_test_1ctrlR Documentation

Test gene expression variation for a given gene

Description

This function makes the test of expression dysregulation of one gene for a patient compared to control. It's an adapted method for the datasets with only 1 control which use only the rank method. If you want the normal Penda method used penda::regulation_test

Usage

regulation_test_1ctrl(gene, L_H_list, sample, threshold)

Arguments

gene

The name of the gene to analyze.

L_H_list

The list of lower and higher expressed genes matrices in the control.

sample

The vector of genes expressions for one patient.

threshold

If Ll/Lh and Hh/Hl are under this threshold, the expression not change.

Value

This function returns 0 if the gene expression has not changed, 1 if the gene is up-regulated and -1 if the gene is down-regulated.

Examples

# First, load and define the data
dataset = penda::make_dataset_1ctrl(
  penda::penda_data_ctrl[1:10, 1],
  penda::penda_data_case[1:10, 1:3]
)
controls = dataset$data_ctrl
sample = dataset$data_case[,1]
gene = names(sample)[1]
# Second, lower and higher list are computed
L_H_list = penda::compute_lower_and_higher_lists_1ctrl(controls, s_max = 50)
# Third, test is the expression is deregulated for a given gene.

expression = penda::regulation_test_1ctrl(gene,
                                    L_H_list,
                                    sample,
                                    threshold = 0.03)

CDecamps/penda documentation built on March 29, 2024, 3:26 a.m.