ANGSD: Analysis of next generation Sequencing Data

Latest tar.gz version is (0.938/0.939 on github), see Change_log for changes, and download it here.

Major Minor

From angsd
Revision as of 18:29, 7 December 2013 by Thorfinn (talk | contribs)
Jump to navigation Jump to search

We allow the major and minor to be determined from either the counts of nucleotides, based on genotype likelihoods, specified by the ancestral/reference or even force both major minor to specific bases, which can be useful if you compare with HapMap data etc.

Brief Overview

../angsd0.567/angsd -doMajorMinor 
	-> angsd version: 0.567	 build(Dec  7 2013 17:25:57)
	-> Analysis helpbox/synopsis information:
-------------------
analysisMajorMinor.cpp:
	-doMajorMinor	0
	1: Infer major and minor from GL
	2: Infer major and minor from allele counts
	3: use major and minor from bim file (requires -filter afile.bim)
	4: Use reference allele as major (requires -ref)
	5: Use ancestral allele as major (requires -anc)

arguments

-doMajorMinor 1 (major and minor determined from GL)
-doMajorMinor 2 (major and minor determined from counts of nucs)
-doMajorMinor 3 (major and minor determined from filter list)
-doMajorMinor 4 (major is reference (minor from GL))
-doMajorMinor 5 (major is ancestral (minor from GL))

Inferring Major and Minor alleles

The inference method is chosen based on the data input.

From alignment data

-doMajorMinor 2
-doCount 1

If you input sequencing data like the bam format you can choose to infer the major and minor allele by picking the two most frequently observed bases across individuals. This is the approach from here: citation. To use this appraoch choose

From genotype likelihood data

-doMajorMinor 1

From input for either sequencing data like bam files or from genotype likelihood data like glfv3 the major and minor allele can be inferred directly from likelihoods. We use a maximum likelihood approach to choose the major and minor alleles. Details of the method can be found in the theory section of this page and for citation use this publication Skotte2012.

From genotype probability data

-doMajorMinor 3

Currently only genotype probability data in beagle output format is allowed. This format already contains information for the major and minor allele.

Theory

From Genotype Likelihoods

Assuming that the considered site is diallelic, we infer those two alleles using the genotype likelihoods. Let denote the two possible alleles at the diallelic site, then the maximum likelihood estimate of this pair is found using the likelihood function

where is the genotype likelihood. We then assume that the two alleles within an individual are independent and randomly drawn from the set with equal probability, ignoring the fact that the two alleles at a diallelic site are not observed equally frequent. This gives us for all four possible combinations of . Therefore we estimate the two possible alleles at the diallelic site by

To infer which of these two alleles is the minor allele, we estimate the allele frequencies (only one iteration of the EM algorithm is needed if the starting point is frequencies of 0.5).