From ea248038c68e25008bbedbe7c0fb1746edbe0dca Mon Sep 17 00:00:00 2001 From: Haoyu Cheng Date: Sat, 28 Dec 2019 16:18:50 -0500 Subject: [PATCH] Update for overlaps --- CommandLines.cpp | 6 ++++-- README.md | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CommandLines.cpp b/CommandLines.cpp index 80fd5fe..3d900dd 100644 --- a/CommandLines.cpp +++ b/CommandLines.cpp @@ -29,6 +29,7 @@ void Print_H(hifiasm_opt_t* asm_opt) fprintf(stderr, " -k INT k-mer length [%d] (must be < 64)\n", asm_opt->k_mer_length); ///fprintf(stderr, " -w write all overlaps to disk, can accelerate assembly next time [%d]\n", asm_opt->write_index_to_disk); ///fprintf(stderr, " -l load all overlaps from disk, can avoid overlap calculation [%d]\n", asm_opt->load_index_from_disk); + fprintf(stderr, " -i do the overlap calculation even if there are overlaps of previous run on disk.\n"); fprintf(stderr, " -z INT length of adapters that should be removed [%d]\n", asm_opt->adapterLen); fprintf(stderr, " -p INT size of popped bubbles [%lld]\n", asm_opt->pop_bubble_size); fprintf(stderr, " -x FLOAT max overlap drop ratio [%.2g]\n", asm_opt->max_drop_rate); @@ -199,7 +200,7 @@ int CommandLine_process(int argc, char *argv[], hifiasm_opt_t* asm_opt) int c; - while ((c = ketopt(&opt, argc, argv, 1, "hvt:o:k:lwm:n:r:a:b:z:x:y:p:", 0)) >= 0) { + while ((c = ketopt(&opt, argc, argv, 1, "hvt:o:k:lwm:n:r:a:b:z:x:y:p:i", 0)) >= 0) { if (c == 'h') { Print_H(asm_opt); @@ -215,7 +216,8 @@ int CommandLine_process(int argc, char *argv[], hifiasm_opt_t* asm_opt) else if (c == 'n') asm_opt->k_mer_min_freq = atoi(opt.arg); else if (c == 'm') asm_opt->k_mer_max_freq = atoi(opt.arg); else if (c == 'r') asm_opt->number_of_round = atoi(opt.arg); - else if (c == 'k') asm_opt->k_mer_length = atoi(opt.arg); + else if (c == 'k') asm_opt->k_mer_length = atoi(opt.arg); + else if (c == 'i') asm_opt->load_index_from_disk = 0; else if (c == 'l') asm_opt->load_index_from_disk = 1; else if (c == 'w') asm_opt->write_index_to_disk = 1; else if (c == 'a') asm_opt->clean_round = atoi(opt.arg); diff --git a/README.md b/README.md index 68cdcf8..604fbad 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Hifiasm is an ultrafast haplotype-resolved de novo assembler based on PacBio Hif 5. Haplotype-aware error corrected reads in fasta format (hifiasm.asm.ec.fa in dafault). 6. All-to-all overlaps in [paf][paf] format (hifiasm.asm.paf). -So far hifiasm is still in early development stage, it will output phased chromosome-level high-quality assembly in the near future. +So far hifiasm is still in early development stage, it will output phased chromosome-level high-quality assembly in the near future. In addition, hifiasm also outputs three binary files that save all overlap inforamtion (hifiasm.asm.gfa.aux.bin/hifiasm.asm.gfa.aux.reverse.bin/hifiasm.asm.gfa.aux.source.bin in dafault). 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 round 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 assembly in a few hours. Hifiasm has been tested on the following datasets: @@ -39,7 +39,7 @@ For Hifi reads assembly, a typical command line looks like: ./hifiasm -o NA12878.asm -k 40 -t 32 -r 2 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.*`. `-k`, `-t` and `-r` specify the length of k-mer, the number of CPU threads, and the number of correction rounds, respectively. Note that at first time, hifiasm will save all overlaps to disk, which can avoid the time-consuming all-to-all overlap calculation next time. For hifiasm, if 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. +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.*`. `-k`, `-t` and `-r` specify the length of k-mer, the number of CPU threads, and the number of correction rounds, respectively. 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` or simply delete `*gfa.aux.bin`, `*gfa.aux.reverse.bin` and `*gfa.aux.source.bin`. 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: