Learn R Programming

OriGen (version 1.3.1)

ConvertUnknownPEDData: Plink PED file conversion for known and unknown data

Description

This function converts two Plink PED/MAP files (one for the known samples and one with unknown locations) into the data format required for OriGen.

Usage

ConvertUnknownPEDData(PlinkFileName,LocationFileName,PlinkUnknownFileName)

Arguments

PlinkFileName
Base name of Plink PED file (i.e. without ".ped" or ".map") containing the individuals with known locations.
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.
PlinkUnknownFileName
Base name of Plink PED file (i.e. without ".ped" or ".map") containing the individuals with unknown locations.

Value

  • List with the following components:
  • DataArrayAn 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].
  • SampleCoordinatesThis 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.
  • PlinkFileNameThis shows the inputted PlinkFileName with ".ped" attached.
  • LocationFileThis shows the inputted LocationFileName.
  • SampleSitesThis shows the integer number of sample sites found.
  • NumberSNPsThis shows the integer number of SNPs found.
  • UnknownPEDFileThis shows the inputted PED file for the unknown individuals.
  • NumberUnknownsThis is an integer value showing the number of unknowns found in the UnknownPEDFile.
  • UnknownDataAn array showing the unknown individuals genetic data. The dimension of this array is [NumberUnknowns,NumberSNPs].
  • MembershipThis is an integer valued vector showing the group number of each member of the inputted known group. The dimension of this array is [NumberKnown].
  • NumberKnownThis is an integer value showing the number of known found in the PlinkFileName.

References

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

See Also

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,;

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.

trials3=ConvertUnknownPEDData("10SNPs","Locations.txt",""10SNPs"")
str(trials3)
MaxGridLength=30
RhoParameter=10
trials4=FitOriGenModelFindUnknowns(trials3$DataArray,trials3$SampleCoordinates,
	trials3$UnknownData[1:2,],MaxGridLength,RhoParameter)
PlotUnknownHeatMap(trials4,UnknownNumber=1,MaskWater=TRUE)

Run the code above in your browser using DataLab