rewiring_gene_level: Perform the rewiring at the gene level

View source: R/rewiring_gene_level.R

rewiring_gene_levelR Documentation

Perform the rewiring at the gene level

Description

Perform the rewiring test to check if regulators are enriched in rewiring modules using a hypergeometric test.

Usage

rewiring_gene_level(
  linker_output,
  TraReObj,
  fpath = "",
  final_signif_thresh = 0.05,
  include_cliques = FALSE,
  ImpTH = 0.05,
  cliquesTH = 0.8,
  nrcores = 3,
  outdir = tempdir()
)

Arguments

linker_output

Output from LINKER_run function (recommended with 50 bootstraps).

TraReObj

the TrareObj generated during preprocessing step before GRN inference.

fpath

Desired path for the rewiring file to be generated. If fpath not provided, it will create a rewiring module list file in the current directory with the name "rewiring_gene_level_fs_<final_signif_thresh>.txt". If file already exists it will skip the fast rewiring step.

final_signif_thresh

Significance threshold for the rewiring method. The lower the threshold, the restrictive the method. Default set to 0.05.

include_cliques

Boolean specifying to include cliques in the returned score matrix. Default set to FALSE.

ImpTH

Threshold for the refinement of the returned list. Default set to 0.05.

cliquesTH

Correlation threshold if include_cliques is set to TRUE. Default set to 0.8.

nrcores

Number of cores to run the parallelization within the rewiring test (default: 3).

outdir

Directory for the output folder to be located (default: tempdir()).

Value

Return a matrix containing, for each gene (or genes if include_cliques is set to TRUE) the pvalue and odds ratio from the hypergeometric test within three categories.

Examples

## We will be using an output file we generated with LINKER_run and the 
## same expression datainput  object.

## linker_output <- readRDS(paste0(system.file('extdata',package='TraRe'),
##                                     'linkeroutput_rewiring_example.rds'))

## TraReObj <- readRDS(paste0(system.file('extdata',package='TraRe'),
## 
## Add the phenotype to TraReObj if it was not before.
## TraReObj <- rewiring_add_phenotype(TraReObj, phenotype)

## Select directory for output file
## outdir <- system.file('extdata',package='TraRe')

## Run rewiring at the gene level.' 
## impgenes <-  rewiring_gene_level(linker_output = linkeroutput2,
##                                                   TraReObj = TraReObj,
##                                                   fpath = fpath,
##                                                   final_signif_thresh = 0.05,
##                                                   ImpTH = 0.05,
##                                                   include_cliques=TRUE,
##                                                   cliquesTH=0.8,
##                                                   nrcores = 1)

                                                   

ubioinformat/TraRe documentation built on March 10, 2024, 1:11 a.m.