Learn R Programming

OriGen (version 1.4.3)

ConvertPEDData: Plink PED file conversion

Description

This function converts a Plink PED/MAP file into the data format required for OriGen.

Usage

ConvertPEDData(PlinkFileName,LocationFileName)

Arguments

PlinkFileName
Base name of Plink PED file (i.e. without ".ped" or ".map")
LocationFileName
Space or tab delimited text file with Longitude and Latitude coordinates for each individual listed in the 4th and 5th columns respectively. Note that rows should correspond to the individuals in the Plink File. Also, this file should have a header row.

Value

List with the following components:
DataArray
An array giving the number of major/minor SNPs (defined as the most occuring in the dataset) grouped by sample sites for each SNP. The dimension of this array is [2,SampleSites,NumberSNPs].
SampleCoordinates
This is an array which gives the longitude and latitude of each of the found sample sites. The dimension of this array is [SampleSites,2], where the second dimension represents longitude and latitude respectively.
PlinkFileName
This shows the inputted PlinkFileName with ".ped" attached.
LocationFile
This shows the inputted LocationFileName.
SampleSites
This shows the integer number of sample sites found.
NumberSNPs
This shows the integer number of SNPs found.

References

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

See Also

FitOriGenModel for fitting allele surfaces to the converted data,

PlotAlleleFrequencySurface for a quick way to plot the resulting allele frequency surfaces from FitOriGenModel

ConvertUnknownPEDData for converting a known and unknown PED files (2 separate files) into the format required for OriGen (Note that this is what you want if you want to place unknown individuals back on the map);

Examples

Run this code

#Note that Plink files "10SNPs.ped", "10SNPs.map" and also "Locations.txt" 
#are included in the data folder of the OriGen package with ".txt" appended to the Plink files.
#Please remove ".txt" and navigate to the appropriate location   
#before testing the following commands.
#Note that this was done to allow inclusion of the test data in the package.

## Not run: trials=ConvertPEDData("10SNPs","Locations.txt")
## Not run: str(trials)
MaxGridLength=20
RhoParameter=10
## Not run: trials2=FitOriGenModel(trials$DataArray,trials$SampleCoordinates,
# 	MaxGridLength,RhoParameter)## End(Not run)
## Not run: PlotAlleleFrequencySurface(trials2)

Run the code above in your browser using DataLab