View source: R/space.mix.MCMC.R
fade.admixture.source.points | R Documentation |
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.
fade.admixture.source.points(pop.cols, admix.proportions)
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. |
This function returns a vector of faded colors, for which the extent of fading is determined by the admixture proportion.
#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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.