update_SJAracne.network: Update Network List Object Using Constraints

View source: R/pipeline_functions.R

update_SJAracne.networkR Documentation

Update Network List Object Using Constraints

Description

update_SJAracne.network updates the network object created by get.SJAracne.network, using constraints like statistical thresholds and interested gene list.

Usage

update_SJAracne.network(
  network_list = NULL,
  all_possible_drivers = NULL,
  all_possible_targets = NULL,
  force_all_drivers = TRUE,
  force_all_targets = TRUE,
  min_MI = 0,
  max_p.value = 1,
  min_spearman_value = 0,
  min_pearson_value = 0,
  spearman_sign_use = c(1, -1),
  pearson_sign_use = c(1, -1),
  directed = TRUE,
  weighted = TRUE
)

Arguments

network_list

list, the network list object created by get.SJAracne.network. The list contains three elements, network_dat, target_list and igraph_obj. For details, please check get.SJAracne.network.

all_possible_drivers

a vector of characters, all possible drivers used to filter the network. If NULL, will use drivers from network_list. Default is NULL.

all_possible_targets

a vector of characters, all possible target genes used to filter the network. If NULL, will use targets from network_list. Default is NULL.

force_all_drivers

logical, if TRUE, will include all drivers from all_possible_drivers into the final network. For network_dat and target_list in the network list object, all genes in all_possible_drivers will not be filtered using the following statistical thresholds. For igraph_obj in the network list object, all genes in all_possible_drivers that don't exist in the original network, will be kept as vertices. Default is TRUE.

force_all_targets

logical, if TRUE, will include all genes from all_possible_targets into the final network. For network_dat and target_list in the network list object, all genes in all_possible_drivers will not be filtered using the following statistical thresholds. For igraph_obj in the network list object, all genes in all_possible_drivers that don't exist in the original network, will be kept as vertices. Default is TRUE.

min_MI

numeric, minimum threshold for "MI (mutual information)". Default is 0.

max_p.value

numeric, maximum threshold for P-value. Default is 1.

min_spearman_value

numeric, minimum threshold for spearman absolute value. Default is 0.

min_pearson_value

numeric, minimum threshold for pearson absolute value. Default is 0.

spearman_sign_use

a vector of numerics, users can choose from 1, -1 and c(1, -1). 1 means only positve spearman values will be used. -1 means only negative spearman values will be used. Default is c(1,-1).

pearson_sign_use

a vector of numerics, users can choose from 1, -1 and c(1, -1). 1 means only positve pearson values will be used. -1 means only negative pearson values will be used. Default is c(1,-1).

directed

logical, if TRUE, the network is a directed graph. Default is TRUE.

weighted

logical, if TRUE, the network is weighted. Default is TRUE.

Value

Return a list containing three elements, network_dat, target_list and igraph_obj.

Examples

if(exists('analysis.par')==TRUE) rm(analysis.par)
network.dir <- sprintf('%s/demo1/network/',system.file(package = "NetBID2")) # use demo
network.project.name <- 'project_2019-02-14' # demo project name
project_main_dir <- 'test/'
project_name <- 'test_driver'
analysis.par  <- NetBID.analysis.dir.create(project_main_dir=project_main_dir,
                                            project_name=project_name,
                                            network_dir=network.dir,
                                            network_project_name=network.project.name)
analysis.par$tf.network  <- get.SJAracne.network(network_file=analysis.par$tf.network.file)
analysis.par$sig.network <- get.SJAracne.network(network_file=analysis.par$sig.network.file)
all_possible_drivers <- c(names(analysis.par$tf.network$target_list)[1:1000],
                           'addition_driver_1','addition_driver_2')
tf.network.update <- update_SJAracne.network(network_list=analysis.par$tf.network,
                                             all_possible_drivers=all_possible_drivers,
                                             force_all_drivers=TRUE,
                                             force_all_targets=FALSE,
                                             pearson_sign_use=1)
print(base::intersect(c('addition_driver_1','addition_driver_2'),
      names(V(tf.network.update$igraph_obj)))) ## check
## Not run: 


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