find_invalid_letters {tidysq} | R Documentation |
Find elements which are not suitable for specified type.
Description
Finds elements in given sequence not contained in amino acid or nucleotide alphabet.
Usage
find_invalid_letters(x, dest_type, ...)
## S3 method for class 'sq'
find_invalid_letters(
x,
dest_type,
...,
NA_letter = getOption("tidysq_NA_letter")
)
Arguments
x |
[ |
dest_type |
[ |
... |
further arguments to be passed from or to other methods. |
NA_letter |
[ |
Details
Amino acid, DNA and RNA standard alphabets have predefined letters. This function allows the user to check which letters from input sequences are not contained in selected one of these alphabets.
Returned list contains a character vector for each input sequence. Each element of a vector is a letter that appear in corresponding sequence and not in the target alphabet.
You can check which letters are valid for specified type in
alphabet
documentation.
Value
A list of mismatched elements for every sequence from
sq
object.
See Also
alphabet()
Functions that manipulate type of sequences:
is.sq()
,
sq_type()
,
substitute_letters()
,
typify()
Examples
# Creating objects to work on:
sq_unt <- sq(c("ACGPOIUATTAGACG","GGATFGHA"), alphabet = "unt")
sq_ami <- sq(c("QWERTYUIZXCVBNM","LKJHGFDSAZXCVBN"), alphabet = "ami_ext")
# Mismatched elements might be from basic type:
find_invalid_letters(sq_ami, "ami_bsc")
# But also from type completely unrelated to the current one:
find_invalid_letters(sq_unt, "dna_ext")