#' validates a fasta sequence string
#' @param seqs string containing one or more fasta sequences
#' @return logical, whether the file is a fasta file or NULL if file_path is NULL
#' @import readr
#' @export
#' @examples
#' validateFastaSequences(">Protein ID with spaces \n KDFSHGZWVBSZWHA ADFHDJF\n")
validateFastaSequences <- function(seqs) {
if(is.null(seqs) || seqs==''){
return(TRUE)
}else{
seqs <- paste0(seqs,"\n")
tmp=tempfile()
write_file(seqs, path=tmp)
return(validateFastaFiles(tmp))
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.