# #——依赖性,警告= FALSE,消息= FALSE ------------------------------- 库(bnbc) # #——dataLoad ----------------------------------------------------------------- 数据(cgEx) cgEx # #——创造 ------------------------------------------------------------------- 构成了rowData (cgEx构成了rowData = cgEx < ContactGroup(),联系人=联系人(cgEx),colData = colData (cgEx )) ## ---- 打印 -------------------------------------------------------------------- cgEx # #——contactTriang ------------------------------------------------------------ 垫< -矩阵(1:9,nrow = 3, ncol = 3)垫(lower.tri(垫)]< - 0垫# #现在我们填写下三角矩阵的上三角垫(lower.tri(垫)<——垫(upper.tri(垫)]垫# #——data_to_bnbc eval = FALSE,回声= TRUE -------------------------------------- # ## 例子不运行# # #上三角形转化为对称矩阵# MatsList < -拉普(upper.mats。列表,功能(M) {# M [lower.tri (M)) < - M [upper.tri (M )] # }) # ## 使用构造函数方法# cg < - ContactGroup ContactGroup (rowData = LociData联系人= MatsList colData = SampleData) # #——cooler_get_genome_index -------------------------------------------------- coolerDir < -系统。文件("cooler", package = "bnbc")冷却<- list。files(coolerDir, pattern="cool$", full.names=TRUE) step <- 4e4 bin.ixns.list <- bnbc:::getGenomeIdx(coolerDir, pattern="cool$", full.names=TRUE) bin。Ixns <- bin. Ixns .list$bin。ixns # #——cooler_get_cg ------------------------------------------------------------ 数据(cgEx)酷。cg <- bnbc::: getchrcgfrombeams (bin. txt)ixns文件=冷却,=“chr22”,从而向colData = colData (cgEx) [1:2,]) all.equal(联系人(cgEx)[[1]],联系人(cool.cg) [[1 ]]) ## ---- band_example ------------------------------------------------------------- mat.1 < -联系人(cgEx) [[1]] mat.1 [1000:1005 1000:1005] b1 < -乐队(垫=垫。1, band.no=2) band(mat=mat。1, band.no = 2) < - b1 + 1 mat.1 1000:1005, 1000:1005 # #——logcpm ------------------------------------------------------------------- cgEx。cpm < - logCPM (cgEx) # #,平滑 ---------------------------------------------------------------- cgEx。smooth <- boxsmooth (cgEx。cpm, h=5) ##或## cgEx。smooth <- gausssmooth (cgEx。cpm,半径= 3σ= 4)# #——bnbc --------------------------------------------------------------------- cgEx。bnbc <- bnbc(cgEx。smooth, batch=colData(cgEx.smooth)$Batch, threshold=1e7, step=4e4, nbands=11, verbose=FALSE) ## ----sessionInfo, echo=FALSE-------------------------------------------------- sessionInfo()