Skip to contents
0.16.6 documentation

Complete canonical API text; task articles explain the workflows. Tutorials

Site guide · find your task

Explicit adapters return ordinary data frames. Optional interval packages are loaded only when their objects are supplied; drawing never installs or runs external data preparation. Supported S4 inputs supplied directly to ggchord or its layers use the same adapters. Identifiers are kept verbatim.

Usage

Code
as_ggchord_seq(x, mapping = NULL, lengths = NULL, ids = NULL)

Arguments

x

A data frame, GRanges, Seqinfo, GInteractions, or a Biostrings XStringSet/XString object.

mapping

Optional named character vector output_role = "input_column" for data-frame inputs. For example c(accver = "chrom", length = "size").

lengths

Optional named numeric vector of known sequence lengths. Fills unknown lengths and must agree with any known source lengths.

ids

Optional character vector of explicit identifiers for unnamed XStringSet/XString inputs only. Existing source names must agree.

Value

An ordinary data frame with accver, length and retained metadata. Its ggchord_conversion attribute records input class, coordinate system, column renaming, object-level metadata, and upstream import/conversion provenance when present. No genomic coordinates or accession versions are guessed or rewritten.

Details

For a GRanges object, lengths come from its Seqinfo, never from the maximum observed feature endpoint. A GInteractions object uses the same information from its common regions. Only sequence names used by the supplied intervals are returned; a Seqinfo object returns all its entries. Unknown lengths require explicit lengths or corrected source information.

XStringSet and XString inputs use their stored sequence widths. Set names are identifiers; unnamed sequences require explicit ids. Explicit IDs must agree with existing nonempty names, so identifiers and accession versions are never silently rewritten. sequence_unit records "bp", "aa", or "character"; amino-acid widths are not nucleotide coordinates. These non-nucleotide tables remain available for data workflows, but ggchord() rejects them as genomic sequence input. Project amino-acid intervals with build_ggchord_cds() and project_ggchord_features() or project_ggchord_links() before using known nucleotide sequence lengths. Empty sequences are rejected like other zero lengths.

Examples

Code
library(dplyr)
data(seq_data_example)
seqs <- seq_data_example |>
  select(accver, length)
renamed <- seqs |>
  rename(chrom = accver, size = length)
as_ggchord_seq(renamed, mapping = c(accver = "chrom", length = "size"))