rBGR is an R package that implements a flexible Bayesian model to construct heterogeneous graphs under non-normal continuous data. For more details, please see Yao et al. (2023+) Robust Bayesian Graphical Regression Models for Assessing Tumor Heterogeneity in Proteomic Networks on arXiv.
The rBGR
accommodates the non-normality by the random scales and builds graphs through graphical regressions. The coefficients of graphical regression incorporate the subject-specific information and encode the graph edges by the zero coefficients. Due to the formulation of graphical regression, rBGR
obtains posterior samples of coefficients by Gibbs sampler and infers the random scales by the Metropolis-Hasting algorithm. We refer to more details in Yao et al. (2023+) Section 4.
In the package, we wrap the MCMC algorithm in a function of rBGR_mcmc_Int()
. Given proteomic expression data and the subject-specific information (immune component abundance in the Main Paper), rBGR
regresses one variable on the rest of the variables. Given the covariates, users need to execute the same function on all variables to construct the whole graph. Fortunately, this algorithm can be run parallelly to reduce the computation time.
The MCMC function rBGR_mcmc_Int()
takes several arguments with different options for users to control the algorithm. To run the MCMC, users are required to specify the data by the following three arguments: (i) regressand by the argument rBGR_mcmc_Int()
also allows additional options to control the model, such as burnin
for the number of iterations to be discarded, and seed_
for the initial seeds.
The function rBGR_mcmc_Int()
produces the posterior samples of (i) two components of coefficients
Once we obtain posterior samples of coefficients and edges, users can symmetrize and summarize the results to obtain undirected graphs in two different levels: population (
For the population-level graph, users can run pstSmpExt_pop.R
to extract the population-level information and visualize the results through the PlotRes_popLevel.R
. Similarly, in the individual-level graph, we first obtain the symmetrized edges by executing pstSmpExt_ind.R
and then visualize the results by PlotRes_indQuantile.R
. Currently, we use the 5, 25, 50, 75, and 95-th percentiles of the covariates as five different individuals, as shown in Yao et al. (2023+).