fade.admixture.source.points: Fades a sample's color

View source: R/space.mix.MCMC.R

fade.admixture.source.pointsR Documentation

Fades a sample's color

Description

This function fades a sample's color in proportion to its admixture proportion. A sample with a smaller admixture proportion is represented by a fainter color. When visualizing SpaceMix's output, it can be helpful to visualize the amount of admixture a sample is drawing by having samples that draw small amounts of admixture show up more faintly in figures.

Usage

fade.admixture.source.points(pop.cols, admix.proportions)

Arguments

pop.cols

This is a vector of colors of length k in which each element gives the color in which the corresponding sample should be plotted.

admix.proportions

This is a vector of length k in which each element is the estimated admixture proportion in the corresponding sample.

Value

This function returns a vector of faded colors, for which the extent of fading is determined by the admixture proportion.

Examples


#generate example admixture proportions
 admix.values <- seq(0.5,0,length.out=100)
# make plotting colors
 admix.cols <- fade.admixture.source.points(rep("red",100),seq(1,0,length.out=100))
plot(admix.values,ylab="admix proportion",pch=19,col=admix.cols)

gbradburd/SpaceMix documentation built on Oct. 19, 2022, 12:43 p.m.