R/GetRandomSeq.R

Defines functions GetRandomSeq

Documented in GetRandomSeq

GetRandomSeq <-
function(seq.len){ 
    ##  Generate a genetic random sequence
        # seq.len: length of the new sequence
    if(!is(seq.len, "numeric")) stop("The input must be numeric \n")
    # Load nucleotide bases
    nt.nms <- DNA_BASES
    return(paste(sample(nt.nms, seq.len, replace=TRUE), 
        collapse=""))
}

Try the QSutils package in your browser

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

QSutils documentation built on Nov. 8, 2020, 7:42 p.m.