is_empty_sq | R Documentation |
Test an sq
object for presence of
empty sequences.
is_empty_sq(x) ## S3 method for class 'sq' is_empty_sq(x)
x |
[ |
This function allows identification of empty sequences (that have
length 0) represented by the NULL sq
values in the sq object. It
returns a logical value for every element of the sq
object -
TRUE
if its value is NULL sq
and FALSE
otherwise.
NULL sq
values may be introduced as a result of
remove_ambiguous
and remove_na
functions. The
former replaces sequences containing ambiguous elements with NULL sq
values, whereas the latter replaces sequences with NA
values with
NULL sq
.
A logical vector of the same length as input sq
, indicating
whether elements are empty sequences (of length 0).
sq class
Functions that clean sequences:
remove_ambiguous()
,
remove_na()
# Creating an object to work on: sq_dna_ext <- sq(c("ACGATTAGACG", "", "GACGANTCCAGNTAC"), alphabet = "dna_ext") # Testing for presence of empty sequences: is_empty_sq(sq_dna_ext) # Testing for presence of empty sequences after cleaning - sequence # containing ambiguous elements is replaced by NULL sq: sq_dna_bsc <- remove_ambiguous(sq_dna_ext) is_empty_sq(sq_dna_bsc) # Testing for presence of empty sequences after using bite and removing NA. # Extracting letters from first to fifteenth - NA introduced: bitten_sq <- bite(sq_dna_ext, 1:15) # Removing NA: rm_bitten_sq <- remove_na(bitten_sq) # Testing for presence of empty sequences: is_empty_sq(rm_bitten_sq)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.