Coerces sequences from an sq object to character vector of sequences.

# S3 method for sq
as.character(x, ..., NA_letter = getOption("tidysq_NA_letter"))

Arguments

x

[sq]
An object this function is applied to.

...

further arguments to be passed from or to other methods.

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 "!".

Value

A character vector where each element represents the content of respective sequence in input sq object.

Details

This method for sq class allows converting sequences from the sq object into a character vector of length equal to the length of input. Each element of resulting vector is a separate sequence. All attributes of the input sq are lost during the conversion to character vector.

See also

Functions from output module: as.matrix.sq(), as.sq(), export_sq(), write_fasta()

Examples

# Creating an object to work on:
sq_dna <- sq(c("CTGAATGCAGTACCGTAAT", "ATGCCGTAAATGCCAT", "CAGACCANNNATAG"),
             alphabet = "dna_ext")

# Converting sq object into a character vector:
as.character(sq_dna)
#> [1] "CTGAATGCAGTACCGTAAT" "ATGCCGTAAATGCCAT"    "CAGACCANNNATAG"