Description Usage Arguments Value Author(s) References See Also Examples
View source: R/OriGen-internal.R
This function plots a probability heat map surface outputted by FitOriGenModelFindUnknowns.
1 | PlotUnknownHeatMap(HeatMapOutput,UnknownNumber=1,MaskWater=TRUE)
|
HeatMapOutput |
The output of |
UnknownNumber |
Integer indicating the unknown individual heat map number to plot, "ALL" which would plot best locations for all samples, or "GROUP" which plots a heat map assuming the entire group came from a single location. |
MaskWater |
Logical value that if true removes water from the plotted regions. |
This outputs a plot of the probability heat map for a particular unknown individual.
John Michael Ranola, John Novembre, and Kenneth Lange
Ranola J, Novembre J, Lange K (2014) Fast Spatial Ancestry via Flexible Allele Frequency Surfaces. Bioinformatics, in press.
ConvertUnknownPEDData for converting two Plink PED files (known and unknown)into a format appropriate for analysis,
FitOriGenModelFindUnknowns for fitting allele surfaces to the converted data and finding the locations of the given unknown individuals,
PlotUnknownHeatMap for a quick way to plot the resulting unknown heat map surfaces from FitOriGenModelFindUnknowns,
FitAdmixedModelFindUnknowns for fitting allele surfaces to the converted data and finding the locations of the given unknown individuals who may be admixed,
PlotAdmixedSurface for a quick way to plot the resulting admixture surfaces from FitAdmixedFindUnknowns,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | #this example not run because it takes slightly longer than 5 secs
#note - type example(FunctionName, run.dontrun=TRUE) to run the example where FunctionName is
#the name of the function
## Not run:
#Data generation
SampleSites=10
NumberSNPs=5
TestData=array(sample(2*(1:30),2*SampleSites*NumberSNPs,replace=TRUE),
dim=c(2,SampleSites,NumberSNPs))
#Europe is about -9 to 38 and 34 to 60
TestCoordinates=array(0,dim=c(SampleSites,2))
TestCoordinates[,1]=runif(SampleSites,-9,38)
TestCoordinates[,2]=runif(SampleSites,34,60)
#This code simulates the number of major alleles the unknown individuals have.
NumberUnknowns=2
TestUnknowns=array(sample(0:2,NumberUnknowns*NumberSNPs,replace=TRUE),
dim=c(NumberUnknowns,NumberSNPs))
#Fitting the model
#MaxGridLength is the maximum number of boxes allowed to span the region in either direction
#RhoParameter is a tuning constant
trials4=FitOriGenModelFindUnknowns(TestData,TestCoordinates,TestUnknowns,
MaxGridLength=20,RhoParameter=10)
str(trials4)
#Plotting the unknown heat map
PlotUnknownHeatMap(trials4,UnknownNumber=1,MaskWater=TRUE)
# PlotUnknownHeatMap(trials4,UnknownNumber="ALL",MaskWater=TRUE)
# PlotUnknownHeatMap(trials4,UnknownNumber="GROUP",MaskWater=TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.