paste: Paste sequences in string-like fashion

View source: R/paste.R

pasteR Documentation

Paste sequences in string-like fashion

Description

Joins multiple vectors of sequences into one vector.

Usage

## S3 method for class 'sq'
paste(..., NA_letter = getOption("tidysq_NA_letter"))

Arguments

...

[sq]
Sequences to paste together.

NA_letter

[character(1)]
A string that is used to interpret and display NA value in the context of sq class. Default value equals to "!".

Details

paste() joins sequences in the same way as it does with strings. All sq objects must have the same length, that is, contain the same number of sequences. An exception is made for scalar (length 1) sq objects, which are replicated instead.

Value

sq object of common type of input objects. Common type is determined in the same process as for c.sq().

See Also

Functions that affect order of elements: bite(), collapse(), reverse()

Examples

# Creating objects to work on:
sq_dna_1 <- sq(c("TTCAGGGCTAG", "CGATTGC", "CAGTTTA"),
               alphabet = "dna_bsc")
sq_dna_2 <- sq(c("ATCTTGAAG", "CATATGCGCTA", "ACGTGTCGA"),
               alphabet = "dna_bsc")
sq_unt_1 <- sq(c("ATGCAGGA?", "TGACGAGCTTA", "", "TIAALGNIIYRAIE"))
sq_unt_2 <- sq(c("OVNU!!OK!!J", "GOK!MI!N!BB!", "DPOFIN!!", "??!?"))

# Pasting sequences:
collapse(sq_dna_1, sq_dna_2)
collapse(sq_unt_1, sq_unt_2)
collapse(sq_dna_2, sq_unt_2, sq_dna_1)


michbur/tidysq documentation built on April 1, 2022, 5:18 p.m.