From 58335ca48e04e748eb2e5f5c6734ed708d4512ef Mon Sep 17 00:00:00 2001 From: Thomas Hackl Date: Thu, 12 Oct 2023 23:59:16 +0200 Subject: [PATCH] forgot man/geom_seq_break --- man/geom_seq_break.Rd | 99 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 man/geom_seq_break.Rd diff --git a/man/geom_seq_break.Rd b/man/geom_seq_break.Rd new file mode 100644 index 0000000..8cd9344 --- /dev/null +++ b/man/geom_seq_break.Rd @@ -0,0 +1,99 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/geom_seq_break.R +\name{geom_seq_break} +\alias{geom_seq_break} +\title{Decorate truncated sequences} +\usage{ +geom_seq_break( + mapping_start = NULL, + mapping_end = NULL, + data_start = seqs(start > 1), + data_end = seqs(end < length), + label = "/", + size = 4, + hjust = 0.75, + family = "bold", + stat = "identity", + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE, + ... +) +} +\arguments{ +\item{data_start}{seq_layout of sequences for which to decorate the start. +default: \code{seqs(start >1)}} + +\item{data_end}{seq_layout of sequences for which to decorate the end. +default: \code{seqs(end < length)}} + +\item{label}{the character to decorate ends with. Provide two values for +different start and end decorations, e.g. \code{label=c("]", "[")}.} + +\item{stat}{The statistical transformation to use on the data for this +layer, either as a \code{ggproto} \code{Geom} subclass or as a string naming the +stat stripped of the \code{stat_} prefix (e.g. \code{"count"} rather than +\code{"stat_count"})} + +\item{na.rm}{If \code{FALSE}, the default, missing values are removed with +a warning. If \code{TRUE}, missing values are silently removed.} + +\item{show.legend}{logical. Should this layer be included in the legends? +\code{NA}, the default, includes if any aesthetics are mapped. +\code{FALSE} never includes, and \code{TRUE} always includes. +It can also be a named logical vector to finely select the aesthetics to +display.} + +\item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, +rather than combining with them. This is most useful for helper functions +that define both data and aesthetics and shouldn't inherit behaviour from +the default plot specification, e.g. \code{\link[ggplot2:borders]{borders()}}.} + +\item{...}{Other arguments passed on to \code{\link[ggplot2:layer]{layer()}}. These are +often aesthetics, used to set an aesthetic to a fixed value, like +\code{colour = "red"} or \code{size = 3}. They may also be parameters +to the paired geom/stat.} +} +\description{ +\code{geom_seq_break()} adds decorations to the ends of truncated sequences. These +could arise from zooming onto sequence loci with \code{focus()}, or manually +annotating sequences with start > 1 and/or end < length. +} +\examples{ +# decorate breaks created with focus() +gggenomes(emale_genes, emale_seqs) |> + focus(.expand=1e3, .max_dist = 1e3) + + geom_seq() + geom_gene() + + geom_seq_break() + +# customize decorations +gggenomes(emale_genes, emale_seqs) |> + focus(.expand=1e3, .max_dist = 1e3) + + geom_seq() + geom_gene() + + geom_seq_break(label=c("[", "]"), size=3, color="#1b9e77") + +# decorate manually truncated sequences +s0 <- tribble( + # start/end define regions, i.e. truncated contigs + ~bin_id, ~seq_id, ~length, ~start, ~end, + "complete_genome", "chromosome_1_long_trunc_2side", 1e5, 1e4, 2.1e4, + "fragmented_assembly", "contig_1_trunc_1side", 1.3e4, .9e4, 1.3e4, + "fragmented_assembly", "contig_2_short_complete", 0.3e4, 1, 0.3e4, + "fragmented_assembly", "contig_3_trunc_2sides", 2e4, 1e4, 1.4e4 +) + +l0 <- tribble( + ~seq_id, ~start, ~end, ~seq_id2, ~start2, ~end2, + "chromosome_1_long_trunc_2side", 1.1e4, 1.4e4, + "contig_1_trunc_1side", 1e4, 1.3e4, + "chromosome_1_long_trunc_2side", 1.4e4, 1.7e4, + "contig_2_short_complete", 1, 0.3e4, + "chromosome_1_long_trunc_2side", 1.7e4, 2e4, + "contig_3_trunc_2sides", 1e4, 1.3e4 +) + +gggenomes(seqs=s0, links=l0) + + geom_seq() + geom_link() + + geom_seq_label(nudge_y=-.05) + + geom_seq_break() +}