Learn R Programming

OriGen (version 1.4.3)

PlotAlleleFrequencySurfaceOld: Plots an OriGen fitted allele frequency surface

Description

This function plots an allele frequency surface outputted by FitOriGenModel.

Usage

PlotAlleleFrequencySurfaceOld(AlleleSurfaceOutput,SNPNumber=1,MaskWater=TRUE)

Arguments

AlleleSurfaceOutput
The output of FitOriGenModel
SNPNumber
Integer indicating the SNP number to plot.
MaskWater
Logical value that if true removes water from the plotted regions.

Value

  • This outputs a plot of the allele frequency surface on a map.

References

Ranola J, Novembre J, Lange K (2014) Fast Spatial Ancestry via Flexible Allele Frequency Surfaces. Bioinformatics, in press.

See Also

ConvertPEDData for converting Plink PED files into a format appropriate for analysis,

FitOriGenModel for fitting allele surfaces to the converted data,

PlotAlleleFrequencySurfaceOld for a quick way to plot the resulting allele frequency surfaces from FitOriGenModel,;

Examples

Run this code
#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

#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)

#Fitting the model
#MaxGridLength is the maximum number of boxes allowed to span the region in either direction
#RhoParameter is a tuning constant
trials2=FitOriGenModel(TestData,TestCoordinates,MaxGridLength=20,RhoParameter=10)
str(trials2)

#Plotting the model
PlotAlleleFrequencySurfaceOld(trials2)

Run the code above in your browser using DataLab