R/cScale.R

Defines functions cScale

Documented in cScale

# cScale.R
# Used to calculate scaling on the geneplots
# Uses the vector of chromosome lengths and returns a vector
# of scales.

cScale <- function(points, cLengths, method=c("max","relative"),
                   chrom) {
# Passed points - the number of points to scale the chromosomes too
# and cLengths - a vector of chromosome lengths.

    method <- match.arg(method)

    if (method == "max") {
            cScales <- points / cLengths[chrom];
    }
    else {
        cScales <- points / max(cLengths)
    }

    return(cScales);
}

Try the geneplotter package in your browser

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

geneplotter documentation built on Nov. 8, 2020, 7:13 p.m.