# NOT RUN {
# Load packages
library(pcalg) #library for existing pc
# Load predefined data
# Data pre-processing
# The 1st column of the input matrix will be the
# genetic variant and the remaining columns are the gene expression data.
# Model 1
Truth <- MRPCtruth$M1 #Truth for model 1
data <- simu.data_M1 #data load for model 1
n <- nrow (data) #Number of row
V <- colnames(data) #Column names
Rcor_R <- RobustCor(data,
0.005) #Robust correlation (Beta = 0.005)
suffStat_R <- list(C = Rcor_R$RR,
n = n)
# Estimate skeleton
Skel.fit <- ModiSkeleton(data, suffStat_R, FDR = 0.05,
indepTest = 'gaussCItest',
labels = V, verbose = TRUE)
# Edge Orientation
Edge_orientation <- EdgeOrientation(Skel.fit, GV = 1,
suffStat_R, FDR = 0.05,
indepTest = 'gaussCItest', verbose = 1)
# Plot the results
par(mfrow = c(1, 2))
plot(Truth,
main = "(A) Truth")
plot(Edge_orientation,
main = "(B) MRPC ")
# Other models are available and may be called as follows:
# Model 0
# Truth <- MRPCtruth$M0
# data <- simu.data_M0
# Model 2
# Truth <- MRPCtruth$M2
# data <- simu.data_M2
# Model 3
# Truth <- MRPCtruth$M3
# data <- simu.data_M3
# Model 4
# Truth <- MRPCtruth$M4
# data <- simu.data_M4
# Model Multiparent
# Truth <- MRPCtruth$Multiparent
# data <- simu.data_multiparent
# Model Star
# Truth <- MRPCtruth$Star
# data <- simu.data_starshaped
# Model Layered
# Truth <- MRPCtruth$Layered
# data <- simu.data_layered
# }
Run the code above in your browser using DataLab