R/msaCheckNames.R

Defines functions msaCheckNames

Documented in msaCheckNames

msaCheckNames <- function(x, replacement=" ", verbose=TRUE)
{
    if (!is(x, "MultipleAlignment"))
        stop("x must be a multiple alignment object")

    out <- x

    pattern <- "[^a-zA-Z0-9,;:.?!/\\-\\(\\)\\'\" ]"

    if (length(grep(pattern, rownames(x), perl=TRUE)) > 0)
    {
        if (verbose)
            message("sequence names contain invalid characters")

        rownames(out) <- gsub(pattern, replacement, rownames(x),
                              perl=TRUE)
    }

    invisible(out)
}

Try the msa package in your browser

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

msa documentation built on Nov. 8, 2020, 5:41 p.m.