R/CUB.R

Defines functions CUB

Documented in CUB

CUB <-
function(file=NULL, sequence=NULL, method="ENC")
{
	stopifnot(
		!(is.null(file) && is.null(sequence)),
		method[1] %in% c("ENC"))

	if (!is.null(file)) {
		if (!requireNamespace("seqinr", quietly=TRUE)) {
			stop("Reading FASTA files require package seqinr")
		}		
		sequence <- seqinr::read.fasta(file)
	}
	sequence <- .checkseq(sequence, gene.name=if(is.null(file)) "" else file)
	
	if (method[1]=="ENC") {
		return(sapply(sequence, .ENC))
	}
}

Try the vhica package in your browser

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

vhica documentation built on March 31, 2023, 10:09 p.m.