Pcontam: Compute likelihoods for populations of origin

Description Usage Arguments Value

Description

Compute likelihoods for populations of origin

Usage

1
Pcontam(snp_zeroes, snp_ones, genos, lambda)

Arguments

snp_zeroes

Matrix of counts of the "zero" allele at L SNPs in P populations. This is an L x P integer matrix where L is the number of SNP loci and P is the number of populations in the baseline. The observed number of 0 alleles at locus j in population p is snp_zeroes[j,p]

snp_ones

Same as above, but for the 1 allele at each SNP.

genos

Matrix of the genotypes of N individuals at each of the L loci. Genotypes are represented as the number of "1" alleles. This is an L x N integer matrix. The genotype of the ith individual at the locus j is genos(j,i).

lambda

The parameter of the beta distribution for the frequency of the "1" allele.

Value

Returns a P*P x N numeric matrix which contains the the probabilities that contaminated individuals originated from certain combintations of two populations. The probability that the ith individual's contamination originated from population p1 and p2 is ouput(N*(p1-1) + p2,i) + output(N*(p2-1) + p1,i) if p1 and p2 are different populations and output(N*(p1-1) + p1,i) if p1 and p2 are the same population.


eriqande/SNPcontam documentation built on May 16, 2019, 8:44 a.m.