HapLink.jl

Viral haplotype calling by linkage disequilibrium
Author ksumngs
Popularity
0 Stars
Updated Last
9 Months Ago
Started In
November 2021

HapLink

Project Status: Active – The project has reached a stable, usable state and is being actively developed. GitHub tag (latest by date) License Stable Dev Build Status Coverage Code Style: Blue Conda (channel only) Genie Downloads

This project follows the semver pro forma and uses the OneFlow branching model.

Call haplotypes based on linkage disequilibrium between variant sites on long sequencing reads. Uses maximum liklihood methods for reads that are shorter than the entire genome. Comes with its own variant caller.


Installation

🐍 Via Bioconda

⚠️🐧 Linux-only!

Recommended for running HapLink on the command line

conda create -n haplink -c bioconda -c conda-forge haplink -y
conda activate haplink

∴ Via Julia REPL

Recommended for running HapLink within a Julia session

julia> ]
(@v1.6) pkg> add HapLink

To use this install of HapLink from the command line, you will need to add $HOME/.julia/bin to your $PATH.

📦 Via Apptainer

Recommended for running HapLink on a HPC

apptainer pull docker://ghcr.io/ksumngs/haplink.jl

🐳 Via Docker

docker pull ghcr.io/ksumngs/haplink.jl:latest

Usage

Please check the docs for more detailed instructions on how to use HapLink, both on the command line and in the REPL.

The basic flow of HapLink is

Step Command Output Format
1. Call variants haplink variants VCF
2. Call haplotypes haplink haplotypes YAML
3. Convert haplotype calls into sequences haplink sequences FASTA

You can see how this works using the files in the example directory:

haplink variants \
  example/reference.fasta \
  example/sample.bam \
  > sample.vcf

haplink haplotypes \
  example/reference.fasta \
  sample.vcf \
  example/sample.bam \
  > sample.yaml

haplink sequences \
  example/reference.fasta \
  sample.yaml \
  sample.fasta

Development

HapLink is written in Julia. While the focus of the program is the command line interface (CLI), it also exposes a nearly identical API in the form of a Julia Package, which is described in the docs.

Development environment

For consistency, the recommended version of Julia as well as all the recommended formatters and commit hooks are listed in a Nix file. If you have [direnv] and [Nix] installed, then simply run

direnv allow .
pre-commit install

to setup Julia and the commit hook tools.

Editing the package

HapLink.jl is a self-contained Julia package, and its development process is identical to any other package as discussed in the Pkg documentation.

$ git clone https://github.com/ksumngs/HapLink.jl.git
$ cd HapLink.jl
$ julia
(@v1.6) pkg> activate .
(HapLink) pkg> instantiate
julia> using HapLink
julia> ...

To test your changes on the command line application, ensure that $HOME/.julia/bin is on your $PATH, then from the Julia REPL

julia> ]
(@v1.6) pkg> activate .
(HapLink) pkg> build

This will update the application shim to include your changes.