Checks if object is an sq object without specifying type or if it is an sq object with specific type.

is.sq(x)

is.sq_dna_bsc(x)

is.sq_dna_ext(x)

is.sq_dna(x)

is.sq_rna_bsc(x)

is.sq_rna_ext(x)

is.sq_rna(x)

is.sq_ami_bsc(x)

is.sq_ami_ext(x)

is.sq_ami(x)

is.sq_unt(x)

is.sq_atp(x)

Arguments

x

[sq]
An object this function is applied to.

Value

A logical value - TRUE if x has specified type, FALSE otherwise.

Details

These functions are mostly simply calls to class checks. There are also grouped checks, i.e. is.sq_dna, is.sq_rna and is.sq_ami. These check for sq type regardless of if the type is basic or extended.

See also

Functions that manipulate type of sequences: find_invalid_letters(), sq_type(), substitute_letters(), typify()

Functions from utility module: ==.sq(), get_sq_lengths(), sqconcatenate, sqextract

Examples

# Creating objects to work on:
sq_dna <- sq(c("GGCAT", "TATC-A", "TGA"), alphabet = "dna_bsc")
sq_rna <- sq(c("CGAUUACG", "UUCUAGA", "UUCA"), alphabet = "rna_bsc")
sq_ami <- sq(c("CVMPQGQQ", "AHLC--PPQ"), alphabet = "ami_ext")
sq_unt <- sq("BAHHAJJ&HAN&JD&", alphabet = "unt")
sq_atp <- sq(c("mALPVQAmAmA", "mAmAPQ"), alphabet = c("mA", LETTERS))

# What is considered sq:
is.sq(sq_dna)
#> [1] TRUE
is.sq(sq_rna)
#> [1] TRUE
is.sq(sq_ami)
#> [1] TRUE
is.sq(sq_unt)
#> [1] TRUE
is.sq(sq_atp)
#> [1] TRUE

# What is not:
is.sq(c(1,2,3))
#> [1] FALSE
is.sq(LETTERS)
#> [1] FALSE
is.sq(TRUE)
#> [1] FALSE
is.sq(NULL)
#> [1] FALSE

# Checking for exact class:
is.sq_dna_bsc(sq_dna)
#> [1] TRUE
is.sq_dna_ext(sq_rna)
#> [1] FALSE
is.sq_rna_bsc(sq_ami)
#> [1] FALSE
is.sq_rna_ext(sq_rna)
#> [1] FALSE
is.sq_ami_bsc(sq_ami)
#> [1] FALSE
is.sq_ami_ext(sq_atp)
#> [1] FALSE
is.sq_atp(sq_atp)
#> [1] TRUE
is.sq_unt(sq_unt)
#> [1] TRUE

# Checking for generalized type:
is.sq_dna(sq_atp)
#> [1] FALSE
is.sq_rna(sq_rna)
#> [1] TRUE
is.sq_ami(sq_ami)
#> [1] TRUE