Skip to contents

Renders each array as a separated string of its dom_codes in part order, where each distinct domain sequence is one "residue". tales_align() and tales_tale_distances() work on arrays in this form.

Usage

tales_coded_strings(x, sep = " ", repeats_only = FALSE)

Arguments

x

A tales object carrying a dom_code column.

sep

Separator between codes. Defaults to " "; see Details.

repeats_only

Drop the terminus parts, keeping only repeats. FALSE by default; see Details. Needs a domain_type column.

Value

A Biostrings::BStringSet, named by array_id.

Details

This is the sibling of tales_rvd_strings() and takes the same two arguments, but both defaults differ, because the two projections feed different consumers:

tales_rvd_strings()tales_coded_strings()
sep"-", the AnnoTALE convention" ", what MAFFT --text splits on
filterrepeats_only = TRUErepeats_only = FALSE

The separator is free to choose here in a way it is not for RVDs: a dom_code is a bare integer rendered as text, so "1 2 3" and "1-2-3" are equally unambiguous. It defaults to a space because that is what MAFFT's text mode expects.

The termini are kept by default, where tales_rvd_strings() drops them. Target prediction concerns the repeat domain only, so dropping them there is right; alignment is the consumer here, and the two termini are the most reliable anchors an alignment of TALE arrays has. Set repeats_only = TRUE to compare bare repeat arrays.

See also

Examples

x <- tales_from_telltales(system.file("extdata", "tellTaleExampleOutput",
                                      package = "tantale"))
xa <- tales_assign_domain_codes(x)
tales_coded_strings(xa)[1]
#> BStringSet object of length 1:
#>     width seq                                               names               
#> [1]    77 43 19 12 19 24 32 2 14 ...33 8 16 3 12 7 29 11 47 ROI_00001
tales_coded_strings(xa, sep = "-", repeats_only = TRUE)[1]
#> BStringSet object of length 1:
#>     width seq                                               names               
#> [1]    71 19-12-19-24-32-2-14-1-2...19-33-8-16-3-12-7-29-11 ROI_00001