# #——消息= FALSE --------------------------------------------------------- 库(BRGenomics)数据(“PROseq”)(“txs_dm6_chr4数据 ") ## ---- 崩溃= TRUE --------------------------------------------------------- counts_txs < - getCountsByRegions (PROseq txs_dm6_chr4) counts_txs[1:5]长度(txs_dm6_chr4) = = (counts_txs ) ## ----------------------------------------------------------------------------- # 得到第一个100基地的成绩单txs_pr < -促进剂(txs_dm6_chr4 0100) #得到每个子区域内的信号在每个基地countmatrix_pr < getCountsByPositions (PROseq txs_pr ) ## ---- 崩溃= TRUE --------------------------------------------------------- 类(countmatrix_pr) nrow (countmatrix_pr) = =长度(txs_pr) ncol (countmatrix_pr) = =宽度(txs_pr [1 ]) ## ----------------------------------------------------------------------------- # 每个子区域内得到信号在10 bp垃圾箱countmatrix_pr_bin < getCountsByPositions (PROseq txs_pr,binsize = 10) countmatrix_pr_bin [1:5 , ] ## ---- 崩溃= TRUE --------------------------------------------------------- 所有(rowSums (countmatrix_pr_bin) = = rowSums (countmatrix_pr )) ## ---- 错误= TRUE ------------------------------------------------------------ getCountsByPositions (PROseq txs_dm6_chr4 ) ## ---- 崩溃= TRUE --------------------------------------------------------- idx < - which.max (rowSums (countmatrix_pr) idx情节(x = 1: ncol (countmatrix_pr), y = countmatrix_pr idx,,type = " h ",主要= txs_pr tx_name美元[idx], xlab =“TSS距离”,ylab = " PRO-seq信号 ") ## ----------------------------------------------------------------------------- 海关与边境保护局。df < - getCountsByPositions (PROseq、txs_pr binsize = 10,融化= TRUE, ncores = 1)头(cbp.df ) ## ----------------------------------------------------------------------------- 库(ggplot2 ) ## ----------------------------------------------------------------------------- ggplot (cbp)。df, aes (x - 5 = 10 *位置,y =地区,填补=信号))+ geom_raster () + coord_cartesian(扩大= FALSE) +实验室(x =“TSS的距离”,y =“成绩单”,title =“PRO-seq”,填补=“读取”)+ theme_bw () ## ----------------------------------------------------------------------------- # 只需要行像样的信号row_signal < - rowSums (countmatrix_pr) idx_signal < - row_signal >中值(row_signal) cbp < - countmatrix_pr [idx_signal,] # row-normalize cbp_rn <- 100 * cbp / rowsum (cbp) # get row order(by max position) row_order <- order(apply(cbp_rn, 1, which.max), deleting = TRUE) # melt into a dataframe rn_cbp. #df < - reshape2::融化(cbp_rn row_order,, varnames = c(“地区”、“位置”),value.name = "信号 ") ## ----------------------------------------------------------------------------- ggplot (rn_cbp。df, aes(x = position, y = region, fill = signal)) + geom_raster() + scale_fill_gradient(low = "white", high = "blue") + coord_cartesian(expand = FALSE) + labs(x = "距离TSS", y = NULL, title = "Row-Normalized PRO-seq", fill = "% signal ") + theme_bw() + theme(axis.ticks.)。Y = element_blank(), axis.text.y = element_blank())