#' A function to subset fasta sequence from EMBOSS raw tsv.
#'
#' @param Start A numeric vector with Start positions
#' @param End A numeric vector with End positions
#' @param seqs A character vector containing fasta sequences
#'
#' @return It returns a character vector containing with the extracted sequence.
#' @export
extractEMBOSS_StartEnd <- function(Start, End, seqs){
## Check arguments
if(!is.character(seqs))
stop("'seqs' should be character")
if(!is.character(Start))
stop("'Start' should be numeric")
if(!is.character(End))
stop("'End' should be numeric")
if(list(Start, End, seqs) %>%
lengths() %>% unique() %>%
length()!= 1)
stop("Start, End and seqs should have the same length")
purrr::pmap_chr(list(Start, End, seqs),
function(n_start, n_end, seq){
seq %>%
seqinr::s2c() %>%
magrittr::extract(n_start:n_end) %>%
seqinr::c2s()
})
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.