computeRefTissue: Compute correlating reference control samples.

View source: R/computeRefTissue.R

computeRefTissueR Documentation

Compute correlating reference control samples.

Description

Compute reference control samples from OCTAD database using precomputed EncoderDF models.

Usage

 computeRefTissue(case_id = NULL, adjacent = FALSE, source = "octad",
 n_varGenes = 500, method = c("varGenes",'random'), expSet = NULL,
control_size = length(case_id),
outputFolder = NULL, cor_cutoff = "0", output = TRUE)


Arguments

case_id

vector of cases used to compute references.

source

by default set octad to use autoencoder results for computation. Any other input like 'side' is expSet defined by users.

adjacent

by default set to FALSE. If TRUE, only tissue with sample.type 'adjacent' from phenoDF would be used instead of 'normal'.

expSet

input for expression matrix. By default NULL, since autoencoder results are used.

n_varGenes

number of genes used to select control cases.

method

one of two options is avaliable. random will take a random number of samples from control subset and varGenes (default) will select control samples based on distance between cases and selected samples.

control_size

number of control samples to be selected.

outputFolder

path to output folder. By default, the function produces result files in working directory.

cor_cutoff

cut-off for correlation values, by default cor_cutoff='0'.

output

if TRUE, two output files are produced.

Value

Return

control_id

a vector of an appropriate set of control samples.

Besides, if output=TRUE, two files are created in the working directory:

case_normal_corMatrix.csv

contains pairwise correlation between case samples vs control samples.

case_normal_median_cor.csv

contains median correlation values with case samples for returned control samples.

See Also

diffExp.

Examples

#select data
#load data.frame with samples included in the OCTAD database
phenoDF=get_ExperimentHub_data('EH7274') 
HCC_primary=subset(phenoDF,cancer=='Liver Hepatocellular Carcinoma'&
sample.type == 'primary'&data.source == 'TCGA')
#select cases
case_id=HCC_primary$sample.id
#computing reference tissue, by default using small autoEncoder,
#but can use custom expression set,
#by default output=TRUE and outputFolder option is empty,
#which creates control corMatrix.csv to working directory
control_id=computeRefTissue(case_id,outputFolder='',output=TRUE,
expSet = "octad",control_size = 50)

Bin-Chen-Lab/octad documentation built on Jan. 28, 2023, 11:20 p.m.