index

Index a set of haplotypes specified as a .hap file.

The index command creates a sorted .hap.gz and a .hap.gz.tbi index file from a .hap (or .hap.gz) file.

By default, the index command will also sort your haplotypes, since this is a prerequisite for indexing.

Usage

haptools index \
--sort \
--output PATH \
--verbosity [CRITICAL|ERROR|WARNING|INFO|DEBUG|NOTSET] \
HAPLOTYPES

Examples

haptools index tests/data/basic.hap

You may also specify a custom output path for the compressed file to be written to.

haptools index --output tests/data/sorted.basic.hap.gz tests/data/basic.hap

You can use the --no-sort flag to skip the sorting step if your file is already sorted.

haptools index --no-sort --output tests/data/basic.hap.gz tests/data/basic.hap.gz

Warning

If the --no-sort flag isn’t used, the index command will ignore all extra fields when processing your .hap file. To retain them, just sort the file manually first.

awk '$0 ~ /^#/ {print; next} {print | "sort -k2,4"}' tests/data/simphenotype.hap | \
haptools index --no-sort --output tests/data/simphenotype.hap.gz /dev/stdin

All files used in these examples are described here.

Detailed Usage

haptools

haptools: A toolkit for simulating and analyzing genotypes and phenotypes while taking into account haplotype information

haptools [OPTIONS] COMMAND [ARGS]...

Options

--version

Show the version and exit.

index

Takes in an unsorted .hap file and outputs it as a .gz and a .tbi file

haptools index [OPTIONS] HAPLOTYPES

Options

--sort, --no-sort

Sorting of the file will not be performed

Default:

True

-o, --output <output>

A .hap file containing sorted and indexed haplotypes and variants

Default:

input file

-v, --verbosity <verbosity>

The level of verbosity desired

Default:

INFO

Options:

CRITICAL | ERROR | WARNING | INFO | DEBUG | NOTSET

Arguments

HAPLOTYPES

Required argument