File tree 1 file changed +15
-6
lines changed
1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ pub fn annotate_main(
100
100
let mut n = 0u64 ;
101
101
let mut n_written = 0u64 ;
102
102
let mut modu = 10000u64 ;
103
+ let mut skip_warn = 0 ;
103
104
104
105
for r in vcf. records ( ) {
105
106
let mut record = r. expect ( "error reading record" ) ;
@@ -126,14 +127,18 @@ pub fn annotate_main(
126
127
}
127
128
n += 1 ;
128
129
// First check if the variant is *, skip those
129
- if String :: from_utf8_lossy ( record. alleles ( ) [ 1 ] ) == "*" {
130
+ if record. alleles ( ) [ 1 ] [ 0 ] == b'*' {
130
131
let rid = record. rid ( ) . unwrap ( ) ;
131
132
let chrom = std:: str:: from_utf8 ( oheader_view. rid2name ( rid) . unwrap ( ) ) . unwrap ( ) ;
132
- eprintln ! (
133
- "contig {} pos {} alt has * value, skipping annotation, outputting entry as-is" ,
134
- & chrom,
135
- record. pos( ) + 1
136
- ) ;
133
+ // Only warn up to 10 times, just keep count in general
134
+ if skip_warn < 10 {
135
+ eprintln ! (
136
+ "contig {} pos {} alt has * value, skipping annotation, outputting entry as-is" ,
137
+ & chrom,
138
+ record. pos( ) + 1
139
+ ) ;
140
+ }
141
+ skip_warn += 1 ;
137
142
ovcf. write ( & record) . expect ( "failed to write record" ) ;
138
143
continue ;
139
144
}
@@ -193,6 +198,10 @@ pub fn annotate_main(
193
198
1000 * ( n as u128 ) / mili,
194
199
n_written,
195
200
) ;
201
+ eprintln ! (
202
+ "Skipped {} variants with * alt." ,
203
+ skip_warn,
204
+ ) ;
196
205
197
206
/*
198
207
//let ep = std::path::Path::new(&*epaths[0]);
You can’t perform that action at this time.
0 commit comments