Wiki

Clone wiki

purge_haplotigs / Install

UPDATED FOR v1.0.3

Detailed installation

I'm using a new Ubuntu 16.04 LTS Virtual Machine on Azure for this, but this should work for most recent Ubuntu/Debian releases.

VM info

Standard B4ms (4 vcpus, 16 GB memory)

# login
Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-81-generic x86_64)
...
$ uname -a
Linux MikeVM 4.15.0-1025-azure #26-Ubuntu SMP Tue Sep 25 09:20:29 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Dependencies (in no particular order)

bedtools

$ sudo apt install bedtools
$ bedtools --version
bedtools v2.26.0

samtools

$ sudo apt install samtools
$ samtools --version
samtools 1.7
Using htslib 1.7-2
Copyright (C) 2018 Genome Research Ltd.

Rscript

$ sudo apt install r-base r-base-dev

# on a new install we wont have the required R library 'ggplot2' installed
$ sudo su - -c "R -e \"install.packages('ggplot2', repos='http://cran.rstudio.com/')\""

Minimap2

# download the latest release from https://github.com/lh3/minimap2/releases (currently v2.13)
$ wget https://github.com/lh3/minimap2/releases/download/v2.13/minimap2-2.13_x64-linux.tar.bz2
$ tar xf minimap2-2.13_x64-linux.tar.bz2

# we'll add a bin directory to the home folder and add to the PATH, then install there
$ mkdir ~/bin
$ printf "export PATH=\$PATH:~/bin\n" > .bashrc
$ source .bashrc
$ cp minimap2-2.13_x64-linux/minimap2 ~/bin/

$ minimap2 -V
2.13-r850

Install Purge Haplotigs

installing to user's home directory, no compiling, just add the purge_haplotigs/bin directory to the system PATH.

# clone the git
$ git clone https://bitbucket.org/mroachawri/purge_haplotigs.git

# create a softlink to ~/bin
$ ln -s ~/purge_haplotigs/bin/purge_haplotigs ~/bin/purge_haplotigs

# test Purge Haplotigs
$ purge_haplotigs

USAGE:
purge_haplotigs  <command>  [options]

COMMANDS:
-- Purge Haplotigs pipeline:
    readhist        First step, generate a read-depth histogram for the genome
    contigcov       Second step, get contig coverage stats and flag 'suspect' contigs
    purge           Third step, identify and reassign haplotigs

-- Other scripts
    ncbiplace       Generate a placement file for submission to NCBI
    test            Test everything!


# test the pipeline
$ purge_haplotigs test
    # <lots of jargon>
ALL TESTS PASSED

Updated