R/revComp.R

Defines functions revComp

# Revserse complement a vector of character strings (ATCG)
revComp <- function(seq) {
	out <- character(length(seq))
	seq <- strsplit(seq, split="")
	dic <- c("A"="T", "C"="G", "G"="C", "T"="A")
	for(i in 1:length(seq)) out[i] <- paste(dic[ rev(seq[[i]]) ], collapse="")
	return(out)
}

Try the FSAtools package in your browser

Any scripts or data that you put into this service are public.

FSAtools documentation built on Aug. 19, 2023, 1:06 a.m.