Combine multiple sequences

seq_combine(..., sep = "", collapse = NULL)

Arguments

...

One or more vectors of sequences (DNA, RNA, AA). They must all be of the same type. Short vectors are recycled.

sep

String to insert between input vectors.

collapse

If not NULL, combine everything with this string as separator.

Value

A vector of sequences (if collapse is NULL). A vector with a single sequence, otherwise.

Details

The strings sep and collapsew ill be coerced to the type of input vectors with a warning if some character have to replaced.

See also

Examples


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