The long form of a square pairwise distance over one entity set: one row
per ordered pair of entities, with a dissim value (0 for identical
entities, larger for more different ones).
Usage
pairwise_distances(x, dom_code_namespace = NULL)
tale_distances(x, dom_code_namespace = NULL)
domain_distances(x, dom_code_namespace = NULL)Arguments
- x
A data frame with
id1,id2anddissimcolumns. The function also accepts a similarity: it converts a table carryingsimornorm_arlem_scoreinstead of a distance intodissimand drops the similarity columns, so that only one copy of the quantity remains. It keeps any further column (arlem_score,max_length, or anything else).- dom_code_namespace
Optional scalar string identifying the run whose
dom_codevalues this table is keyed by, seetales_namespace. Relevant fordomain_distances(), whose ids aredom_codes.
Details
tale_distances() and domain_distances() are the
entity-specific flavours: distances between whole TALE arrays, and between
distinct domains, repeats and the two termini alike. For
domain_distances, dissim is the percentage of amino acids
that differ between two domains (see tales_domain_distances);
for tale_distances, it is the array alignment cost between two TALEs
(see tales_tale_distances). The two flavours add no
structure, only meaning: every method is written once on the parent.
See also
Other pairwise distances:
[.pairwise_distances(),
as.matrix.pairwise_distances(),
distances_assert_square(),
distances_restrict(),
is_pairwise_distances(),
rvd_dna_specificity,
tales_assign_domain_codes(),
tales_compare_distal(),
tales_compare_functal(),
tales_domain_distances(),
tales_group_hclust(),
tales_group_kmedoids(),
tales_tale_distances(),
validate_pairwise_distances()
Examples
d <- data.frame(
id1 = c("A1", "A1", "A2", "A2"),
id2 = c("A1", "A2", "A1", "A2"),
dissim = c(0, 35, 35, 0)
)
pairwise_distances(d)
domain_distances(d, dom_code_namespace = "example")
# A similarity is folded into the distance.
similar <- data.frame(id1 = "A1", id2 = "A2", sim = 65)
tale_distances(similar)