| LocalPlot | R Documentation |
This function generates local admixture plot
LocalPlot(Ancestry, GeneticMap, DisplayNAs = FALSE)
Ancestry |
List of local ancestry dosages for an individual of size |
GeneticMap |
Dataframe with three columns: |
DisplayNAs |
Should missing data be displayed as gaps (FALSE by default) |
The function LocalPlot() based on ggplot2::ggplot() performs local
admixture plot using local ancestry dosage estimated from the AdmixLocal()
function and a genetic map.
The plot displays local ancestry dosages for one individual, with one facet for each of the chromosomes. The x-axis represents the genetic distance and the y-axis represents ancestry dosages, ranging from 0 to the ploidy level of the individual.
When the individual has missing genotypic data as compared to the genetic map,
the gaps can be displayed as blanks by setting DisplayNAs=TRUE
A local admixture plot as a ggplot object
SimulatePop() to simulate a polyploid admixed population.
AdmixGlobal() to perform global (genome-wide) admixture inference.
AdmixLocal() to perform local admixture inference.
## Simulate Simulate a polyploid admixed population
DataSim <- SimulatePop(K=3L, N=10L, P=6L, M=50L, C=5L, L=10L, Seed=123, NbThreads=1)
## Perform global admixture inference
ResAdmixGlobal <- AdmixGlobal(Geno=DataSim$Geno, K=3, Verbose=FALSE, NbThreads=1)
## Perform local admixture inference for one individual
ResAdmixLocal <- AdmixLocal(Geno=DataSim$Geno, ResAdmixGlobal, "Ind4", 6L,
DataSim$GeneticMap, Verbose=FALSE, NbThreads=1)
## Local admixture barplot
LocalPlot(ResAdmixLocal$Posterior, DataSim$GeneticMap)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.