A general layer for CDS, tRNA, rRNA, repeat, CRISPR, promoter or user-defined features. It supports directional arrows, blocks, notched chevrons and lollipops, all generated against the sequence's real local curve. Feature fill and geometry use independent role-specific scales.
Usage
geom_feature(
mapping = NULL,
data = NULL,
type = "type",
category = NULL,
label = "label",
feature_shape = "arrow",
feature_colors = NULL,
feature_width = NULL,
feature_offset = NULL,
feature_order = NULL,
show_legend = TRUE,
legend_position = "right",
...
)Arguments
- mapping
Optional aesthetic mapping. Role aesthetics such as
seq_id,start,endandstrandmay rename input columns; ordinary visual mappings are evaluated after geometry is generated.- data
data.frame with
seq_id,start,endandstrand; optionaltype,categoryandlabel.- type
Column name used as the feature type, default
"type".- category
Optional column name used for colour grouping; defaults to
type.- label
Optional column name used for annotation text; defaults to
labelwhen present, otherwisetype.- feature_shape
Fixed feature geometry used when
feature_shapeis not mapped inaes():"arrow","block","chevron", or"lollipop". The default is"arrow". Useaes(feature_shape = type)together withscale_feature_shape_manual()to map categories to geometry.- feature_colors
Optional named color vector by feature value; unnamed vectors are recycled positionally.
- feature_width
Optional numeric or named vector controlling feature width; passed to
geom_gene(gene_width = ...).- feature_offset
Optional numeric or named vector controlling feature offset; passed to
geom_gene(gene_offset = ...).- feature_order
Optional feature order for the legend.
- show_legend
Logical. Show the feature legend, default TRUE.
- legend_position
Position of the feature legend:
"left","right","top","bottom"or"inside".- ...
Additional arguments passed to
geom_gene().
