# #设置,包括= FALSE --------------------------------------------------- knitr: opts_chunk美元集(崩溃= TRUE,发表评论 = "#>" ) ## ---- 呼应= FALSE,消息= FALSE ----------------------------------------------- 库(multiHiCcompare ) ## ---- eval = FALSE ------------------------------------------------------------ # BiocManager::安装(“multiHiCcompare”)#库(multiHiCcompare ) ## ---- eval = FALSE -------------------------------------------------------------- # # #垫< - read.table读入文件(“hic_1000000.matrix”)#床< - read.table (hic_1000000_abs.bed) # #皈依BEDPE # dat < - HiCcompare:: hicpro2bedpe(垫、床)# #注意:Hicpro2bedpe返回一个列表的列表。# #第一个列表dat$cis包含染色体内接触矩阵# #注:dat$trans包含染色体间接触矩阵# #,在multiHiCcompare中不使用。# # - eval = FALSE ------------------------------------------------------------ # 库(BiocParallel) # numCores < - 20 #寄存器(MulticoreParam(工人= numCores),默认= TRUE ) ## ---- eval = FALSE ------------------------------------------------------------ # 库(BiocParallel) # numCores < - 20 #寄存器(SnowParam(工人= numCores),默认= TRUE ) ## ----------------------------------------------------------------------------- 数据(“HCT116_r1”)#加载示例稀疏矩阵头(HCT116_r1) colnames (HCT116_r1) < - c(‘装备’,‘region1’,‘region2’,‘如果’)头(HCT116_r1) # #重命名列矩阵multiHiCcompare准备输入 ## ----------------------------------------------------------------------------- 数据(“HCT116_r1”、“HCT116_r2”、“HCT116_r3”、“HCT116_r4”)hicexp1 < make_hicexp (HCT116_r1、HCT116_r2 HCT116_r3,HCT116_r4,组= c(0,0,1,1), 0。p = 0.8, A.min = 5, filter = TRUE,移除。= hg19_cyto) hicexp1区域 ## ----------------------------------------------------------------------------- 数据(“hg19_cyto”)的数据(“hg38_cyto”)hg19_cyto # # - eval = FALSE -------------------------------------------------------------- # 数据(“hicexp2”)# hicexp2 < - hic_scale (hicexp2 ) ## ----------------------------------------------------------------------------- hicexp1 < - cyclic_loess (hicexp1 verbose = FALSE,平行= FALSE,跨度= 0.2)#使MD情节MD_hicexp (hicexp1 ) ## ----------------------------------------------------------------------------- hic_table (hicexp1 ) ## ----------------------------------------------------------------------------- 数据(“hicexp2”)#执行fastlo正常化hicexp2 < - fastlo (hicexp2 verbose = FALSE,并行= FALSE) #使MD情节MD_hicexp (hicexp2 ) ## ----------------------------------------------------------------------------- hicexp1 < - hic_exactTest (hicexp1 p.method = 'fdr', parallel = FALSE) # plot results MD_composite(hicexp1) ## ----------------------------------------------------------------------------- results(hicexp1) ## ----------------------------------------------------------------------------- batch <- c(1,2,1,2) # produce design matrix d <- model.matrix(~factor(meta(hicexp2)$group) + factor(batch)) ## ---- eval=FALSE-------------------------------------------------------------- # hicexp2 <- hic_glm(hicexp2, design = d, coef = 2, method = "QLFTest", p.method = "fdr", parallel = FALSE) ## ---- eval=FALSE-------------------------------------------------------------- # # use Treat option # hicexp2 <- hic_glm(hicexp2, design = d, coef = 2, method = "Treat", # M = 0.5, p.method = "fdr", parallel = FALSE) ## ----------------------------------------------------------------------------- td <- topDirs(hicexp1, logfc_cutoff = 0.5, logcpm_cutoff = 0.5, p.adj_cutoff = 0.2, return_df = 'pairedbed') head(td) ## ----------------------------------------------------------------------------- counts <- topDirs(hicexp1, logfc_cutoff = 0.5, logcpm_cutoff = 0.5, p.adj_cutoff = 0.2, return_df = 'bed', pval_aggregate = "max") head(counts) ## ----------------------------------------------------------------------------- plot_pvals(counts) ## ----------------------------------------------------------------------------- plot_counts(counts) ## ----------------------------------------------------------------------------- manhattan_hicexp(hicexp1, p.adj_cutoff = "standard") ## ----------------------------------------------------------------------------- MD_hicexp(hicexp1, prow = 2, pcol = 3) ## ----------------------------------------------------------------------------- MD_composite(hicexp1) ## ---- echo=FALSE-------------------------------------------------------------- sessionInfo()