sq_type: Get type of an sq object

View source: R/util-type.R

sq_typeR Documentation

Get type of an sq object

Description

Returns type of sequences/alphabet contained in sq object.

Usage

sq_type(x, ...)

## S3 method for class 'sq'
sq_type(x, ...)

sq_type(x) <- value

## S3 replacement method for class 'sq'
sq_type(x) <- value

Arguments

x

[sq]
An object this function is applied to.

...

further arguments to be passed from or to other methods.

value

[character(1)]
The name of destination type - any valid sq type.

Details

Types returned by this function can be passed as argument to functions like random_sq and find_invalid_letters.

Value

A string, one of: "ami_bsc", "ami_ext", "dna_bsc", "dna_ext", "rna_bsc", "rna_ext", "unt" or "atp".

See Also

sq class

Functions that manipulate type of sequences: find_invalid_letters(), is.sq(), substitute_letters(), typify()

Examples

# Creating objects to work on:
sq_ami <- sq(c("MIAANYTWIL","TIAALGNIIYRAIE", "NYERTGHLI", "MAYXXXIALN"),
             alphabet = "ami_ext")
sq_dna <- sq(c("ATGCAGGA", "GACCGAACGA", "TGACGAGCTTA", "ACTTTAGC"),
             alphabet = "dna_bsc")

# Extracting type of sq objects:
sq_type(sq_ami)
sq_type(sq_dna)

# Classes are tightly related to these types:
class(sq_ami)[1]
class(sq_dna)[1]


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