lmvdencolor {LinkageMapView} | R Documentation |
LinkageMapView density color function
Description
lmvdencolor is a helper function which you can use to create a data frame of colors to be used as the sectcoldf input parameter on the lmv.linkage.plot command. The colors will be used to color the linkage group based on the density of position/marker.This function is called with default values when the denmap = TRUE parameter is specified for lmv.linkage.plot and no sectcoldf parameter is found.
Usage
lmvdencolor(df, wsize = 30, bias = 5,
colorin = colorRampPalette(RColorBrewer::brewer.pal(8, "Spectral"))(25))
Arguments
df |
Required, a data frame with the first two columns in this order:
|
wsize |
Optional, default = 30. # of postions in the sliding window for calculating postitions/marker. If the maximum position in any linkage group is >= 1000, the default sliding window size will be adjusted by the same ratio as the number of positions included for each density calculate. |
bias |
Optional, default = 5. a positive number. Higher values give more widely spaced colors at the high end. |
colorin |
Optional, a vector of colors to use where the first value is the color for the lowest density and the last value is the color for the highest density. Default is: rev(colorRampPalette(RColorBrewer::brewer.pal(8, "Spectral"))(25)) |
Value
a data frame that can be used as sectcoldf input on the lmv.linkage.plot function to color the chromosome for a density map.
See Also
Examples
# add a column to a linkage group data frame to specify colors for
# line segments in lmv.linkage.plot using default colors from RColorBrewer
# Spectral palette. Then just plot the returned colors out to see how
# they look.
data(oat)
sectcoldf <- lmvdencolor(oat)
# see colors produced
image(seq_along(oat[,2]), 1, as.matrix(seq_along(oat[,2])),
col=sectcoldf$col, axes=FALSE, xlab="", ylab="")