Program BACH (BAyesian Context-based Haplotyping) with source code can be downloaded here. It is available under GPL license.
First, create the folder where bach should be installed and move to it, e.g.
BACH requires the Java runtime environment to be installed. It can be downloaded from www.java.com.
The input "genotypes.txt" are the input genotypes. These are given in the same format as in HIT (see HIT's documentation). Example inputs could look like example1 or example2.
The haplotypes are printed to the screen in the same format as the genotypes are given. By adding ">haplotypes.txt" to the command, the resuls are redirected to file "haplotypes.txt" .
Parameters input and output are as in the basic usage. Parameter D defines the maximum context length (default is 40).
The prior parameter defines the prior for the emission parameters in the variable order Markov chain. If this parameter x is positive (for example 0.5) Beta(x, x) prior is used, otherwise (default) ML-prior is used (see [1]).
The iterations parameter defines the number of runs (default 10) performed. In each run two sets of haplotypes with maximal posterior probability are found. The first set is found by reading input genotypes in the ascending physical order and the second set by reading input genotypes in the reverse order. The output is a centroid of all found haplotypes.
The branching parameter defines the probability of branching in a context tree, which is used to present a variable order Markov chain. This parameter fixes the prior over all context trees by giving an independent probability of spliting or stopping at each node of this tree.