cal.Activity: Calculate Activity Value for Each Driver

View source: R/pipeline_functions.R

cal.ActivityR Documentation

Calculate Activity Value for Each Driver

Description

cal.Activity calculates the activity value for each driver. This function requires two inputs, the driver-to-target list object target_list and the expression matrix.

Usage

cal.Activity(
  target_list = NULL,
  igraph_obj = NULL,
  cal_mat = NULL,
  es.method = "weightedmean",
  std = TRUE,
  memory_constrain = FALSE
)

Arguments

target_list

list, the driver-to-target list object. Either igraph_obj or target_list is necessary for this function. The names of the list elements are drivers. Each element is a data frame, usually contains at least three columns. "target", target gene names; "MI", mutual information; "spearman", spearman correlation coefficient. "MI" and "spearman" is necessary if es.method="weightedmean". Users can call get.SJAracne.network to get this list from the network file generated by SJAracne (the second element of the return list) or prepare the list object by hand but should match the data format described above.

igraph_obj

igraph object, optional. Either igraph_obj or target_list is necessary for this function. Users can call get.SJAracne.network to get this object from the network file generated by SJAracne (the third element of the return list), or prepare the igraph network object by hand (Directed network and the edge attributes should include "weight" and "sign" if es.method="weightedmean").

cal_mat

numeric matrix, the expression matrix of genes/transcripts.

es.method

character, method applied to calculate the activity value. User can choose from "mean", "weightedmean", "maxmean" and "absmean". Default is "weightedmean".

std

logical, if TRUE, the expression matrix will be normalized by column. Default is TRUE.

memory_constrain

logical, if TRUE, the calculation strategy will not use Matrix Cross Products, which is memory consuming. Default is FALSE.

Value

Return a matrix of activity values. Rows are drivers, columns are samples.

Examples

analysis.par <- list()
analysis.par$out.dir.DATA <- system.file('demo1','driver/DATA/',package = "NetBID2")
NetBID.loadRData(analysis.par=analysis.par,step='ms-tab')
ac_mat <- cal.Activity(target_list=analysis.par$merge.network$target_list,
                       cal_mat=Biobase::exprs(analysis.par$cal.eset),
                       es.method='weightedmean')
ac_mat <- cal.Activity(igraph_obj=analysis.par$merge.network$igraph_obj,
                       cal_mat=Biobase::exprs(analysis.par$cal.eset),
                       es.method='maxmean')

jyyulab/NetBID documentation built on Dec. 23, 2024, 6:34 a.m.