# NOT RUN {
# Model 1 (mediation)
Truth <- MRPCtruth$M1 # Truth for model 1
# The 1st column of the data matrix is a genetic variant
# and the remaining columns are gene expression nodes.
data <- simu_data_M1 # load data for model 1
n <- nrow (data) # Number of row
V <- colnames(data) # Column names
# Calculate Pearson correlation
suffStat_C <- list(C = cor(data),
n = n)
# Infer a graph skeleton
Skel.fit <- ModiSkeleton(data,
suffStat = suffStat_C,
FDR = 0.05,
indepTest = 'gaussCItest',
labels = V,
FDRcontrol = 'LOND',
verbose = FALSE)
# Edge Orientation
Edge_orientation <- EdgeOrientation(Skel.fit,
suffStat = suffStat_C,
GV = 1,
FDR = 0.05,
indepTest = 'gaussCItest',
FDRcontrol = 'LOND',
verbose = FALSE)
# 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