Package 'BNrich'

Title: Pathway Enrichment Analysis Based on Bayesian Network
Description: Maleknia et al. (2020) <doi:10.1101/2020.01.13.905448>. A novel pathway enrichment analysis package based on Bayesian network to investigate the topology features of the pathways. firstly, 187 kyoto encyclopedia of genes and genomes (KEGG) human non-metabolic pathways which their cycles were eliminated by biological approach, enter in analysis as Bayesian network structures. The constructed Bayesian network were optimized by the Least Absolute Shrinkage Selector Operator (lasso) and the parameters were learned based on gene expression data. Finally, the impacted pathways were enriched by Fisher’s Exact Test on significant parameters.
Authors: Samaneh Maleknia [aut, cre], Mohsen Namazi [aut], Kaveh Kavousi [ctb], Ali Sharifi-Zarchi [ctb], Vahid Rezaei-Tabar [ctb]
Maintainer: Samaneh Maleknia <[email protected]>
License: GPL (>= 2)
Version: 0.1.1
Built: 2025-02-26 04:45:53 UTC
Source: https://github.com/samaneh-bioinformatics/bnrich

Help Index


Construct Bayesian networks structures

Description

Construct BNs structures using unified signaling pathways

Usage

BN_struct(mapkG1)

Arguments

mapkG1

A list contains unified signaling pathways

Value

A list contains Bayesian networks structures

Examples

#All the 187 preprocessed signaling pathways can be entered in analysis by fetch_data_file().
#But here you enter a subset of those pathways to see how this package works.
files <- system.file("extdata", "test_files_to_start.RData", package = "BNrich", mustWork = TRUE)
load(files)
Data <- system.file("extdata", "Test_DATA.RData", package = "BNrich", mustWork = TRUE)
load(Data)
uni_Result <- unify_path(dataH, dataD, MapkG = sub_mapkG, Pathway.id = path.id)
M1 <- uni_Result$mapkG1
BN <- BN_struct(M1)

Analysis of significant final BNs

Description

Fisher's exact test applied to PEA on final BNs

Usage

BNrich(Ttest_Results, Pathway.id1, PathName_Final, fdr.value = 0.05)

Arguments

Ttest_Results

A data frame contains T-test results for all parameters

Pathway.id1

A vector contains modified KEEG pathway IDs

PathName_Final

A data frame contains is IDs and names of KEEG pathways

fdr.value

A numeric threshold to determine significant parameters

Value

A data frame contains fisher test results for any final pathways

Examples

#All the 187 preprocessed signaling pathways can be entered in analysis by fetch_data_file().
#But here you enter a subset of those pathways to see how this package works.
files <- system.file("extdata", "test_files_to_start.RData", package = "BNrich", mustWork = TRUE)
load(files)
Data <- system.file("extdata", "Test_DATA.RData", package = "BNrich", mustWork = TRUE)
load(Data)
uni_Result <- unify_path(dataH, dataD, MapkG = sub_mapkG, Pathway.id = path.id)
M1 <- uni_Result$mapkG1
BN <- BN_struct(M1)
data_h1 <- uni_Result$data_h
data_d1 <- uni_Result$data_d
LASSO_Result <- LASSO_BN(BN = BN , data_h = data_h1 , data_d = data_d1)
BN_h1 <- LASSO_Result$BN_h
BN_d1 <- LASSO_Result$BN_d
esti_result <- esti_par(BN_H = BN_h1, BN_D = BN_d1, data_h = data_h1, data_d = data_d1)
BNs_H <- esti_result$BNs_h
BNs_D <- esti_result$BNs_d
coef_h <- esti_result$coef_h
coef_d <- esti_result$coef_d
var_result <- var_mat(data_h1, coef_h,  BNs_H, data_d1, coef_d, BNs_D)
Var_H = var_result$var_mat_Bh
Var_D = var_result$var_mat_Bd
path.id1 <- uni_Result$pathway.id1
Ttest_result <- parm_Ttest(data_h1, coef_h, BNs_H, data_d1, coef_d, BNs_D, Var_H, Var_D, path.id1)
BNrich_result <- BNrich(Ttest_result, path.id1, Path.Name)

Estimate parameters of BNs in control and disease states

Description

Estimate parameters of BNs in control and disease states

Usage

esti_par(BN_H, BN_D, data_h, data_d)

Arguments

BN_H

A list contains simplified BNs structures for control objects

BN_D

A list contains simplified BNs structures for disease objects

data_h

A list contains data frames related to control objects for any BN

data_d

A list contains data frames related to disease objects for any BN

Value

A listcontains four lists BNs_h, BNs_d, coef_h and coef_d

Examples

#All the 187 preprocessed signaling pathways can be entered in analysis by fetch_data_file().
#But here you enter a subset of those pathways to see how this package works.
files <- system.file("extdata", "test_files_to_start.RData", package = "BNrich", mustWork = TRUE)
load(files)
Data <- system.file("extdata", "Test_DATA.RData", package = "BNrich", mustWork = TRUE)
load(Data)
uni_Result <- unify_path(dataH, dataD, MapkG = sub_mapkG, Pathway.id = path.id)
M1 <- uni_Result$mapkG1
BN <- BN_struct(M1)
data_h1 <- uni_Result$data_h
data_d1 <- uni_Result$data_d
LASSO_Result <- LASSO_BN(BN = BN , data_h = data_h1 , data_d = data_d1)
BN_h1 <- LASSO_Result$BN_h
BN_d1 <- LASSO_Result$BN_d
esti_result <- esti_par(BN_H = BN_h1, BN_D = BN_d1, data_h = data_h1, data_d = data_d1)

Download data file

Description

Download necessary data file to start BNrich

Usage

fetch_data_file(destfile, verbose = FALSE)

Arguments

destfile

A directory in user's own computer for save preprocessed data file

verbose

A logical argument to show verbose results

Value

A list contain mapkG, PathName_final and pathway.id. The mapkG is a list contains imported 187 preprocessed signaling pathways, PathName_final is a data.frame includes names and IDs of all 187 pathways and pathway.id is a character vector of pathways IDs

Examples

destfile = tempfile("files", fileext = ".rda")
files <- fetch_data_file()
load(destfile)

LASSO regression

Description

LASSO regression – second step of simplification of BNs structures

Usage

LASSO_BN(BN, data_h, data_d)

Arguments

BN

A list of Bayesian networks achieved by BN_struct function

data_h

A list contains data frames related to control objects

data_d

A list contains data frames related to disease objects

Value

A list contains two lists.BN_h and BN_d are simplified BNs

Examples

#All the 187 preprocessed signaling pathways can be entered in analysis by fetch_data_file().
#But here you enter a subset of those pathways to see how this package works.
files <- system.file("extdata", "test_files_to_start.RData", package = "BNrich", mustWork = TRUE)
load(files)
Data <- system.file("extdata", "Test_DATA.RData", package = "BNrich", mustWork = TRUE)
load(Data)
uni_Result <- unify_path(dataH, dataD, MapkG = sub_mapkG, Pathway.id = path.id)
M1 <- uni_Result$mapkG1
BN <- BN_struct(M1)
data_h1 <- uni_Result$data_h
data_d1 <- uni_Result$data_d
LASSO_Result <- LASSO_BN(BN = BN , data_h = data_h1 , data_d = data_d1)

Testing the equality regression coefficients

Description

t-test for equality the corresponging parameters in any BN

Usage

parm_Ttest(
  Data_h,
  coef_H,
  BNs_H,
  Data_d,
  coef_D,
  BNs_D,
  Var_mat_Bh,
  Var_mat_Bd,
  Pathway.id1
)

Arguments

Data_h

A list contains data frames related to control objects for any BN

coef_H

A list contains parameters of BN_h

BNs_H

A list contains BNs learned by control objects data

Data_d

A list contains data frames related to disease objects for any BN

coef_D

A list contains parameters of BN_d

BNs_D

A list contains BNs learned by disease objects data

Var_mat_Bh

A list contains covariance matrixes for any node of BN_h

Var_mat_Bd

A list contains covariance matrixes for any node of BN_d

Pathway.id1

A vector contains modified KEEG pathway IDs

Value

A data frame contains T-test results for all parameters in final BNs

Examples

#All the 187 preprocessed signaling pathways can be entered in analysis by fetch_data_file().
#But here you enter a subset of those pathways to see how this package works.
files <- system.file("extdata", "test_files_to_start.RData", package = "BNrich", mustWork = TRUE)
load(files)
Data <- system.file("extdata", "Test_DATA.RData", package = "BNrich", mustWork = TRUE)
load(Data)
uni_Result <- unify_path(dataH, dataD, MapkG = sub_mapkG, Pathway.id = path.id)
M1 <- uni_Result$mapkG1
BN <- BN_struct(M1)
data_h1 <- uni_Result$data_h
data_d1 <- uni_Result$data_d
LASSO_Result <- LASSO_BN(BN = BN , data_h = data_h1 , data_d = data_d1)
BN_h1 <- LASSO_Result$BN_h
BN_d1 <- LASSO_Result$BN_d
esti_result <- esti_par(BN_H = BN_h1, BN_D = BN_d1, data_h = data_h1, data_d = data_d1)
BNs_H <- esti_result$BNs_h
BNs_D <- esti_result$BNs_d
coef_h <- esti_result$coef_h
coef_d <- esti_result$coef_d
var_result <- var_mat(data_h1, coef_h,  BNs_H, data_d1, coef_d, BNs_D)
Var_H = var_result$var_mat_Bh
Var_D = var_result$var_mat_Bd
path.id1 <- uni_Result$pathway.id1
Ttest_result <- parm_Ttest(data_h1, coef_h, BNs_H, data_d1, coef_d, BNs_D, Var_H, Var_D, path.id1)

Simplification networks – applied to unifying nodes

Description

Unifying nodes based imported signaling pathways and GE data

Usage

unify_path(dataH, dataD, MapkG, Pathway.id)

Arguments

dataH

A data frame contains (healthy) control objects data

dataD

A data frame contains disease objects data

MapkG

A list contains imported 187 signaling pathways

Pathway.id

A vector contains 187 KEEG pathway IDs

Value

A list contain data_h,data_d,mapkG1 and pathway.id1

Examples

#All the 187 preprocessed signaling pathways can be entered in analysis by fetch_data_file().
#But here you enter a subset of those pathways to see how this package works.
files <- system.file("extdata", "test_files_to_start.RData", package = "BNrich", mustWork = TRUE)
load(files)
Data <- system.file("extdata", "Test_DATA.RData", package = "BNrich", mustWork = TRUE)
load(Data)
uni_Result <- unify_path(dataH, dataD, MapkG = sub_mapkG, Pathway.id = path.id)

Estimate variance-covariance matrixes for any parameters of BNs

Description

Estimate variance-covariance matrixes for any parameters of

Usage

var_mat(Data_h, coef_H, BNs_H, Data_d, coef_D, BNs_D)

Arguments

Data_h

A list contains data frames related to control objects for any BN

coef_H

A lists of parameters of BN_h achieved

BNs_H

A list of BNs learned by control objects data

Data_d

A list contains data frames related to disease objects for any BN

coef_D

A lists of parameters of BN_d

BNs_D

A list of BNs learned by disease objects data

Value

A listcontains two lists var_mat_Bh and var_mat_Bd

Examples

#All the 187 preprocessed signaling pathways can be entered in analysis by fetch_data_file().
#But here you enter a subset of those pathways to see how this package works.
files <- system.file("extdata", "test_files_to_start.RData", package = "BNrich", mustWork = TRUE)
load(files)
Data <- system.file("extdata", "Test_DATA.RData", package = "BNrich", mustWork = TRUE)
load(Data)
uni_Result <- unify_path(dataH, dataD, MapkG = sub_mapkG, Pathway.id = path.id)
M1 <- uni_Result$mapkG1
BN <- BN_struct(M1)
data_h1 <- uni_Result$data_h
data_d1 <- uni_Result$data_d
LASSO_Result <- LASSO_BN(BN = BN , data_h = data_h1 , data_d = data_d1)
BN_h1 <- LASSO_Result$BN_h
BN_d1 <- LASSO_Result$BN_d
esti_result <- esti_par(BN_H = BN_h1, BN_D = BN_d1, data_h = data_h1, data_d = data_d1)
BNs_H <- esti_result$BNs_h
BNs_D <- esti_result$BNs_d
coef_h <- esti_result$coef_h
coef_d <- esti_result$coef_d
var_result <- var_mat(data_h1, coef_h,  BNs_H, data_d1, coef_d, BNs_D)