Skip to contents
0.16.6 documentation

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

Site guide · find your task

Keeps the ribbon rows that satisfy all requested criteria and optionally sorts them. The returned data frame keeps every extra column and the original column order; the original row numbers are attached as the source_rows attribute. Each non-NULL numeric threshold must be one finite number. Columns used by a numeric criterion must be numeric; missing values fail that criterion.

Usage

Code
filter_ggchord_ribbons(
  ribbon_data,
  seq_ids = NULL,
  min_pident = NULL,
  max_pident = NULL,
  min_length = NULL,
  max_evalue = NULL,
  min_bitscore = NULL,
  min_query_coverage = NULL,
  min_subject_coverage = NULL,
  keep_pairs = NULL,
  drop_self_links = TRUE,
  sort_by = NULL
)

Arguments

ribbon_data

data.frame with at least qaccver and saccver columns (normally the full ribbon_data format).

seq_ids

Optional character vector. Keep only rows where both the query and the subject are in seq_ids.

min_pident, max_pident

Optional numeric. Lower/upper bounds on pident.

min_length

Optional numeric. Lower bound on length.

max_evalue

Optional numeric. Upper bound on evalue (requires an evalue column).

min_bitscore

Optional numeric. Lower bound on bitscore (requires a bitscore column).

min_query_coverage

Optional numeric (0-100). Lower bound on the query coverage. Uses the qcovs column when present; otherwise computed from qlen and the query interval (requires qlen).

min_subject_coverage

Optional numeric (0-100). Lower bound on the subject coverage, computed from slen and the subject interval (requires an slen column).

keep_pairs

Optional data.frame/list/matrix describing an undirected set of sequence pairs. A data.frame or matrix with the first two columns used as query/subject IDs, or a list of length-2 character vectors. A row is kept when its query/subject pair matches any pair in either direction.

Logical, default TRUE. Remove rows where qaccver == saccver.

sort_by

Optional character vector of column names. Prefix a name with "-" or "desc:" for descending order (e.g. c("pident", "-evalue")).

Value

A list with data (the filtered data frame, with source_rows attribute) and report (n_input/n_kept/n_removed, removed_by_reason, removed_rows and kept_rows).

Examples

Code
library(dplyr)
data(ribbon_data_example)
links <- ribbon_data_example |>
  select(qaccver, saccver, qstart, qend, sstart, send, pident, length)
out <- filter_ggchord_ribbons(links, min_pident = 95, min_length = 500)
out$report