1
1
// HATK - Haplotype analysis toolkit
2
// Copyright (C) 2022  Osma S. Rautila
3
//
4
// This program is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8
//
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
//
17
//
18
//
19

            
20
// #![doc(
21
//     html_logo_url = "https://raw.githubusercontent.com/rust-bio/rust-bio/master/img/bioferris.svg",
22
//     html_favicon_url = "https://raw.githubusercontent.com/rust-bio/rust-bio/master/img/bioferris.svg"
23
// )]
24

            
25
//! HATK - Haplotype analysis toolkit
26
//!
27
//! This library and program provides a multitude of tools designed for the analysis of phased and
28
//! imputed genomes.
29
//! All provided tools are tested via continuous integration.
30
//!
31
//! For navigating the documentation of the available modules, see [the `Modules` section below](#modules).
32
//! If you want to contribute to `hatk`, see [the `Contribute` section in the repo]()
33
//!
34
//! HATK toolkit commands
35
//!
36
//! * Check for haplotype
37
//! * Find the longest common haplotype at a locus
38
//! * Contrahomozygosity
39
//! * Random sampled contrahomozygosity
40
//! * Decay of shared ancestral haplotype
41
//! * Recursive decay of shared ancestral haplotypes
42
//! * Most recent common ancestor estimation using the Gamma method
43
//! * Pairwise Identity-By-Descent at a specific locus
44
//! * Sample homozygosity
45
//! * Utils to check VCF coverage and sample names
46
//!
47
//! # Getting started
48
//!
49
//! Users who already know `HATK` might want to jump right into the [modules docs](https://docs.rs/bio/#modules)
50
//!
51
//! ## Installing HATK
52
//!
53
//! Rust and its package manager cargo can be installed following the instruction for [rustup](https://rustup.rs/).
54
//!
55
//! After installing cargo, run the following command
56
//!
57
//! ```bash
58
//! cargo install hatk
59
//! ```
60
//!
61
//! ## Running HATK
62
//!
63
//! To print the available commands use (more about the commands in the subcommnds section):
64
//! ```bash
65
//! hatk --help
66
//! ```
67
//! To run for example the longest common haplotype at a specific locus tool use:
68
//! ```bash
69
//! hatk common-haplotype $file --coords $coords > ${outdir}/longest_haplotype.tsv
70
//! ```
71
//!
72
//! For a full analysis of a given locus using only the longest shared haplotypes run the following:
73
//! ```bash
74
//!hatk common-haplotype $file --coords $coords --only-longest > ${outdir}/longest_haplotype.tsv
75
//!
76
//!hatk decay $file --coords $coords --only-longest > ${outdir}/decay.csv
77
//!
78
//!hatk multi-decay $file --coords $coords --only-longest -o "${outdir}/decay_graph"
79
//!
80
//!hatk mrca $file --coords $coords --only-longest > ${outdir}/age.txt
81
//!
82
//!hatk ibs $file --coords $coords --only-longest -o "${outdir}/ibs.png"
83
//!
84
//!hatk rand-homozygosity $file -t 8 --iters 300 > ${outdir}/rand_homozygosity.csv
85
//!
86
//!hatk sample-homozygosity \
87
//!  $file --coords $coords -t 8 --iters 100 > ${outdir}/sampled-homozygosity.csv
88
//!
89
//!hatk homozygosity $file -t 8 > ${outdir}/homozygosity.csv
90
//!
91
//!hatk check-for-haplotype $file --coords $coords --haplotype ${outdir}/longest_haplotype.tsv
92
//!
93
//!
94
//!```
95
//!
96

            
97
pub mod libs;
98
pub use libs::{args, io, read_vcf, structs, utils, core};
99

            
100
#[cfg(feature = "clap")]
101
pub use libs::clap;
102

            
103
pub mod graphs;
104
pub mod subcommands;