# # # R代码从装饰图案来源的小插曲COPDSexualDimorphism /本月/ doc / lgrc_sdcd_eQTL。Rnw“# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #代码块1号:lgrc_sdcd_eQTL。Rnw:到三十五# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #库(COPDSexualDimorphism)% + %的< -函数(x, y)粘贴(x, y, 9 = " ") # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #代码块2号:lgrc_sdcd_eQTL。Rnw: 58 - 68 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # (lgrc.eqtl)暗(eqtl)打印数据(“有”% + %长度(独特(eqtl SNP)美元)% + %“独联体SDCD基因的单核苷酸多态性”)。罗斯福。截止= 0.05 eqtl FDR_male美元= p。调整(eqtl P_male美元,“黑洞”)eqtl $ FDR_female = p。调整(eqtl P_female美元,“黑洞”)打印(sum (eqtl FDR_male美元<罗斯福。截止,na.rm = T) % + %”男,“% + % (eqtl FDR_female美元金额<罗斯福。截止,na.rm = T) % + %”女性,“% + % (eqtl FDR_male美元金额<罗斯福。截止& eqtl美元FDR_female <罗斯福。截止,na.rm = T) % + %费舍尔“。”)。测试(eqtl FDR_male美元<罗斯福。截止,eqtl FDR_female < fdr.cutoff) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #代码块3号:lgrc_sdcd_eQTL。Rnw: 73 - 76 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # discord.ref。等位基因=,(eqtl A1_male美元! = eqtl A1_female美元)(discord.ref eqtl STAT_female美元。等位基因]= -eqtl $ STAT_female [discord.ref。等位基因][discord.ref eqtl BETA_female美元。allele] = -eqtl$BETA_female[discord.ref.allele] ################################################### ### code chunk number 4: lgrc_sdcd_eQTL.Rnw:81-104 ################################################### # package the info as limma fit object to pass to sdcd.core eqtl.male = list( coefficients = data.frame(copd=eqtl$BETA_male), stdev.unscaled = data.frame(copd=eqtl$BETA_male/eqtl$STAT_male), sigma = 1, df.residual = eqtl$NMISS_male - 4, df.prior = eqtl$NMISS_male - 4 ) eqtl.female = list( coefficients = data.frame(copd=eqtl$BETA_female), stdev.unscaled = data.frame(copd=eqtl$BETA_female/eqtl$STAT_female), sigma = 1, df.residual = eqtl$NMISS_female - 4, df.prior = eqtl$NMISS_female - 4 ) # The SDCD analysis eqtl.sdcd = sdcd.core(eqtl.male, eqtl.female, "copd") eqtl = cbind(eqtl, eqtl.sdcd) all.eqtl = eqtl eqtl = subset(eqtl, beta.diff.pval.adj < fdr.cutoff & !is.na(beta.diff.pval.adj)) print("Male-female difference: " %+% nrow(eqtl) %+% " eQTL are significant at level " %+% fdr.cutoff %+% ", covering " %+% length(unique(eqtl$Ensembl_Gene)) %+% " genes.") ################################################### ### code chunk number 5: lgrc_sdcd_eQTL.Rnw:111-112 ################################################### sessionInfo()