Skip to content

Commit 073fe50

Browse files
Merge pull request #2 from 10XDev/better_logging
error out if the output is going to be empty
2 parents 5b7ed16 + 5623e93 commit 073fe50

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@ fn _main(cli_args: Vec<String>) {
170170
tmp_bams.push(&c.out_bam_file);
171171
}
172172

173+
if metrics.kept_reads == 0 {
174+
error!("Zero alignments were kept. Does your BAM contain the cell barcodes and/or tag you chose?");
175+
process::exit(2);
176+
}
177+
173178
// just copy the temp file over
174179
if cores == 1 {
175180
fs::copy(tmp_bams[0], out_bam_file).unwrap();
@@ -426,7 +431,6 @@ mod tests {
426431
let fh = fs::File::open(&out_file).unwrap();
427432
let d = sha256_digest(fh).unwrap();
428433
let d = HEXUPPER.encode(d.as_ref());
429-
println!("{}", d);
430434
assert_eq!(d, "65061704E9C15BFC8FECF07D1DE527AF666E7623525262334C3FDC62F366A69E");
431435
}
432436
}

0 commit comments

Comments
 (0)