## ----loadData-------------------------------------------------------------- library(compartmap) library(GenomicRanges) library(homm .sapiens) #在一些示例中加载甲基化阵列数据#该数据来自https://f1000research.com/articles/5-1281/v3 #data(meth_array_450k_chr14, package = "compartmap") #在一些示例中加载atacs -seq数据data(bulkATAC_raw_filtered_chr14,包= " compartmap ") ## ---- processData ----------------------------------------------------------- # 示例的过程chr14阵列数据#注:并行运行这个内存饿!#array_compartments <- getCompartments(array.data. data.)chr14, type = "array", parallel = FALSE, chrs = "chr14") # ATAC-seq data中的chr14进程atac_compartments <- getCompartments(filters .data. data.)chr14类型=“atac平行= FALSE,空空的= " chr14 ") ## ---- 集群,eval = FALSE ---------------------------------------------- # # # 绘制单个样品# # 7 # #样品在必要时调整ylim # par (mar = c (1, 1, 1, 1) # par (mfrow = c (7 - 1)) # plotAB (array_compartments [1], ylim = c (-0.2, 0.2), unitarize = TRUE) # plotAB (array_compartments [2], ylim = c (-0.2, 0.2), unitarize = TRUE,顶部。col = "goldenrod") # plotAB(array_compartments[,3], ylim = c(-0.2, 0.2), unitarize = TRUE,顶部。col = "深蓝色")# plotAB(array_compartments[,4], ylim = c(-0.2, 0.2), unitized = TRUE,顶部。col = "red") # plotAB(array_compartments[,5], ylim = c(-0.2, 0.2), unitized = TRUE,顶部。col = "black") # plotAB(array_compartments[,6], ylim = c(-0.2, 0.2), unitarize = TRUE,顶部。col = "cyan") # plotAB(array_compartments[,7], ylim = c(-0.2, 0.2), unitarize = TRUE,顶部。# #使用UMAP嵌入无监督集群# library(uwot) # embed_compartments <- UMAP (t(array_compartments), n_neighbors = 3, metric = "manhattan", n_components = 5, n_trees = 100) # # #可视化嵌入# library(vizier) # library(plotly) # embed_plotly(embed_compartments, tooltip = colnames(embed_compartments), show_legend = FALSE) #