Skip to contents
Chapters and reference

Complete canonical API text; task articles explain the workflows. Usage guide

Reads local whitespace-separated pairs (two IDs and an optional opaque score), named groups (group ID followed by members), or unnamed groups (members only). Schemas are explicit; headers are not guessed. Blank lines and whole-line # comments are skipped. IDs, native score strings, physical lines, member order, duplicates and original fields remain traceable. Numeric-looking IDs remain strings. Group indices are local to each file; unnamed groups have no invented biological group ID. Membership never generates pairwise links or asserts orthology.

Usage

R · Example code
read_feature_relations(
  file = NULL,
  files = NULL,
  format = c("pairs", "named_groups", "groups"),
  feature_data = NULL,
  unmatched = c("error", "report"),
  source_file = FALSE
)

Arguments

file

Optional local paths or patterns, read before files.

files

Optional additional local paths or patterns.

format

Explicit schema: "pairs" (default), "named_groups", or "groups".

feature_data

Optional data frame with unique character feature_id, character accver and numeric start/end in declared source coordinates. Original columns remain in report$feature_data; optional strand is retained.

unmatched

"error" (default) rejects IDs absent from supplied feature_data; "report" retains incomplete rows with mapping flags and reports each missing ID. Without feature_data all rows stay unplaced.

source_file

Add .source_file to pairs, membership and mapped links.

Value

A list with pairs, membership, ribbon_data (only complete mapped original pairs), and report. Group input returns no pair links. Mapped members carry source intervals in membership. report retains raw files, original fields, missing IDs, unplaced pairs and supplied feature_data. No seq_data is generated from annotation endpoints. File-local record indices must be interpreted with .source_input, not as biological IDs.

Details

Optional feature_data matches unique feature_id values exactly, without editing case, prefixes or versions or guessing gene/CDS parentage. Supply ascending 1-based-inclusive contiguous source intervals, with optional strand (+, - or .). Negative feature strand stays annotation metadata: paired anchor endpoints remain ascending and direction stays missing. These are feature relationships, not basewise alignments. Segmented features require an explicit contiguous anchor table rather than silently using their bounding spans. No full sequence length, identity, support, alignment direction or source characters are inferred.

Examples

R · Example code
path <- system.file("extdata", "plant-feature-groups.txt", package = "ggchord")
relations <- read_feature_relations(path, format = "named_groups")
relations$membership[c("group_id", "feature_id")]
#>    group_id feature_id
#> 1      1166  AT1G50920
#> 2      1166  AT1G10300
#> 3      1166  AT1G80770
#> 4      1166  AT3G23860
#> 5      1167  AT1G65510
#> 6      1167  AT1G65490
#> 7      1167  AT1G65486
#> 8      1167  AT1G65500
#> 9      1168  AT5G16930
#> 10     1168  AT2G18330
#> 11     1168  AT3G03060
#> 12     1168  AT4G36580

Search documentation

↑ ↓ select · Enter open · Esc close; or browse by task. API and functions