Validate character strings before sequence construction.
validate_seq(x, alphabet, invalid_replacement, type = "DNA")
a character vector.
a character vector defining the sequence alphabet;
a character to replace non valid characters
type of sequence ("DNA", "RNA", "AA"). It is only used to provide more informative warning messages.
A character vector.
Validation steps:
Check that x
is a character vector, fails if not.
Force alpha characters to uppercase
Delete blank characters (spaces and tabs)
Delete line breaks
Converts . (dots) to - (as both can represent a gap)
Replace invalid characters with N/X (with a warning).