Skip to content

Commit

Permalink
fix quality score calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
wdecoster committed Apr 4, 2023
1 parent 4e7c162 commit dfb31cf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "chopper"
version = "0.4.0"
version = "0.5.0"
authors = ["wdecoster <decosterwouter@gmail.com>"]
edition = "2018"

Expand Down
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ where
let read_len = record.seq().len();
// If a read is shorter than what is to be cropped the read is dropped entirely (filtered out)
if args.headcrop + args.tailcrop < read_len {
let average_quality = ave_qual(record.qual());
let average_quality =
ave_qual(&record.qual().iter().map(|i| i - 33).collect::<Vec<u8>>());
if average_quality >= args.minqual
&& average_quality <= args.maxqual
&& read_len >= args.minlength
Expand Down

0 comments on commit dfb31cf

Please sign in to comment.