as.character.sq {tidysq}R Documentation

Convert sq object into character vector

Description

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

Usage

## S3 method for class '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 "!".

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.

Value

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

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)


[Package tidysq version 1.1.3 Index]