Combine multiple sequences
seq_combine(..., sep = "", collapse = NULL)
One or more vectors of sequences (DNA, RNA, AA). They must all be of the same type. Short vectors are recycled.
String to insert between input vectors.
If not NULL
, combine everything with this
string as separator.
A vector of sequences (if collapse is NULL
).
A vector with a single sequence, otherwise.
The strings sep
and collapse
w ill be coerced to
the type of input vectors with a warning if some character have to replaced.
stri_join
from stringi and
str_c
from stringr
for the underlying implementation.
Other string operations:
seq-replace
,
seq_count_pattern()
,
seq_crop_pattern()
,
seq_crop_position()
,
seq_detect_pattern()
,
seq_extract_pattern()
,
seq_extract_position()
,
seq_remove_pattern()
,
seq_remove_position()
,
seq_replace_position()
,
seq_split_kmer()
,
seq_split_pattern()
x <- dna("ACGTTAGTGTAGCCGT", "CTCGAAATGA")
y <- dna("TTTTTTTT", "AAAAAAAAA")
seq_combine(x, y)
#> DNA vector of 2 sequences
#> > ACGTTAGTGTAGCCGTTTTTTTTT
#> > CTCGAAATGAAAAAAAAAA
seq_combine(y, x, sep = "CCCCC")
#> DNA vector of 2 sequences
#> > TTTTTTTTCCCCCACGTTAGTGTAGCCGT
#> > AAAAAAAAACCCCCCTCGAAATGA
seq_combine(y, x, sep = "CCCCC", collapse = "GGGGG")
#> DNA vector of 1 sequences
#> > TTTTTTTTCCCCCACGTTAGTGTAGCCGTGGGGGAAAAAAAAACCCCCCTCGAAATGA