mirror of
https://github.com/chhylp123/hifiasm.git
synced 2026-10-07 04:28:12 +08:00
r211: added --write-paf/--write-ec/--skip-triobin
This commit is contained in:
+6
-4
@@ -1156,11 +1156,13 @@ int ha_assemble(void)
|
|||||||
if (asm_opt.load_index_from_disk && load_all_data_from_disk(&R_INF.paf, &R_INF.reverse_paf, asm_opt.output_file_name)) {
|
if (asm_opt.load_index_from_disk && load_all_data_from_disk(&R_INF.paf, &R_INF.reverse_paf, asm_opt.output_file_name)) {
|
||||||
ovlp_loaded = 1;
|
ovlp_loaded = 1;
|
||||||
fprintf(stderr, "[M::%s::%.3f*%.2f] ==> loaded corrected reads and overlaps from disk\n", __func__, yak_realtime(), yak_cpu_usage());
|
fprintf(stderr, "[M::%s::%.3f*%.2f] ==> loaded corrected reads and overlaps from disk\n", __func__, yak_realtime(), yak_cpu_usage());
|
||||||
trio_partition();
|
if (!(asm_opt.flag & HA_F_SKIP_TRIOBIN)) trio_partition();
|
||||||
|
if (asm_opt.flag & HA_F_WRITE_EC) Output_corrected_reads();
|
||||||
|
if (asm_opt.flag & HA_F_WRITE_PAF) Output_PAF();
|
||||||
}
|
}
|
||||||
if (!ovlp_loaded) {
|
if (!ovlp_loaded) {
|
||||||
// construct hash table for high occurrence k-mers
|
// construct hash table for high occurrence k-mers
|
||||||
if (!asm_opt.no_kmer_flt) {
|
if (!(asm_opt.flag & HA_F_NO_KMER_FLT)) {
|
||||||
ha_flt_tab = ha_ft_gen(&asm_opt, &R_INF, &hom_cov);
|
ha_flt_tab = ha_ft_gen(&asm_opt, &R_INF, &hom_cov);
|
||||||
ha_opt_update_cov(&asm_opt, hom_cov);
|
ha_opt_update_cov(&asm_opt, hom_cov);
|
||||||
}
|
}
|
||||||
@@ -1175,7 +1177,7 @@ int ha_assemble(void)
|
|||||||
asm_opt.num_bases, asm_opt.num_corrected_bases, asm_opt.num_recorrected_bases);
|
asm_opt.num_bases, asm_opt.num_corrected_bases, asm_opt.num_recorrected_bases);
|
||||||
fprintf(stderr, "[M::%s] size of buffer: %.3fGB\n", __func__, asm_opt.mem_buf / 1073741824.0);
|
fprintf(stderr, "[M::%s] size of buffer: %.3fGB\n", __func__, asm_opt.mem_buf / 1073741824.0);
|
||||||
}
|
}
|
||||||
//Output_corrected_reads();
|
if (asm_opt.flag & HA_F_WRITE_EC) Output_corrected_reads();
|
||||||
fprintf(stderr, "[M::%s::%.3f*%.2f] ==> written corrected reads to disk\n", __func__, yak_realtime(), yak_cpu_usage());
|
fprintf(stderr, "[M::%s::%.3f*%.2f] ==> written corrected reads to disk\n", __func__, yak_realtime(), yak_cpu_usage());
|
||||||
// overlap between corrected reads
|
// overlap between corrected reads
|
||||||
ha_opt_reset_to_round(&asm_opt, asm_opt.number_of_round);
|
ha_opt_reset_to_round(&asm_opt, asm_opt.number_of_round);
|
||||||
@@ -1184,7 +1186,7 @@ int ha_assemble(void)
|
|||||||
yak_cpu_usage(), yak_peakrss_in_gb());
|
yak_cpu_usage(), yak_peakrss_in_gb());
|
||||||
ha_print_ovlp_stat(R_INF.paf, R_INF.reverse_paf, R_INF.total_reads);
|
ha_print_ovlp_stat(R_INF.paf, R_INF.reverse_paf, R_INF.total_reads);
|
||||||
ha_ft_destroy(ha_flt_tab);
|
ha_ft_destroy(ha_flt_tab);
|
||||||
//Output_PAF();
|
if (asm_opt.flag & HA_F_WRITE_PAF) Output_PAF();
|
||||||
trio_partition();
|
trio_partition();
|
||||||
}
|
}
|
||||||
build_string_graph_without_clean(asm_opt.min_overlap_coverage, R_INF.paf, R_INF.reverse_paf,
|
build_string_graph_without_clean(asm_opt.min_overlap_coverage, R_INF.paf, R_INF.reverse_paf,
|
||||||
|
|||||||
+11
-7
@@ -1,9 +1,9 @@
|
|||||||
#include "CommandLines.h"
|
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "ketopt.h"
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#include "CommandLines.h"
|
||||||
|
#include "ketopt.h"
|
||||||
|
|
||||||
#define DEFAULT_OUTPUT "hifiasm.asm"
|
#define DEFAULT_OUTPUT "hifiasm.asm"
|
||||||
|
|
||||||
@@ -12,6 +12,9 @@ hifiasm_opt_t asm_opt;
|
|||||||
static ko_longopt_t long_options[] = {
|
static ko_longopt_t long_options[] = {
|
||||||
{ "version", ko_no_argument, 300 },
|
{ "version", ko_no_argument, 300 },
|
||||||
{ "dbg-gfa", ko_no_argument, 301 },
|
{ "dbg-gfa", ko_no_argument, 301 },
|
||||||
|
{ "write-paf", ko_no_argument, 302 },
|
||||||
|
{ "write-ec", ko_no_argument, 303 },
|
||||||
|
{ "skip-triobin", ko_no_argument, 304 },
|
||||||
{ 0, 0, 0 }
|
{ 0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -58,6 +61,7 @@ void Print_H(hifiasm_opt_t* asm_opt)
|
|||||||
|
|
||||||
void init_opt(hifiasm_opt_t* asm_opt)
|
void init_opt(hifiasm_opt_t* asm_opt)
|
||||||
{
|
{
|
||||||
|
asm_opt->flag = 0;
|
||||||
asm_opt->coverage = -1;
|
asm_opt->coverage = -1;
|
||||||
asm_opt->num_reads = 0;
|
asm_opt->num_reads = 0;
|
||||||
asm_opt->read_file_names = NULL;
|
asm_opt->read_file_names = NULL;
|
||||||
@@ -69,8 +73,6 @@ void init_opt(hifiasm_opt_t* asm_opt)
|
|||||||
asm_opt->k_mer_length = 51;
|
asm_opt->k_mer_length = 51;
|
||||||
asm_opt->mz_win = 51;
|
asm_opt->mz_win = 51;
|
||||||
asm_opt->bf_shift = 37;
|
asm_opt->bf_shift = 37;
|
||||||
asm_opt->no_HPC = 0;
|
|
||||||
asm_opt->no_kmer_flt = 0;
|
|
||||||
asm_opt->high_factor = 5.0f;
|
asm_opt->high_factor = 5.0f;
|
||||||
asm_opt->max_n_chain = 100;
|
asm_opt->max_n_chain = 100;
|
||||||
asm_opt->k_mer_min_freq = 3;
|
asm_opt->k_mer_min_freq = 3;
|
||||||
@@ -92,7 +94,6 @@ void init_opt(hifiasm_opt_t* asm_opt)
|
|||||||
asm_opt->max_short_tip = 3;
|
asm_opt->max_short_tip = 3;
|
||||||
asm_opt->min_cnt = 2;
|
asm_opt->min_cnt = 2;
|
||||||
asm_opt->mid_cnt = 5;
|
asm_opt->mid_cnt = 5;
|
||||||
asm_opt->verbose_gfa = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void destory_opt(hifiasm_opt_t* asm_opt)
|
void destory_opt(hifiasm_opt_t* asm_opt)
|
||||||
@@ -331,7 +332,7 @@ int CommandLine_process(int argc, char *argv[], hifiasm_opt_t* asm_opt)
|
|||||||
else if (c == 'i') asm_opt->load_index_from_disk = 0;
|
else if (c == 'i') asm_opt->load_index_from_disk = 0;
|
||||||
else if (c == 'w') asm_opt->mz_win = atoi(opt.arg);
|
else if (c == 'w') asm_opt->mz_win = atoi(opt.arg);
|
||||||
else if (c == 'D') asm_opt->high_factor = atof(opt.arg);
|
else if (c == 'D') asm_opt->high_factor = atof(opt.arg);
|
||||||
else if (c == 'F') asm_opt->no_kmer_flt = 1;
|
else if (c == 'F') asm_opt->flag |= HA_F_NO_KMER_FLT;
|
||||||
else if (c == 'N') asm_opt->max_n_chain = atoi(opt.arg);
|
else if (c == 'N') asm_opt->max_n_chain = atoi(opt.arg);
|
||||||
else if (c == 'a') asm_opt->clean_round = atoi(opt.arg);
|
else if (c == 'a') asm_opt->clean_round = atoi(opt.arg);
|
||||||
else if (c == 'z') asm_opt->adapterLen = atoi(opt.arg);
|
else if (c == 'z') asm_opt->adapterLen = atoi(opt.arg);
|
||||||
@@ -345,7 +346,10 @@ int CommandLine_process(int argc, char *argv[], hifiasm_opt_t* asm_opt)
|
|||||||
else if (c == 'p') asm_opt->small_pop_bubble_size = atoll(opt.arg);
|
else if (c == 'p') asm_opt->small_pop_bubble_size = atoll(opt.arg);
|
||||||
else if (c == 'm') asm_opt->large_pop_bubble_size = atoll(opt.arg);
|
else if (c == 'm') asm_opt->large_pop_bubble_size = atoll(opt.arg);
|
||||||
else if (c == 'n') asm_opt->max_short_tip = atoll(opt.arg);
|
else if (c == 'n') asm_opt->max_short_tip = atoll(opt.arg);
|
||||||
else if (c == 301) asm_opt->verbose_gfa = 1;
|
else if (c == 301) asm_opt->flag |= HA_F_VERBOSE_GFA;
|
||||||
|
else if (c == 302) asm_opt->flag |= HA_F_WRITE_PAF;
|
||||||
|
else if (c == 303) asm_opt->flag |= HA_F_WRITE_EC;
|
||||||
|
else if (c == 304) asm_opt->flag |= HA_F_SKIP_TRIOBIN;
|
||||||
else if (c == ':')
|
else if (c == ':')
|
||||||
{
|
{
|
||||||
fprintf(stderr, "[ERROR] missing option argument in \"%s\"\n", argv[opt.i - 1]);
|
fprintf(stderr, "[ERROR] missing option argument in \"%s\"\n", argv[opt.i - 1]);
|
||||||
|
|||||||
+9
-4
@@ -3,11 +3,19 @@
|
|||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
#define HA_VERSION "0.3.0-dirty-r207"
|
#define HA_VERSION "0.3.0-dirty-r211"
|
||||||
|
|
||||||
#define VERBOSE 0
|
#define VERBOSE 0
|
||||||
|
|
||||||
|
#define HA_F_NO_HPC 0x1
|
||||||
|
#define HA_F_NO_KMER_FLT 0x2
|
||||||
|
#define HA_F_VERBOSE_GFA 0x4
|
||||||
|
#define HA_F_WRITE_EC 0x8
|
||||||
|
#define HA_F_WRITE_PAF 0x10
|
||||||
|
#define HA_F_SKIP_TRIOBIN 0x20
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
int flag;
|
||||||
int num_reads;
|
int num_reads;
|
||||||
char** read_file_names;
|
char** read_file_names;
|
||||||
char* output_file_name;
|
char* output_file_name;
|
||||||
@@ -18,8 +26,6 @@ typedef struct {
|
|||||||
int k_mer_length;
|
int k_mer_length;
|
||||||
int mz_win;
|
int mz_win;
|
||||||
int bf_shift;
|
int bf_shift;
|
||||||
int no_HPC;
|
|
||||||
int no_kmer_flt;
|
|
||||||
float high_factor; // coverage cutoff set to high_factor*hom_cov
|
float high_factor; // coverage cutoff set to high_factor*hom_cov
|
||||||
int max_n_chain; // fall-back max number of chains to consider
|
int max_n_chain; // fall-back max number of chains to consider
|
||||||
int k_mer_min_freq;
|
int k_mer_min_freq;
|
||||||
@@ -37,7 +43,6 @@ typedef struct {
|
|||||||
int max_short_tip;
|
int max_short_tip;
|
||||||
int min_cnt;
|
int min_cnt;
|
||||||
int mid_cnt;
|
int mid_cnt;
|
||||||
int verbose_gfa;
|
|
||||||
|
|
||||||
float max_hang_rate;
|
float max_hang_rate;
|
||||||
float min_drop_rate;
|
float min_drop_rate;
|
||||||
|
|||||||
@@ -3,9 +3,6 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include "Hash_Table.h"
|
#include "Hash_Table.h"
|
||||||
#include "Process_Read.h"
|
|
||||||
#include "Correct.h"
|
|
||||||
#include "CommandLines.h"
|
|
||||||
#include "ksort.h"
|
#include "ksort.h"
|
||||||
pthread_mutex_t output_mutex;
|
pthread_mutex_t output_mutex;
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ CommandLines.o: CommandLines.h ketopt.h
|
|||||||
Correct.o: Correct.h Hash_Table.h htab.h Process_Read.h Overlaps.h kvec.h
|
Correct.o: Correct.h Hash_Table.h htab.h Process_Read.h Overlaps.h kvec.h
|
||||||
Correct.o: kdq.h CommandLines.h Levenshtein_distance.h POA.h Assembly.h
|
Correct.o: kdq.h CommandLines.h Levenshtein_distance.h POA.h Assembly.h
|
||||||
Hash_Table.o: Hash_Table.h htab.h Process_Read.h Overlaps.h kvec.h kdq.h
|
Hash_Table.o: Hash_Table.h htab.h Process_Read.h Overlaps.h kvec.h kdq.h
|
||||||
Hash_Table.o: CommandLines.h Correct.h Levenshtein_distance.h POA.h ksort.h
|
Hash_Table.o: CommandLines.h ksort.h
|
||||||
Levenshtein_distance.o: Levenshtein_distance.h
|
Levenshtein_distance.o: Levenshtein_distance.h
|
||||||
Output.o: Output.h CommandLines.h
|
Output.o: Output.h CommandLines.h
|
||||||
Overlaps.o: Overlaps.h kvec.h kdq.h ksort.h Process_Read.h CommandLines.h
|
Overlaps.o: Overlaps.h kvec.h kdq.h ksort.h Process_Read.h CommandLines.h
|
||||||
@@ -50,7 +50,7 @@ POA.o: CommandLines.h Correct.h Levenshtein_distance.h
|
|||||||
Process_Read.o: Process_Read.h Overlaps.h kvec.h kdq.h CommandLines.h
|
Process_Read.o: Process_Read.h Overlaps.h kvec.h kdq.h CommandLines.h
|
||||||
Purge_Dups.o: ksort.h Purge_Dups.h kvec.h kdq.h Overlaps.h Hash_Table.h
|
Purge_Dups.o: ksort.h Purge_Dups.h kvec.h kdq.h Overlaps.h Hash_Table.h
|
||||||
Purge_Dups.o: htab.h Process_Read.h CommandLines.h Correct.h
|
Purge_Dups.o: htab.h Process_Read.h CommandLines.h Correct.h
|
||||||
Purge_Dups.o: Levenshtein_distance.h POA.h
|
Purge_Dups.o: Levenshtein_distance.h POA.h kthread.h
|
||||||
Trio.o: khashl.h kthread.h Process_Read.h Overlaps.h kvec.h kdq.h
|
Trio.o: khashl.h kthread.h Process_Read.h Overlaps.h kvec.h kdq.h
|
||||||
Trio.o: CommandLines.h htab.h
|
Trio.o: CommandLines.h htab.h
|
||||||
anchor.o: htab.h Process_Read.h Overlaps.h kvec.h kdq.h CommandLines.h
|
anchor.o: htab.h Process_Read.h Overlaps.h kvec.h kdq.h CommandLines.h
|
||||||
|
|||||||
+2
-2
@@ -26466,7 +26466,7 @@ ma_sub_t **coverage_cut_ptr, int debug_g)
|
|||||||
|
|
||||||
asg_arc_del_simple_circle_untig(sources, coverage_cut, sg, 100, 0);
|
asg_arc_del_simple_circle_untig(sources, coverage_cut, sg, 100, 0);
|
||||||
|
|
||||||
if (asm_opt.verbose_gfa)
|
if (asm_opt.flag & HA_F_VERBOSE_GFA)
|
||||||
{
|
{
|
||||||
/*******************************for debug***************************************/
|
/*******************************for debug***************************************/
|
||||||
write_debug_graph(sg, sources, coverage_cut, output_file_name, n_read, reverse_sources, ruIndex);
|
write_debug_graph(sg, sources, coverage_cut, output_file_name, n_read, reverse_sources, ruIndex);
|
||||||
@@ -26545,7 +26545,7 @@ long long bubble_dist, int read_graph, int write)
|
|||||||
///actually min_thres = asm_opt.max_short_tip + 1 there are asm_opt.max_short_tip reads
|
///actually min_thres = asm_opt.max_short_tip + 1 there are asm_opt.max_short_tip reads
|
||||||
min_thres = asm_opt.max_short_tip + 1;
|
min_thres = asm_opt.max_short_tip + 1;
|
||||||
|
|
||||||
if (asm_opt.verbose_gfa)
|
if (asm_opt.flag & HA_F_VERBOSE_GFA)
|
||||||
{
|
{
|
||||||
if(load_debug_graph(&sg, &sources, &coverage_cut, output_file_name, &reverse_sources, &ruIndex))
|
if(load_debug_graph(&sg, &sources, &coverage_cut, output_file_name, &reverse_sources, &ruIndex))
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -62,7 +62,7 @@ void ha_get_new_candidates(ha_abuf_t *ab, int64_t rid, UC_Read *ucr, overlap_reg
|
|||||||
ab->mz.n = 0, ab->n_a = 0;
|
ab->mz.n = 0, ab->n_a = 0;
|
||||||
|
|
||||||
// get the list of anchors
|
// get the list of anchors
|
||||||
ha_sketch(ucr->seq, ucr->length, asm_opt.mz_win, asm_opt.k_mer_length, 0, !asm_opt.no_HPC, &ab->mz, ha_flt_tab);
|
ha_sketch(ucr->seq, ucr->length, asm_opt.mz_win, asm_opt.k_mer_length, 0, !(asm_opt.flag & HA_F_NO_HPC), &ab->mz, ha_flt_tab);
|
||||||
if (ab->mz.m > ab->old_mz_m) {
|
if (ab->mz.m > ab->old_mz_m) {
|
||||||
ab->old_mz_m = ab->mz.m;
|
ab->old_mz_m = ab->mz.m;
|
||||||
REALLOC(ab->seed, ab->old_mz_m);
|
REALLOC(ab->seed, ab->old_mz_m);
|
||||||
|
|||||||
@@ -721,7 +721,7 @@ ha_ct_t *ha_count(const hifiasm_opt_t *asm_opt, int flag, ha_pt_t *p0, const voi
|
|||||||
}
|
}
|
||||||
yak_copt_init(&opt);
|
yak_copt_init(&opt);
|
||||||
opt.k = asm_opt->k_mer_length;
|
opt.k = asm_opt->k_mer_length;
|
||||||
opt.is_HPC = !asm_opt->no_HPC;
|
opt.is_HPC = !(asm_opt->flag&HA_F_NO_HPC);
|
||||||
opt.w = flag & HAF_COUNT_ALL? 1 : asm_opt->mz_win;
|
opt.w = flag & HAF_COUNT_ALL? 1 : asm_opt->mz_win;
|
||||||
opt.bf_shift = flag & HAF_COUNT_EXACT? 0 : asm_opt->bf_shift;
|
opt.bf_shift = flag & HAF_COUNT_EXACT? 0 : asm_opt->bf_shift;
|
||||||
opt.n_thread = asm_opt->thread_num;
|
opt.n_thread = asm_opt->thread_num;
|
||||||
|
|||||||
Reference in New Issue
Block a user