99#include " ketopt.h"
1010#include < iostream>
1111
12- void correct_round2 (chat_opt_t *chat_opt,hifiasm_opt_t * asm_opt);
12+ void correct_round2 (chat_opt_t *chat_opt, hifiasm_opt_t * asm_opt);
1313void correct_round1 (chat_opt_t *chat_opt)
1414{
15- std::cout << " correct_round1" << chat_opt->thread_num << std::endl;
16-
15+ std::cout << " correct_round1 thread:" << chat_opt->thread_num << std::endl;
16+ // PRINT_LINE_FUNC();
17+ // if (chat_opt->dBGFile != NULL)
18+ // std::cout << "dBG use " << chat_opt->dBGFile << std::endl;
1719 std::string pacbioFile = chat_opt->read_file_names ;
1820 BankFasta bsize (pacbioFile);
1921 BankFasta::Iterator itSeqSize (bsize);
@@ -29,12 +31,22 @@ void correct_round1(chat_opt_t *chat_opt)
2931 }
3032 nbSeq++;
3133 }
34+ // PRINT_LINE_FUNC();
3235 max_read_len = max_read_len * 1.25 ;
3336 std::string ONTGraph;
3437 int comaPosition = std::string::npos;
35- PRINT_LINE_FUNC ();
36-
37- ONTGraph = chat_opt->read_file_names ;
38+ // PRINT_LINE_FUNC();
39+ if (chat_opt->dBGFile == NULL )
40+ {
41+ std::cout << " dBG use ONT reads" <<chat_opt->read_file_names << std::endl;
42+ ONTGraph = chat_opt->read_file_names ;
43+ std::cerr << " creating the graph from file(s): " << chat_opt->read_file_names << std::endl;
44+ }else {
45+ std::cout << " dBG use " << chat_opt->dBGFile << std::endl;
46+ std::cerr << " creating the graph from file(s): " << chat_opt->dBGFile << std::endl;
47+ ONTGraph = chat_opt->dBGFile ;
48+ }
49+
3850 comaPosition = ONTGraph.find (" ," );
3951
4052 if (comaPosition != std::string::npos)
@@ -62,21 +74,32 @@ void correct_round1(chat_opt_t *chat_opt)
6274 }
6375
6476 Graph graph;
65- PRINT_LINE_FUNC ();
77+ // PRINT_LINE_FUNC();
6678 if (DEBUG_l)
6779 {
68- std::cerr << " creating the graph from file(s): " << chat_opt-> read_file_names << std::endl;
80+
6981 }
7082 try
7183 {
7284 // v106: open IBank from 1/ list of filenames 2/ a file of filenames
73- IBank *b = Bank::open (chat_opt->read_file_names );
85+ IBank *b;
86+ if (chat_opt->dBGFile == NULL )
87+ {
88+ std::cout << " dBG use ONT reads" << std::endl;
89+ b = Bank::open (chat_opt->read_file_names );
90+ }
91+ else
92+ {
93+ std::cout << " dBG use " << chat_opt->dBGFile << std::endl;
94+ b = Bank::open (chat_opt->dBGFile );
95+ }
96+
7497 std::string outTmpPath = " " ;
75- // outTmpPath = outTmpPath + dirname(std::string(chat_opt->read_file_names)) + "recorrected.fa";
76- PRINT_LINE_FUNC ();
98+ // outTmpPath = outTmpPath + dirname(std::string(chat_opt->read_file_names)) + "recorrected.fa";
99+ // PRINT_LINE_FUNC();
77100 std::cout << outTmpPath.c_str () << " ONTGraph:" << ONTGraph << std::endl;
78- graph = Graph::create (b, (const char *)" %s -out %s -kmer-size %d -abundance-min %d -bloom cache -debloom original -debloom-impl basic -nb-cores %d -abundance-max 2147483647" , outTmpPath.c_str (), ONTGraph.c_str (), chat_opt->k_mer_length ,chat_opt->abundance_min , chat_opt->thread_num );
79- PRINT_LINE_FUNC ();
101+ graph = Graph::create (b, (const char *)" %s -out %s -kmer-size %d -abundance-min %d -bloom cache -debloom original -debloom-impl basic -nb-cores %d -abundance-max 2147483647" , outTmpPath.c_str (), ONTGraph.c_str (), chat_opt->k_mer_length , chat_opt->abundance_min , chat_opt->thread_num );
102+ // PRINT_LINE_FUNC();
80103 if (is_readable (ONTGraph))
81104 {
82105 std::cerr << " !!! file present : " << ONTGraph << std::endl;
@@ -201,7 +224,7 @@ void correct_round1(chat_opt_t *chat_opt)
201224 }
202225}
203226
204- void correct_round2 (chat_opt_t *chat_opt,hifiasm_opt_t * asm_opt)
227+ void correct_round2 (chat_opt_t *chat_opt, hifiasm_opt_t * asm_opt)
205228{
206229 int ret;
207230 yak_reset_realtime ();
@@ -210,25 +233,25 @@ void correct_round2(chat_opt_t *chat_opt,hifiasm_opt_t* asm_opt)
210233 std::cout << " chenggong" << std::endl;
211234 // .................传入参数..................
212235 asm_opt->num_reads = 1 ;
213- asm_opt->read_file_names = new char *[asm_opt->num_reads ];
236+ asm_opt->read_file_names = new char *[asm_opt->num_reads ];
214237 asm_opt->thread_num = chat_opt->thread_num ;
215238 asm_opt->read_file_names [0 ] = strdup (chat_opt->output_dir_ec .c_str ());
216239
217240 //
218241 std::cout << asm_opt->read_file_names [0 ] << std::endl;
219242 std::string outputname = chat_opt->outReadFile ;
220- std::cout<< " chat_opt->outReadFile:" << chat_opt->outReadFile << std::endl;
243+ std::cout << " chat_opt->outReadFile:" << chat_opt->outReadFile << std::endl;
221244 asm_opt->output_file_name = chat_opt->outReadFile ;
222- std::cout<< " asm_opt->output_file_name:" << asm_opt->output_file_name << std::endl;
245+ std::cout << " asm_opt->output_file_name:" << asm_opt->output_file_name << std::endl;
223246
224247 asm_opt->max_ov_diff_ec = chat_opt->max_ov_diff_ec ;
225248 asm_opt->number_of_round = chat_opt->second_number_of_round ;
226- std::cout<< " asm_opt->max_ov_diff_ec:" << asm_opt->max_ov_diff_ec << std::endl;
227- std::cout<< " asm_opt->number_of_round:" << asm_opt->number_of_round << std::endl;
249+ std::cout << " asm_opt->max_ov_diff_ec:" << asm_opt->max_ov_diff_ec << std::endl;
250+ std::cout << " asm_opt->number_of_round:" << asm_opt->number_of_round << std::endl;
228251 check_option1 (asm_opt);
229252
230253 ret = ha_assemble ();
231-
254+
232255 return ;
233256}
234257
0 commit comments