Swap query and subject columns in a table read with read_feats()
or
read_links()
, for example, from blast searches. Swaps columns with
name/name2, such as 'seq_id/seq_id2', 'start/start2', ...
Examples
feats <- tibble::tribble(
~seq_id, ~seq_id2, ~start, ~end, ~strand, ~start2, ~end2, ~evalue,
"A", "B", 100, 200, "+", 10000, 10200, 1e-5
)
# make B the query
swap_query(feats)
#> Swapping query/subject-associated columns
#> • seq_id start end
#> • seq_id2 start2 end2
#> # A tibble: 1 × 8
#> seq_id seq_id2 start end strand start2 end2 evalue
#> <chr> <chr> <dbl> <dbl> <chr> <dbl> <dbl> <dbl>
#> 1 B A 10000 10200 + 100 200 0.00001