跳到正文
0.16.6 文档

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

全站目录 · 按任务查找

基于 geom_feature() 的简洁质粒预设,使用相同通用引擎,选择紧凑圆形轨道、凸肩块状箭头和虚线内部分段连接。

用法

代码
geom_feature_plasmid(
  mapping = NULL,
  data = NULL,
  shape = "arrow",
  width = 0.058,
  arrow_head_length = 0.068,
  arrow_head_width = 1.42,
  arrow_head_style = "shouldered",
  short_feature = "auto",
  segment_boundaries = TRUE,
  boundary_colour = "#666666",
  boundary_linewidth = 0.25,
  boundary_linetype = "22",
  position = NULL,
  show.legend = FALSE,
  inherit.aes = FALSE,
  ...
)

参数

mapping

可选映射。accver、start、end、strand 等角色 aesthetic 可重命名输入列;普通视觉映射在生成几何后计算。

data

含 accver、start、end、strand 的数据框,可选 type、category、label。因子列 start/end 使用数值标签而非内部级别编码;坐标必须为有限数值。可提供 display_priority 或逻辑列 prioritized_display。也可用 directionality 或 direction 代替 strand,取值为 "forward"、"reverse"、"bidirectional"、"none"。

shape

固定注释形状。显式 shape 优先于 aes(feature_shape = ...):支持 "arrow"、"compact_arrow"、"promoter_arrow"、"primer_arrow"、"marker"、"block"、"capped_line"、"primer_arc"、"chevron"、"lollipop",默认 "arrow"。使用 aes(feature_shape = type) 与 scale_feature_shape_manual() 将类别映射为形状。

width

轨道宽度,默认对应桌面质粒编辑器常用的紧凑注释带。

arrow_head_length, arrow_head_width

序列局部坐标中的箭头尺寸,与 geom_gene() 共用。arrow_head_width 大于 1 时形成凸出的块状箭头。

arrow_head_style

箭头构造方式:"shouldered" 保留凸出箭头,"flush" 使箭头与主体齐平,"triangle" 绘制完整三角楔形。

short_feature

注释太短、容不下指定箭头时的处理:自动压缩为方向符号,或改用楔形、矩形。

segment_boundaries

绘制分段注释携带的内部标记。连续源分段的连接处使用点线;分段级非实线 line_style 可覆盖该样式,cleavage_arrows 坐标可添加或合并生物学切割标记。这些标记不会产生额外箭头。

boundary_colour, boundary_linewidth, boundary_linetype

内部分段连接处的外观。

position

注释位置。默认 NULL 在质粒骨架内侧将重叠注释堆叠到紧凑轨道。独立标签层应复用同一个显式 position_feature_stack() 对象,使多边形与标签同轨。可选数值列 display_priority(较大优先)或逻辑列 prioritized_display 可覆盖重叠注释默认的最长优先顺序。

show.legend, inherit.aes

标准 ggplot2 图层参数。

...

其他固定多边形 aesthetic。

返回值

一个 ggplot2 图层。