0.16.6 文档
全站目录 · 按任务查找
安装与学习路线
首页安装与环境准备选择合适的学习模块模块一『弦图』部分
1.1 输入表与字段含义1.2 生成与导入比对数据1.3 从骨架逐层添加1.4 方向、曲率与避障1.5 筛选与整理连接1.6 原始文件完整流程1.7 弦图综合展示模块二『共线性图』部分
2.1 复用弦图的数据2.2 只替换坐标系,再逐层添加2.3 跨行连接、避障与比例尺2.4 比较基因邻域2.5 局部、锚定与分段2.6 共线性综合展示模块三『质粒图』部分
3.1 DNA、注释与13个参考序列3.2 从圆圈到多层注释3.3 识别特征、引物与酶切3.4 13个质粒参考案例3.5 质粒综合实战按需查阅:数据与图层
数据与坐标导入和转换数据导入核酸和蛋白比对将蛋白区间转换为基因组坐标绘制注释与处理重叠放置和调整标签添加数据轨道设置配色、图例和主题按序列和链设置参数调整图形预览和保存图形学习地图与函数查阅
使用教程函数文档示例图集常见问题迁移到候选 API术语说明更新日志迁移到候选 API
范围与时间
下列写法是当前候选替代,不是 v1.0.0 长期兼容承诺。0.16.0–0.16.4 阶段成果已随 v0.16.5 交付。 当前安装标签为 v0.16.6。RC 审计保留 灵活参数、拼写别名、重导出及 getter/export 入口,没有新增弃用。 表中的旧调用用于解释迁移,不应作为当前例子执行。 历史证据只提供删除上界时,不猜测精确首删 tag。
替代表
| 旧写法(勿执行) | 当前写法 | 删除 / 守卫 | 含义 |
|---|---|---|---|
geom_ribbon() |
geom_link_ribbon() |
≤ 0.16.1 | 连接图层改名,不影响 ggplot2::geom_ribbon()。 |
ggchord(..., rotation = 20) |
ggchord(...) + coord_chord(rotation = 20) |
≤ 0.16.1 | 全局坐标使用 + 组合。 |
geom_feature(feature_shape = "block", feature_width = .05) |
geom_feature(shape = "block", width = .05) |
0.16.1 | 映射角色 feature_shape 保留。 |
geom_gene(gene_offset = c("+" = .1, "-" = .2)) |
geom_gene(position = position_strand(c("+" = .1, "-" = -.2))) |
0.16.1 | 显式 Position 值带符号。 |
geom_feature(feature_offset = .1) |
geom_feature(position = position_strand(.1)) |
0.16.1 | 使用 Position 对象。 |
geom_gene(gene_width = .05) |
geom_gene(width = .05) |
0.16.1 | 固定几何统一使用 width。 |
geom_link_ribbon(ribbon_gap = .01) |
geom_link_ribbon(link_gap = .01) |
0.16.1 | 使用 link_gap,控制点同样使用 link_ctrl_point。 |
geom_gene_label_repel(gene_label_layout = "aligned") |
geom_gene_label_repel(label_layout = "auto") |
0.16.1 | 同时迁移参数名和取值。 |
geom_gene_label_repel(label_rotation = 90) |
geom_gene_label(label_rotation = 90) |
0.16.4 guard | 原先忽略的手动控制现报错,也可删除它使用自动布局。 |
geom_feature_label_repel(label_orientation = "horizontal") |
geom_feature_label(label_orientation = "horizontal") |
0.16.4 guard | 未知链 feature 使用固定 feature 标签层。 |
geom_restriction_site(leader = "trunk") |
geom_restriction_site(leader = "radial") |
0.16.1 | radial 默认值保持。 |
theme_ggchord(base_size = 10) |
theme_ggchord() + theme(text = element_text(size = 10)) |
≤ 0.16.1 | 文字外观属于 theme 元素。 |
运行当前替代
在新会话中运行下面的准备代码,再执行当前替代写法:
准备代码 · 在本页运行一次
代码
library(ggchord)
library(dplyr)
data(seq_data_example)
data(ribbon_data_example)
data(gene_data_example)
seqs <- seq_data_example |>
select(accver, length)
links <- ribbon_data_example |>
select(qaccver, saccver, qstart, qend, sstart, send)
# The fixture preserves biological strands separately from its old display strands.
genes <- gene_data_example |>
transmute(accver, start, end, strand = source_strand)
library(dplyr)
data(plasmid_example_pUC19)
plasmid_seq <- plasmid_example_pUC19 |>
select(accver, length)
feature_source <- find_common_features(plasmid_example_pUC19)
features <- feature_source |>
select(accver, start, end, strand, type, anno)代码
p_migrated <- ggchord(plasmid_seq) +
geom_seq() +
geom_feature(data = features, shape = "block", width = .05) +
geom_feature_label(data = features, label_rotation = 0) +
coord_circular()
p_offsets <- ggchord(seqs, gene_data = genes) +
geom_seq() +
geom_gene(position = position_strand(c("+" = .1, "-" = -.2)))旧负链 offset 幅度在显式 Position 中需要负号。映射仍使用 aes(feature_shape = type) 配合 shape 标度,固定参数则为 shape。 自动标签使用 label_layout,手动几何控制使用相应固定标签层。 label_layout = "aligned" 改为 "auto"。已删除名称明确报错,不保留静默执行路径。
保留的支持
五个 colour/color 拼写别名、全部上游重导出、gene/注释/plasmid 快捷入口及 getter/export 两类几何接口均保留。各坐标默认差异和已记录结果字段保持。NULL/NA/缺参语义应查阅 接口说明和当前参考;NULL 不统一表示关闭。