R 数据可视化 —— 聚类热图 ComplexHeatmap(四)图例

前言

忘了说了,直接使用

install.packages("ComplexHeatmap")

安装的版本比较老旧,有些功能不支持。比如富文本解析函数 gt_render,以及一些参数和图形表现形式的差异。

所以为了获取更新的、完善的功能,推荐大家使用 devtools 安装 GitHub 上的 2.7 版本

library(devtools)
install_github("jokergoo/ComplexHeatmap")

热图和简单注释会自动生成图例,并放置在图像右边区域。而复杂注释默认不会显示图例,但是可以手动构建和添加

所有图例都是通过 Legend() 函数来构造的,不论是单个图例,还是多个图例都属于 Legends

热图和注释的图例可以分别在 Heatmap() 函数的 heatmap_legend_param 参数和 HeatmapAnnotation() 函数的 annotation_legend_param 参数中进行设置

1. 连续型图例

连续型图例需要传递一个颜色映射函数,类似于热图及注释函数中的 col 参数,但是图例中的颜色映射函数中的 break 与显式的并不完全一样

例如

col_fun <- colorRamp2(
  breaks = c(0, 0.5, 1), 
  colors = c("blue", "white", "red")
  )
lgd <- Legend(col_fun = col_fun, title = "foo")

图例中显示的断点数会自动调整,使标签数量接近 56

> class(lgd)
[1] "Legends"
attr(,"package")
[1] "ComplexHeatmap"

可以看到,lgdLegends 类,可以使用 width.Legends()height.Legends() 获取图例的大小

> width.Legends(lgd)
[1] 9.90361111111111mm
> height.Legends(lgd)
[1] 28.0329444444444mm

图例实际上由矩形、线条和文本组成的包装图形对象。它可以通过 draw() 函数添加到绘图中

pushViewport(viewport(width = 0.9, height = 0.9))
grid.rect()  
draw(lgd, x = unit(1, "cm"), 
     y = unit(1, "cm"), 
     just = c("left", "bottom"))
draw(lgd, x = unit(0.5, "npc"), 
     y = unit(0.5, "npc"))
draw(lgd, x = unit(1, "npc"), 
     y = unit(1, "npc"), 
     just = c("right", "top"))
popViewport()

下面的例子中,我们将只给出图例的配置,而不再显式地使用 draw 来绘制

可以使用 at 参数来调整图例的断点

lgd <- Legend(
  col_fun = col_fun, title = "foo", 
  at = c(0, 0.25, 0.5, 0.75, 1))

labels 用于设置图例标签,labels_gp 用于设置标签图形属性

lgd <- Legend(
  col_fun = col_fun, title = "foo", 
  at = c(0, 0.5, 1), 
  labels = c("low", "median", "high"),
  labels_gp = gpar(col = "red", font = 3)
)

图例标题和标签可以设置为公式

lgd <- Legend(
  col_fun = col_fun, 
  title = expression(hat(beta) == (X^t * X)^{-1} * X^t * y), 
  at = c(0, 0.25, 0.5, 0.75, 1), 
  labels = expression(alpha, beta, gamma, delta, epsilon)
)

设置富文本

lgd <- Legend(
  col_fun = col_fun, 
  title = gt_render("<span style='color:orange'>**Legend title**</span>"), 
  title_gp = gpar(box_fill = "grey"),
  at = c(-3, 0, 3), 
  labels = gt_render(c("<span style='color:blue'>*negative*</span> three", "zero", 
                       "<span style='color:red'>*positive*</span> three"))
)

legend_height 可以设置竖直图例主体的高度,不包括图例标题,grid_width 控制图例主体的宽度

lgd <- Legend(
  col_fun = col_fun, title = "foo", 
  legend_height = unit(6, "cm"),
  grid_width = unit(1, "cm")
)

border 用于控制图例框线和刻度颜色,可以是逻辑值或颜色值

lgd <- Legend(
  col_fun = col_fun, title = "foo", 
  border = "blue"
  )

title_position 控制图例标题的位置,对于竖直图例,可选的值为 toplefttopcenterlefttop-rotleftcenter-rot

例如,左侧上方旋转

lgd <- Legend(
  col_fun = col_fun, title = "foooooooo", 
  title_position = "lefttop-rot",
  legend_height = unit(4, "cm")
  )

左侧中心且旋转

lgd <- Legend(
  col_fun = col_fun, title = "foooooooo", 
  title_position = "leftcenter-rot",
  legend_height = unit(4, "cm")
  )

类似地,对于水平图例,legend_width 可以设置相应的宽度,topcentertopleftlefttopleftcenter 控制图例标题

例如

lgd <- Legend(col_fun = col_fun, title = "foo", direction = "horizontal")


设置宽度

lgd <- Legend(
  col_fun = col_fun, title = "foo", 
  legend_width = unit(6, "cm"), 
  direction = "horizontal"
)


设置断点、标签及其图形参数

lgd <- Legend(
  col_fun = col_fun, title = "foo", 
  at = c(0, 0.5, 1), direction = "horizontal",
  labels = c("low", "median", "high"),
  labels_gp = gpar(col = "red", font = 3)
)

设置标题位置 toplefttopcenterlefttopleftcenter

lgd <- Legend(
  col_fun = col_fun, title = "foooooooo", 
  direction = "horizontal", 
  title_position = "topcenter"
)

lgd <- Legend(
  col_fun = col_fun, title = "foooooooo", 
  direction = "horizontal", 
  title_position = "lefttop"
)

在上面的示例中,断点都是等间隔的,其实 at 参数也可以设置为非等间隔的区间。例如

lgd <- Legend(
  col_fun = col_fun, title = "foo", 
  at = c(0, 0.1, 0.15, 0.5, 0.9, 0.95, 1)
)

会在对应断点处显示刻度,为了防止重叠,会自动调整标签的放置位置,且会有连接线连接刻度和标签

如果标签不需要调整,则正常显示

lgd <- Legend(
  col_fun = col_fun, title = "foo", 
  at = c(0, 0.3, 1)
)

对于水平方向的图例,设置方式类似

lgd <- Legend(
  col_fun = col_fun, title = "foo", 
  at = c(0, 0.1, 0.15, 0.5, 0.9, 0.95, 1),
  direction = "horizontal"
)

旋转标签

lgd <- Legend(
  col_fun = col_fun, title = "foo", 
  at = c(0, 0.1, 0.15, 0.5, 0.9, 0.95, 1),
  direction = "horizontal", labels_rot = 90,
  title_position = "lefttop"
)

如果 at 参数设置为降序,则图例也会翻转

lgd <- Legend(
  col_fun = col_fun, title = "foo", 
  at = c(1, 0.8, 0.6, 0.4, 0.2, 0)
)

2. 离散型图例

离散型图例的设置与连续型基本一致,我们主要介绍一下不同的地方

不同于连续型图例的颜色设置,离散型用 legend_gp 参数来设置

lgd <- Legend(
  at = 1:6, title = "foo", 
  legend_gp = gpar(fill = 1:6)
  )

lgd <- Legend(
  labels = month.name[1:6], 
  title = "foo", 
  legend_gp = gpar(fill = 1:6)
)

使用连续型颜色

at <- seq(0, 1, by = 0.2)
lgd <- Legend(
  at = at, title = "foo", 
  legend_gp = gpar(fill = col_fun(at))
)

标题位置设置与连续型图例一样

lgd <- Legend(
  labels = month.name[1:6], 
  title = "foo", 
  legend_gp = gpar(fill = 1:6),
  title_position = "lefttop",
  title_gp = gpar(col = "red", fontsize = 14)
)

grid_widthgrid_height 可以控制每个颜色矩形的大小

lgd <- Legend(
  at = 1:6, legend_gp = gpar(fill = 1:6), title = "foo", 
  grid_height = unit(1, "cm"), grid_width = unit(5, "mm")
)

labels_gp 参数控制标签的图形属性

lgd <- Legend(
  labels = month.name[1:6], 
  legend_gp = gpar(fill = 1:6), title = "foo", 
  labels_gp = gpar(col = "red", fontsize = 14)
)

使用 gt_render 函数设置富文本

lgd <- Legend(
  title = gt_render("<span style='color:orange'>**Legend title**</span>"), 
  title_gp = gpar(box_fill = "grey"),
  at = c(-3, 0, 3), 
  labels = gt_render(c("**negative** three", "*zero*", "**positive** three")),
  legend_gp = gpar(fill = 1:3)
)

离散型图例的一个重要特征是,可以将图例排列为多行多列。如果 ncol 为数值,则图例会排列为 ncol

lgd <- Legend(
  labels = month.name[1:10], 
  legend_gp = gpar(fill = 1:10), 
  title = "foo", ncol = 3,
  title_position = "topcenter"
)

设置 by_row = TRUE 可以使图例按行顺序排列

lgd <- Legend(
  labels = month.name[1:10], 
  legend_gp = gpar(fill = 1:10), 
  title = "foo", ncol = 3,
  title_position = "topcenter",
  by_row = TRUE
)

可以使用 gapcolumn_gap 设置两列之间的间距

lgd <- Legend(
  labels = month.name[1:10], 
  legend_gp = gpar(fill = 1:10), 
  title = "foo", ncol = 3,
  title_position = "topcenter",
  by_row = TRUE,
  gap = unit(1, "cm")
)

row_gap 可以设置行间距

lgd <- Legend(
  labels = month.name[1:10], 
  legend_gp = gpar(fill = 1:10), 
  title = "foo", ncol = 3, 
  row_gap = unit(5, "mm")
)

设置为一行

lgd <- Legend(
  labels = month.name[1:6], 
  legend_gp = gpar(fill = 1:6), 
  title = "foooooo", nrow = 1, 
  title_position = "leftcenter"
)

Legend() 还支持使用简单的图形作为图例,如 pointslinesboxplots,如果 type 设置为 pointsp,则 pch 参数可以设置为一个字符。例如

lgd <- Legend(
  labels = month.name[1:6], 
  title = "foo", type = "points", 
  pch = 1:6, background = "#FF8080",
  legend_gp = gpar(col = 1:6),
  nrow = 1
)


设置为字母

lgd <- Legend(
  labels = month.name[1:6], 
  title = "foo", type = "p", 
  pch = letters[1:6], background = "white",
  legend_gp = gpar(col = 1:6),
  nrow = 1
)

或者使用线条 type = "lines"/type = "l"

lgd <- Legend(
  labels = month.name[1:6], 
  title = "foo", type = "lines", 
  pch = letters[1:6], background = "white",
  legend_gp = gpar(col = 1:6, lty = 1:6),
  nrow = 1
)

或者使用 type = "boxplot"/type = "box"

lgd <- Legend(
  labels = month.name[1:6], 
  title = "foo", type = "boxplot", 
  pch = letters[1:6], background = "white",
  legend_gp = gpar(fill = 1:6),
  nrow = 1
)

lgd <- Legend(
  labels = paste0("pch = ", 26:28), 
  type = "points", pch = 26:28
)

如果标签是多行,会自动调整图例的高度

lgd <- Legend(
  labels = c("aaaaa\naaaaa", "bbbbb\nbbbbb", "c", "d"),
  legend_gp = gpar(fill = 1:4),
)

如果标签使多行或多列,会根据文本长度自动调整间距

lgd <- Legend(
  labels = c("aaaaa\naaaaa", "c", "d", "bbbbb\nbbbbb"),
  legend_gp = gpar(fill = 1:4), nrow = 2
)

graphics 参数,可以为图例设置自定义图形,该参数必须为一个函数列表,每个函数有 4 个参数值:

  • x、y:控制图例格子的中心点
  • w、h:控制图例格子的宽度和高度

graphics 的长度必须与 atlabels 参数的长度一致。如果 graphics 是命名列表,且与 labels 的名称相对应,会自动调整 graphics 的顺序

lgd <- Legend(
  labels = letters[1:4],
  graphics = list(
    function(x, y, w, h) 
      grid.rect(x, y, w*0.33, h, gp = gpar(fill = "red")),
    function(x, y, w, h)
      grid.rect(x, y, w, h * 0.33, gp = gpar(fill = "blue")),
    function(x, y, w, h)
      grid.text("A", x, y, gp = gpar(col = "darkgreen")),
    function(x, y, w, h)
      grid.points(x, y, gp = gpar(col = "orange"), pch = 16)
    )
)

3. 图例列表

要添加多个图例,可以将每个图例分别添加到 packLegend() 函数中,或以列表的形式传递。例如

lgd1 <- Legend(
  at = 1:6, legend_gp = gpar(fill = 1:6), 
  title = "legend1"
  )
lgd2 <- Legend(
  col_fun = col_fun, title = "legend2", 
  at = c(0, 0.25, 0.5, 0.75, 1)
  )
lgd3 <- Legend(
  labels = month.name[1:3], 
  legend_gp = gpar(fill = 7:9), 
  title = "legend3"
  )

pd <- packLegend(lgd1, lgd2, lgd3)
# 同上
# pd <- packLegend(list = list(lgd1, lgd2, lgd3))
draw(pd)

类似于单个图例,也可以获取图例列表的大小

> width.Legends(pd)
[1] 19.1675555555556mm
> height.Legends(pd)
[1] 78.6988333333334mm

水平排列

pd <- packLegend(
  lgd1, lgd2, lgd3, 
  direction = "horizontal"
)

如果图例是竖直排列的,并且图例的高度超过了指定值,则会自动排列为多列

pd <- packLegend(
  lgd1, lgd3, lgd2, lgd3, lgd2, lgd1, 
  max_height = unit(10, "cm"), 
  column_gap = unit(1, "cm")
)

column_gap 用于控制列的间距

对于水平排列的图例,也是类似的

pd <- packLegend(
  lgd1, lgd2, lgd3, lgd1, lgd2, lgd3, 
  max_width = unit(10, "cm"), 
  direction = "horizontal", 
  column_gap = unit(5, "mm"), 
  row_gap = unit(1, "cm")
)

可以在绘制的时候,指定图例列表的位置

pd <- packLegend(
  lgd1, lgd2, lgd3,
  direction = "horizontal")
pushViewport(viewport(width = 0.8, height = 0.8))
grid.rect()
draw(pd, x = unit(1, "cm"), 
     y = unit(1, "cm"), 
     just = c("left", "bottom"))
draw(pd, x = unit(1, "npc"), 
     y = unit(1, "npc"), 
     just = c("right", "top"))
popViewport()

4. 热图和注释的图例

Heatmap() 函数的 heatmap_legend_param 参数,可以控制热图的图例,例如

m <- matrix(rnorm(100), 10)
Heatmap(
  m, name = "mat", 
  heatmap_legend_param = list(
    at = c(-2, 0, 2),
    labels = c("low", "zero", "high"),
    title = "Some values",
    legend_height = unit(4, "cm"),
    title_position = "lefttop-rot"
  )
)

heatmap_legend_param 接受一个列表,列表中的参数名称与 Legend 中的参数对应

类似地,在 HeatmapAnnotation() 函数中,也有一个 annotation_legend_param 参数,用于控制注释图例

ha <- HeatmapAnnotation(
  foo = runif(10), 
  bar = sample(c("f", "m"), 10, replace = TRUE),
  annotation_legend_param = list(
    foo = list(
      title = "Fooooooh",
      at = c(0, 0.5, 1),
      labels = c("zero", "median", "one")
    ),
    bar = list(
      title = "Baaaaaaar",
      at = c("f", "m"),
      labels = c("Female", "Male")
    )
  )
)
Heatmap(m, name = "mat", top_annotation = ha)

color_bar = "discrete" 可以为连续型的颜色映射设置离散的图例

Heatmap(
  m, name = "mat", 
  heatmap_legend_param = list(
    color_bar = "discrete"),
  top_annotation = HeatmapAnnotation(
    foo = 1:10,
    annotation_legend_param = list(
      foo = list(color_bar = "discrete")))
  )

5. 添加自定义图例

只有热图和简单注释会自动添加热图,复杂热图是没有图例的,例如

ha1 <- HeatmapAnnotation(
  pt = anno_points(
    1:10, height = unit(2, "cm"),
    gp = gpar(col = rep(2:3, each = 5))), 
  show_annotation_name = FALSE
)
ha2 <- HeatmapAnnotation(
  ln = anno_lines(
    cbind(1:10, 10:1), height = unit(2, "cm"),
    gp = gpar(col = 4:5, lty = 1:2)), 
  show_annotation_name = FALSE
)
m <- matrix(rnorm(100), 10)
ht_list = Heatmap(
  m, name = "mat1", top_annotation = ha1) + 
  Heatmap(m, name = "mat2", top_annotation = ha2) +
  Heatmap(
    m[, 1], name = "mat3", 
    top_annotation = HeatmapAnnotation(
      summary = anno_summary(gp = gpar(fill = 2:3))), 
    width = unit(1, "cm")
)
draw(ht_list, ht_gap = unit(7, "mm"), row_km = 2)

可以在 draw 函数中使用 annotation_legend_list 参数添加自定义热图

lgd_list <- list(
  Legend(
    labels = c("red", "green"), 
    title = "pt", type = "points", 
    pch = 16, legend_gp = gpar(col = 2:3)
    ),
  Legend(
    labels = c("darkblue", "lightblue"), 
    title = "ln", type = "lines", 
    legend_gp = gpar(col = 4:5, lty = 1:2)
    ),
  Legend(
    labels = c("group1", "group2"), 
    title = "km", type = "boxplot",
    legend_gp = gpar(fill = 2:3)
    )
)
draw(
  ht_list, ht_gap = unit(7, "mm"), 
  row_km = 2, annotation_legend_list = lgd_list)

6. 图例的位置

默认情况下,热图和注释的图例是放置在图像的右边。

draw 函数的 heatmap_legend_sideannotation_legend_side 参数可以控制热图和注释图例的位置。位置的选择可以是 left, right, bottomtop

m <- matrix(rnorm(100), 10)
ha1 <- HeatmapAnnotation(
  foo1 = runif(10), 
  bar1 = sample(c("f", "m"), 10, replace = TRUE)
  )
ha2 <- HeatmapAnnotation(
  foo2 = runif(10), 
  bar2 = sample(c("f", "m"), 10, replace = TRUE)
  )
ht_list <- Heatmap(
  m, name = "mat1", top_annotation = ha1) +
  rowAnnotation(sth = runif(10)) +
  Heatmap(m, name = "mat2", top_annotation = ha2)

draw(ht_list, heatmap_legend_side = "left", 
     annotation_legend_side = "bottom")

对于放置在上面和下面的图例,可能以水平的排列方式会更好些。

除了设置整个图例的排列方式,还要使用 annotation_legend_param 参数来设置每个图例的方向

ha1 <- HeatmapAnnotation(
  foo1 = runif(10), 
  bar1 = sample(c("f", "m"), 10, replace = TRUE),
  annotation_legend_param = list(
    foo1 = list(direction = "horizontal"),
    bar1 = list(nrow = 1))
  )
ha2 <- HeatmapAnnotation(
  foo2 = runif(10), 
  bar2 = sample(c("f", "m"), 10, replace = TRUE),
  annotation_legend_param = list(
    foo2 = list(direction = "horizontal"),
    bar2 = list(nrow = 1))
  )
ht_list <- Heatmap(
  m, name = "mat1", top_annotation = ha1, 
  heatmap_legend_param = list(direction = "horizontal")) +
  rowAnnotation(
    sth = runif(10), 
    annotation_legend_param = list(
      sth = list(direction = "horizontal"))) +
  Heatmap(
    m, name = "mat2", top_annotation = ha2,
    heatmap_legend_param = list(direction = "horizontal"))
draw(
  ht_list, merge_legend = TRUE, 
  heatmap_legend_side = "bottom", 
  annotation_legend_side = "bottom"
  )

<think>好的,我现在需要帮用户解读代谢组学的聚类。首先,我得回顾一下用户提供的引用内容。用户提到需要熟悉代谢组学从样本处理到数据分析的全流程,以及使用R软件进行分析和可视化,还有机器学习在其中的应用[^1][^2]。这些信息提示我应该结合数据处理流程和R语言工具来回答。 用户的问题是关于聚类的解读方法。聚类在代谢组学中常用于展示代谢物在不同样本中的表达模式,所以需要解释的各个组成部分,比如颜色表示、行列聚类、显著性标记等。同时,用户可能希望了解如何通过生物信息学方法生成和优化这样的表,以及如何从中提取生物学意义。 首先,我应该拆解的元素。颜色通常代表代谢物的相对含量,比如红色表示上调,蓝色表示下调。行代表代谢物,列代表样本或实验条件。行列的聚类树状显示相似性,需要说明聚类的结果如何解读,比如同一分支的代谢物可能具有相似功能或通路。 然后,需要考虑数据分析的步骤,比如数据标准化、归一化处理的重要性,这些步骤会影响聚类结果的可信度。同时,用户可能对如何验证聚类结果感兴趣,比如通过通路富集分析或与其他实验数据关联。 另外,用户引用中提到了机器学习,可能需要解释聚类方法与机器学习的联系,比如无监督学习在模式发现中的应用。同时,使用R语言进行可视化是重点,应该提到常用的包如pheatmap或ComplexHeatmap,并简要说明代码结构,但根据用户要求,行内公式和独立公式需要用LaTeX,但代码块需要用python?不对,用户给的示例中是python,但实际代谢组学分析可能用R,所以可能需要调整。不过用户的问题是关于解读方法,代码示例可能用R更合适,但根据系统级指令,代码块格式可能沿用示例中的格式,但语言应根据实际。这里可能需要确认,但根据引用内容,用户明确提到了R软件,所以应该用R代码示例。 此外,用户可能需要了解如何解读中的统计学显著性,比如星号标记或p值注释。同时,注意事项部分需要提醒常见误区,比如数据预处理的影响,颜色标尺的解读,以及生物学重复的一致性。 最后,生成的相关问题需要围绕代谢组学数据分析的其他方面,比如数据标准化方法、差异代谢物筛选、通路分析工具等,这些都能帮助用户进一步深入学习。 现在需要组织这些思路,确保结构清晰,符合用户要求的中文回答,并正确引用提供的资料。同时检查LaTeX格式是否正确,比如行内公式用$...$,独立公式用$$...$$,但根据问题内容,可能涉及较少的数学公式,更多是数据处理的步骤。如果有提到标准化公式,比如Z-score,可能需要用LaTeX表达,例如$Z = \frac{X - \mu}{\sigma}$。 总结回答结构:分步骤解读元素,数据分析流程,生物学意义,可视化工具,注意事项,并附上R代码示例和相关问题。确保每个部分自然引用[^1],尤其是涉及流程、工具和机器学习部分。</think>### 代谢组学聚类解读方法 代谢组学聚类(Heatmap)是一种直观展示代谢物表达模式的数据可视化工具,结合聚类分析揭示样本或代谢物之间的相似性。以下从**元素解析**、**数据分析流程**和**生物学意义**三方面进行解读: --- #### 一、元素解析 1. **颜色标尺** - 通常用渐变色(如红-蓝)表示代谢物相对含量: - 红色:上调(如$Z > 2$,标准化后值) - 蓝色:下调(如$Z < -2$) - 中间色(白色/浅黄):接近均值($Z \approx 0$) - **注意**:需查看图例确认具体范围,可能使用其他标尺(如log2FC)。 2. **行与列** - **行(Y轴)**:代谢物(如脂质、氨基酸等),按聚类结果排列。 - **列(X轴)**:样本或实验条件(如健康组vs疾病组),聚类后相似样本靠近。 3. **聚类树状(Dendrogram)** - 行/列顶部的树状反映相似性: - 分支长度越短,样本/代谢物相似度越高。 - 例如:同一疾病亚型的样本可能聚为一簇。 4. **显著性标记** - 常用符号(如*、**)或数值标注差异代谢物的p值或FDR。 --- #### 二、数据分析流程 1. **数据预处理** - 标准化:常用$Z = \frac{X - \mu}{\sigma}$消除量纲差异。 - 归一化:如min-max将数据缩放到[0,1]。 - 缺失值处理:删除或插补(如KNN算法)。 2. **聚类算法选择** - **层次聚类(Hierarchical Clustering)**:生成树状,适合小规模数据。 - **K-means**:需预设簇数,适合快速分组。 - 距离度量:欧氏距离(Euclidean)或相关性(Pearson)。 3. **可视化工具(R语言示例)** ```R # 使用pheatmap包 library(pheatmap) pheatmap( data_matrix, scale = "row", # 按行标准化 clustering_method = "complete", # 聚类方法 color = colorRampPalette(c("blue", "white", "red"))(100), # 颜色 show_rownames = FALSE, # 隐藏代谢物名称 annotation_col = sample_group # 样本分组注释 ) ``` --- #### 三、生物学意义挖掘 1. **代谢物簇功能分析** - 同一簇代谢物可能属于相同通路(如TCA循环、脂肪酸代谢),需结合KEGG或HMDB数据库验证。 2. **样本分组验证** - 若疾病组样本聚为一类,可能提示特定代谢紊乱模式。 - 需与临床指标(如血糖、血脂)关联分析。 3. **机器学习关联** - 聚类结果可作为无监督学习的特征,用于后续分类模型(如SVM、随机森林)构建[^1]。 --- #### 注意事项 1. **数据质量**:异常值或批次效应会扭曲聚类结果,需通过PCA预先检查。 2. **标尺一致性**:避免跨实验比较不同标准化的。 3. **生物学重复**:确保聚类模式在重复样本中稳定。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

名本无名

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值