Row-binds one or more tales objects into one, reconciling
the invariants that a plain bind_rows would not check:
array_id uniqueness across inputs, the dom_code namespace,
and the group column. A single input is accepted: it goes through
the same reconciliation and re-validation, harmlessly.
Usage
tales_bind(..., on_namespace_mismatch = c("recode", "error"), sanitize = FALSE)Arguments
- ...
One or more
talesobjects (nottales_msa).- on_namespace_mismatch
What to do when the inputs'
dom_codenamespaces (seetales_namespace) disagree."recode"(default) drops the staledom_codecolumn and callstales_assign_domain_codeson the bound result, over the union ofaa_seq;"error"aborts instead, for callers who want that stricter behaviour.- sanitize
Passed to
talesfor the final construction:FALSE,TRUEor"canonical".
Value
A validated tales object.
Details
There is no c() method: base c() can silently drop
attributes when a tales is mixed with another object, and its
signature has no room for on_namespace_mismatch.
tales_msa inputs are refused: alignment_width and
alignment_position are a coordinate system
specific to one alignment run, and binding two runs' matrices would
produce an object that misdescribes what a given column means in each
row. Demote explicitly with as_tales first if that is really
what you want.
group is dropped from the result whenever present on any input: it
is a clustering result over one specific distance matrix and one specific
set of arrays, so two "group 1"s from separate
tales_group_hclust/tales_group_kmedoids calls
are not comparable. Recompute it with
either on the bound result, after re-running tales_compare_distal.
tale_distances/domain_distances are untouched: this function
only binds tales data. A companion distance table from either input
does not describe the bound object; re-run tales_compare_distal
if you need one.
See also
Other tales objects:
[.tales(),
as_tales(),
format.tales(),
format.tales_msa(),
is_tales(),
new_tales(),
print.tales(),
print.tales_msa(),
summary.tales(),
summary.tales_msa(),
tales(),
tales_anchor_codes(),
tales_anomalies(),
tales_assert_complete(),
tales_names(),
tales_namespace(),
tales_requirements(),
validate_tales()
Examples
a <- tales(data.frame(
array_id = "A1", position_in_array = 1:2,
rvd = c("NTERM", "HD")
))
b <- tales(data.frame(
array_id = "A2", position_in_array = 1:2,
rvd = c("NTERM", "NI")
))
tales_bind(a, b)
#> <tales> 2 arrays, 4 parts
#> layers: rvd
#> rvd
#> A1 NTERM HD
#> A2 NTERM NI