Learn R Programming

OriGen (version 1.4.3)

RankSNPsLRT: Rank the SNPs based on the likelihood ratio test.

Description

This function ranks the SNPs based on the likelihood ratio test comparing the data grouped into the different sample sites as inputted vs one large sample including all of the sites. To convert the data see ConvertPEDData.

Usage

RankSNPsLRT(DataArray)

Arguments

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].

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].
  • SampleSitesThis shows the integer number of sample sites found.
  • NumberSNPsThis shows the integer number of SNPs found.
  • RankingsAn integer valued vector giving the LRT based ranking of each SNP. This can be used to reduce the number of SNPs to use for assignment if analysis takes too long.
  • LRTThis is a real valued array giving the Likelihood Ratio test statistic and the informativeness for assignment(Rosenberg) for each SNP. The dimension of this array is [2,NumberSNPs].

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,

Examples

Run this code
#Data generation
SampleSites=25
NumberSNPs=10
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))

#Rank the SNPs
trials7=RankSNPsLRT(TestData)
trials7

Run the code above in your browser using DataLab