add 更新引用
This commit is contained in:
parent
d3a9e4f691
commit
5a42a4c880
34
main.R
34
main.R
@ -1,28 +1,13 @@
|
||||
# 列出所需的包
|
||||
packages <- c("ComplexHeatmap", "circlize", "RColorBrewer", "dendextend", "dendsort", "gridBase")
|
||||
|
||||
# 检查并安装缺失的包
|
||||
install_if_missing <- function(pkg) {
|
||||
if (!requireNamespace(pkg, quietly = TRUE)) {
|
||||
if (pkg == "ComplexHeatmap") {
|
||||
if (!requireNamespace("BiocManager", quietly = TRUE)) {
|
||||
install.packages("BiocManager")
|
||||
}
|
||||
BiocManager::install("ComplexHeatmap")
|
||||
} else {
|
||||
install.packages(pkg, dependencies = TRUE)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# 应用函数到每个包
|
||||
sapply(packages, install_if_missing)
|
||||
|
||||
# 加载所有包
|
||||
lapply(packages, library, character.only = TRUE)
|
||||
library(grid)
|
||||
library(ComplexHeatmap)
|
||||
library(circlize)
|
||||
library(RColorBrewer)
|
||||
library(dendextend)
|
||||
library(dendsort)
|
||||
library(gridBase)
|
||||
|
||||
# 加载绘图数据
|
||||
data <- read.table(file = 'E:/hui.zhang/Drawpic/1.csv', header = TRUE, row.names = 1, sep = ',')
|
||||
data <- read.table(file = 'D:/code/R/1.csv', header = TRUE, row.names = 1, sep = ',')
|
||||
|
||||
# 查看数据
|
||||
head(data)
|
||||
@ -97,4 +82,5 @@ circos.track(track.index = get.current.track.index(), panel.fun = function(x, y)
|
||||
}
|
||||
}, bg.border = NA)
|
||||
|
||||
circos.clear()
|
||||
circos.clear()
|
||||
|
||||
|
Reference in New Issue
Block a user