跳到正文
0.16.6 文档

本页完整说明已译为现代汉语;函数、参数、代码和原始数据标识保留原样。 使用教程

全站目录 · 按任务查找

确定性搜索序列顺序和方向,以减少加权连接中心线交叉及过长弦跨度。不修改输入,不接受更差排列。超过 2000 条连接时采用确定性的 64 分箱近似,并在报告中记录 approximate = TRUE。

用法

代码
optimize_ggchord_layout(
  seq_data,
  ribbon_data,
  seq_order = NULL,
  seq_orientation = NULL,
  optimize = c("order", "orientation"),
  weight = c("length", "count", "pident"),
  max_iter = 50L
)

参数

seq_data

含 accver、length 的序列数据。

ribbon_data

ggchord 连接格式的比对数据。

seq_order

可选完整初始序列顺序,默认使用 seq_data 行顺序。

seq_orientation

可选初始方向 1 或 -1,支持单值、完整向量或命名向量。

optimize

选择 "order" 和/或 "orientation"。

weight

目标权重:"length"、"count" 或 "pident"。

max_iter

改善搜索轮数的正整数上限。

返回值

ggchord_layout_optimization 对象,含 seq_order、seq_orientation、前后分数及报告。

示例

代码
library(dplyr)
data(seq_data_example)
seqs <- seq_data_example |>
  select(accver, length)
data(ribbon_data_example)
links <- ribbon_data_example |>
  select(qaccver, saccver, qstart, qend, sstart, send)
suggestion <- optimize_ggchord_layout(seqs, links, weight = "count")
suggestion$seq_order