Skip to contents

Step 2 of tales_compare_distal(). Aligns every distinct domain sequence against every other and returns their pairwise dissimilarity.

Usage

tales_domain_distances(
  x,
  aln_method = "DECIPHER",
  ncores = 1,
  conda_bin = "auto"
)

Arguments

x

A tales object carrying dom_code, as returned by tales_assign_domain_codes().

aln_method

One of "DECIPHER" (the default), "Biostrings" or "mmseq2". "mmseq2" runs in the conda environment.

ncores

Number of cores for the pairwise alignment.

conda_bin

Passed to reticulate, for aln_method = "mmseq2".

Value

A domain_distances object, stamped with x's namespace.

Details

This is the expensive step, and the one worth having on its own: the domain-level distances answer questions about domain diversity without any array-level alignment.

Distances are between distinct domains, keyed by dom_code, so the cost goes with the number of distinct sequences rather than the number of parts. See summary() for that ratio on a given object.

dissim follows DisTAL's definition: the percentage of amino acids that change between two domains, normalised by the longer one, with residues one domain lacks counted as changes. A 20-residue half-repeat that is an exact prefix of a 34-residue repeat is therefore 14/34, about 41 percent, from it. All three backends follow this definition. They still differ slightly pair by pair: "DECIPHER" measures distances inside one multiple alignment of all domains, the other two align each pair separately, and "Biostrings" also charges a cost for opening an internal gap.

Examples

x <- tales_from_telltales(system.file("extdata", "tellTaleExampleOutput",
                                      package = "tantale"))
xa <- tales_assign_domain_codes(x)
tales_domain_distances(xa)
#> Computing a distance matrix between TALE parts amino acid sequences using:
#> DECIPHER