2020-06-27 14:22:39 -04:00
2020-01-04 12:27:52 +08:00
2020-05-08 00:40:53 -04:00
2020-06-08 17:51:36 -04:00
2020-06-08 17:51:36 -04:00
2020-06-08 17:51:36 -04:00
2020-06-03 21:38:59 -04:00
2020-04-13 14:44:10 -04:00
2020-04-18 00:45:47 -04:00
2020-03-26 23:00:00 -04:00
2020-04-10 00:12:19 -04:00
2019-11-13 20:18:11 -05:00
2020-03-25 19:17:07 -04:00
2019-11-13 20:18:11 -05:00
2020-03-22 16:54:32 -04:00
2020-03-22 16:54:32 -04:00
2019-11-13 20:18:11 -05:00
2019-12-26 02:26:24 -05:00
2019-12-26 09:40:35 -05:00
2019-05-09 15:34:58 -04:00
2020-04-05 11:17:12 -04:00
2020-06-03 20:46:34 -04:00
2019-12-26 02:26:24 -05:00
2019-07-14 21:13:50 -04:00
2020-06-27 10:57:22 -04:00
2020-05-17 11:53:12 -04:00
2020-04-03 14:10:40 -04:00
2019-12-28 04:45:53 -05:00
2020-04-18 00:45:47 -04:00
2020-04-18 00:45:47 -04:00
2020-03-25 19:59:17 -04:00
2020-04-05 11:17:12 -04:00

Getting Started

# Install hifiasm (requiring g++ and zlib)
git clone https://github.com/chhylp123/hifiasm
cd hifiasm && make

# Run on test data (use -f0 for small datasets)
wget https://github.com/chhylp123/hifiasm/releases/download/v0.7/chr11-2M.fa.gz
./hifiasm -o test -t4 -f0 chr11-2M.fa.gz 2> test.log   # this takes ~90 sec

# Assemble inbred/homozygous genomes (-l0 disables duplication purging)
hifiasm -o CHM13.asm -t32 -l0 CHM13-HiFi.fa.gz
# Assemble heterozygous with built-in duplication purging
hifiasm -o HG002.asm -t32 HG002-file1.fq.gz HG002-file2.fq.gz

# Trio binning assembly (requiring https://github.com/lh3/yak)
yak count -b37 -t16 -o pat.yak <(cat pat_1.fq.gz pat_2.fq.gz) <(cat pat_1.fq.gz pat_2.fq.gz)
yak count -b37 -t16 -o mat.yak <(cat mat_1.fq.gz mat_2.fq.gz) <(cat mat_1.fq.gz mat_2.fq.gz)
hifiasm -o HG002.asm -t32 -1 pat.yak -2 mat.yak HG002-HiFi.fa.gz

Introduction

Hifiasm is a fast haplotype-resolved de novo assembler for PacBio Hifi reads. Unlike most existing assemblers, hifiasm starts from uncollapsed genome. Thus, it is able to keep the haplotype information as much as possible.

For non-trio assembly, the input of hifiasm is the PacBio Hifi reads in fasta/fastq format, and its outputs consist of:

  1. Haplotype-resolved raw unitig graph in GFA format (prefix.r_utg.gfa). This graph keeps all haplotype information, including somatic mutations and recurrent sequencing errors.
  2. Haplotype-resolved processed unitig graph without small bubbles (prefix.p_utg.gfa). Small bubbles might be caused by somatic mutations or noise in data, which are not the real haplotype information.
  3. Primary assembly contig graph (prefix.p_ctg.gfa). This graph collapses different haplotypes.
  4. Alternate assembly contig graph (prefix.a_ctg.gfa). This graph consists of all assemblies that are discarded in primary contig graph.

For trio assembly, the input of hifiasm is the PacBio Hifi reads in fasta/fastq format, and the paternal/maternal trio indexes generated by yak count. The outputs consist of:

  1. Haplotype-resolved raw unitig graph in GFA format (prefix.r_utg.gfa). This graph keeps all haplotype information.

  2. Phased paternal/haplotype1 contig graph (prefix.hap1.p_ctg.gfa). This graph keeps the phased paternal/haplotype1 assembly.

  3. Phased maternal/haplotype2 contig graph (prefix.hap2.p_ctg.gfa). This graph keeps the phased maternal/haplotype2 assembly.

In addition, hifiasm also outputs three binary files that save all overlap information (prefix.ec.bin, prefix.ovlp.reverse.bin, prefix.ovlp.source.bin). With these files, hifiasm can avoid the time-consuming all-to-all overlap calculation step, and do the assembly directly and quickly. This might be helpful when you want to get an optimized assembly by multiple rounds of experiments with different parameters.

Hifiasm is a standalone and lightweight assembler, which does not need external libraries (except zlib). For large genomes, it can generate high-quality primary assembly in several hours. Hifiasm has been tested on various large and complex datasets. The results are as follows:

Dataset Size Cov. Asm options CPU time Wall time RAM N50
Mouse (C57/BL6J) 2.6Gb ×25 -t48 -l0 172.9h 4.8h 76G 21.1Mb
Maize (B73) 2.2Gb ×22 -t48 -l0 203.2h 5.1h 68G 36.7Mb
Strawberry 0.8Gb ×36 -t48 -D10 152.7h 3.7h 91G 17.8Mb
Frog 9.5Gb ×29 -t48 2834.3h 69.0h 463G 9.3Mb
Redwood 35.6Gb ×28 -t80 3890.3h 65.5h 699G 5.4Mb
Human (CHM13) 3.1Gb ×32 -t48 -l0 310.7h 8.2h 114G 88.9Mb
Human (HG00733) 3.1Gb ×33 -t48 269.1h 6.9h 135G 69.9Mb
Human (HG002) 3.1Gb ×36 -t48 305.4h 7.7h 137G 98.7Mb

Hifiasm also can produce high-quality fully resolved assembly. We tested it on the following trio-binning datasets:

Dataset Cov. CPU time Elapsed time RAM N50
HG00733, [father], [mother] ×33 269.1h 6.9h 135G 35.1Mb (paternal), 34.9Mb (maternal)
HG002, [father], [mother] ×36 305.4h 7.7h 137G 41.0Mb (paternal), 40.8Mb (maternal)
NA12878, [father], [mother] ×30 180.8h 4.9h 123G 27.7Mb (paternal), 27.0Mb (maternal)

Except NA12878, the assemblies above were produced by hifiasm v0.7 and can be downloaded at

ftp://ftp.dfci.harvard.edu/pub/hli/hifiasm/submission/v0.7/

NA12878 was assembled with a more recent version of hifiasm and is available at

ftp://ftp.dfci.harvard.edu/pub/hli/hifiasm/NA12878-r253/

Usage

For Hifi reads assembly, a typical command line looks like:

./hifiasm -o NA12878.asm -t 32 NA12878.fq.gz

where NA12878.fq.gz is the input reads and -o specifies the output files. In this example, all output files can be found at NA12878.asm.*. -t specifies the number of CPU threads. Note that at first run, hifiasm will save all overlaps to disk, which can avoid the time-consuming all-to-all overlap calculation next time. For hifiasm, once the overlap information has been obtained during the previous run in advance, it is able to load all overlaps from disk and then directly do assembly. If you want to ignore the pre-computed overlap information, please specify -i. The example dataset can be found at: https://github.com/chhylp123/hifiasm/releases/download/v0.7/HG002-34X-chr11-19310012.-.21493943.fastq.gz.

Please note that some old Hifi reads may consist of short adapters. To improve the assembly quality, adapters should be removed by -z as follow:

./hifiasm -o butterfly.asm -t 42 -z 20 butterfly.fq.gz

In this example, hifiasm will remove 20 bases from both ends of each read.

For trio assembly, first the trio indexes of paternal/maternal should be generated by yak count:

./yak count -k31 -b37 -t16 -o mat.yak mat.fq.gz
./yak count -k31 -b37 -t16 -o pat.yak pat.fq.gz

and then run hifiasm as follow:

./hifiasm -o NA12878.asm -t 32 -1 pat.yak -2 mat.yak NA12878_1.fq.gz NA12878_2.fq.gz

Getting Help

For detailed description of options, please see man ./hifiasm.1. The -h option of hifiasm also provides simple description of options. If you have further questions, please raise an issue at the issue page.

Limitations and future works

  1. The running time and memory usage should be further reduced.

  2. The N50 should be further improved.

Description
Hifiasm: a haplotype-resolved assembler for accurate Hifi reads
Readme MIT 21 MiB
Languages
C++ 93.2%
C 6.5%
Roff 0.2%