# # # R代码从装饰图案的ASGSCA来源。Rnw“# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #代码块1号:ASGSCA。Rnw: 200 - 227 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #库(ASGSCA)数据(“QCAHS”) #所有观察到的变量的名字:snp那么特征colnames (QCAHS) #提取感兴趣的变量QCAHS1 = data.frame (QCAHS TaqIB美元,QCAHS HindIII美元,QCAHS G1302A美元,QCAHS G1564A美元,QCAHS G308A美元,QCAHS G238A美元,美元QCAHS高密度脂蛋白,QCAHS LDL美元,美元QCAHS飞机观测,QCAHS TG美元,美元QCAHS葡萄糖,QCAHS胰岛素美元)#这个示例中使用的观测变量的名字ObservedVar = c (“TaqIB”、“HindIII”、“G1302A”、“G1564A”、“G308A”、“G238A”、“高密度”、“低密度脂蛋白”、“飞机观测”、“TG”、“葡萄糖”,“胰岛素”)colnames (QCAHS1) = ObservedVar #定义向量的潜变量的名字LatentVar = c (“CETP”、“LPL”,“包括”、“TNFa”,脂质代谢,能量代谢)#矩阵W0建设和B0描述模型如图2所示。W0 =矩阵(代表(0,12 * 6),nrow = 12, ncol = 6, dimnames =列表(ObservedVar LatentVar)) W0 [1] = W0 (2, 2) = W0 [3:4 3] = W0 [5:6, 4] = W0 [7:10 5] = W0 [8:12 6] = 1 B0 =矩阵(代表(0,6 * 6)nrow = 6, ncol = 6, dimnames =列表(LatentVar LatentVar)) B0 [1:3, 5] = B0 [3:4, 6] = 1 W0 B0 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #代码块2号:ASGSCA。Rnw: 235 - 236 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # GSCA (QCAHS1, W0 B0, latent.names = LatentVar estim = TRUE, path.test = FALSE,路径= NULL, nperm = 1000) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #代码块3号:ASGSCA。Rnw: 256 - 258 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # set.seed (2) GSCA (QCAHS1, W0 B0, latent.names = LatentVar estim = TRUE, path.test = TRUE,路径= NULL, nperm = 1000) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #代码块数量4:ASGSCA。Rnw: 269 - 271 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # set.seed (2) GSCA (QCAHS1, W0 B0, latent.names = LatentVar estim = FALSE, path.test = TRUE,路径= NULL, nperm = 1000) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #代码块5号:ASGSCA。Rnw: 280 - 286 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # set.seed (2) path0 =矩阵(c (2、3、5、6), ncol = 2) path0 GSCA (QCAHS1, W0 B0, latent.names = LatentVar estim = FALSE,路径。测试= TRUE,路径= path0 nperm = 1000) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #代码块6号:ASGSCA。Rnw: 297 - 309 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ObservedVar = colnames (QCAHS) ObservedVar #定义向量的潜变量的名字LatentVar = c (“CETP”、“APOC3”、“ABCA1”、“FABP-2”、“APOA1”、“APOE”、“HL”,“LPL”、“MTP”、“PON1”、“PON2”、“PCSK9”、“包括”、“ADIPO”,“PPARg2”、“TNFa”,“以挪士”,“a23AR”、“b1AR”、“b2AR”、“b3AR”、“王牌”,“AGT”、“AGTR1”、“LEPR”、“脂质代谢”、“能量代谢”、“英国石油公司控制”)#矩阵W0和B0描述模型如图2所示。数据(W0);数据(B0)暗(W0)暗(B0) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #代码块7号:ASGSCA。Rnw: 326 - 336 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # set.seed (4) # ResQCAHS = GSCA (QCAHS, W0 B0, latent.names = LatentVar estim = TRUE, path.test = TRUE,路径= NULL, nperm = 1000)数据(“ResQCAHS”)指数<——(ResQCAHS pvalues美元< 0.05,arr.ind = TRUE) ind.row =指标[1];ind.col =指数[2]重要< -矩阵(代表(0,nrow(指数)* 3),ncol = 3); colnames(重要)= c(“基因”,“通路”,“pval”)重要[1]< - rownames (ResQCAHS pvalues美元)(印第安纳州。行)显著[2]< - colnames (ResQCAHS pvalues美元)(印第安纳州。col] Significant[,3]<-ResQCAHS$pvalues[indices] Significant