@@ -8,7 +8,7 @@ use kr2r::utils::{find_and_trans_bin_files, find_and_trans_files, open_file};
8
8
use kr2r:: HitGroup ;
9
9
// use rayon::prelude::*;
10
10
use seqkmer:: { buffer_map_parallel, trim_pair_info, OptionPair } ;
11
- use std:: collections:: { HashMap , HashSet } ;
11
+ use std:: collections:: HashMap ;
12
12
use std:: fs:: File ;
13
13
use std:: io:: { self , BufRead , BufReader , BufWriter , Read , Result , Write } ;
14
14
use std:: path:: { Path , PathBuf } ;
@@ -65,9 +65,9 @@ pub struct Args {
65
65
#[ clap( long = "output-dir" , value_parser) ]
66
66
pub kraken_output_dir : Option < PathBuf > ,
67
67
68
- /// output file contains all unclassified sequence
69
- #[ clap( long, value_parser, default_value_t = false ) ]
70
- pub full_output : bool ,
68
+ // // / output file contains all unclassified sequence
69
+ // #[clap(long, value_parser, default_value_t = false)]
70
+ // pub full_output: bool,
71
71
/// Confidence score threshold, default is 0.0.
72
72
#[ clap(
73
73
short = 'T' ,
@@ -120,8 +120,7 @@ fn process_batch<P: AsRef<Path>>(
120
120
id_map : & HashMap < u32 , ( String , String , usize , Option < usize > ) > ,
121
121
writer : & mut Box < dyn Write + Send > ,
122
122
value_mask : usize ,
123
- ) -> Result < ( TaxonCountersDash , usize , HashSet < u32 > ) > {
124
- let hit_seq_id_set = HashSet :: new ( ) ;
123
+ ) -> Result < ( TaxonCountersDash , usize ) > {
125
124
let confidence_threshold = args. confidence_threshold ;
126
125
let minimum_hit_groups = args. minimum_hit_groups ;
127
126
@@ -138,6 +137,7 @@ fn process_batch<P: AsRef<Path>>(
138
137
if let Some ( item) = id_map. get ( & k) {
139
138
let mut rows = rows. to_owned ( ) ;
140
139
rows. sort_unstable ( ) ;
140
+
141
141
let dna_id = trim_pair_info ( & item. 0 ) ;
142
142
let range =
143
143
OptionPair :: from ( ( ( 0 , item. 2 ) , item. 3 . map ( |size| ( item. 2 , size + item. 2 ) ) ) ) ;
@@ -179,11 +179,7 @@ fn process_batch<P: AsRef<Path>>(
179
179
. expect ( "failed" ) ;
180
180
}
181
181
182
- Ok ( (
183
- cur_taxon_counts,
184
- classify_counter. load ( Ordering :: SeqCst ) ,
185
- hit_seq_id_set,
186
- ) )
182
+ Ok ( ( cur_taxon_counts, classify_counter. load ( Ordering :: SeqCst ) ) )
187
183
}
188
184
189
185
pub fn run ( args : Args ) -> Result < ( ) > {
@@ -218,7 +214,7 @@ pub fn run(args: Args) -> Result<()> {
218
214
}
219
215
None => Box :: new ( BufWriter :: new ( io:: stdout ( ) ) ) as Box < dyn Write + Send > ,
220
216
} ;
221
- let ( thread_taxon_counts, thread_classified, hit_seq_set ) = process_batch :: < PathBuf > (
217
+ let ( thread_taxon_counts, thread_classified) = process_batch :: < PathBuf > (
222
218
sam_files,
223
219
& args,
224
220
& taxo,
@@ -227,22 +223,22 @@ pub fn run(args: Args) -> Result<()> {
227
223
value_mask,
228
224
) ?;
229
225
230
- if args. full_output {
231
- sample_id_map
232
- . iter ( )
233
- . filter ( |( key, _) | !hit_seq_set. contains ( key) )
234
- . for_each ( |( _, value) | {
235
- let dna_id = trim_pair_info ( & value. 0 ) ; // 假设 key 是 &str 类型
236
- let output_line = format ! (
237
- "U\t {}\t 0\t {}\t {}\n " ,
238
- dna_id,
239
- value. 1 ,
240
- if value. 3 . is_none( ) { "" } else { " |:| " }
241
- ) ;
242
-
243
- writer. write_all ( output_line. as_bytes ( ) ) . unwrap ( ) ;
244
- } ) ;
245
- }
226
+ // if args.full_output {
227
+ // sample_id_map
228
+ // .iter()
229
+ // .filter(|(key, _)| !hit_seq_set.contains(key))
230
+ // .for_each(|(_, value)| {
231
+ // let dna_id = trim_pair_info(&value.0); // 假设 key 是 &str 类型
232
+ // let output_line = format!(
233
+ // "U\t{}\t0\t{}\t{}\n",
234
+ // dna_id,
235
+ // value.1,
236
+ // if value.3.is_none() { "" } else { " |:| " }
237
+ // );
238
+
239
+ // writer.write_all(output_line.as_bytes()).unwrap();
240
+ // });
241
+ // }
246
242
247
243
let mut sample_taxon_counts: HashMap <
248
244
u64 ,
0 commit comments