Skip to content

Commit

Permalink
Update filter.R
Browse files Browse the repository at this point in the history
Fixes #2067
  • Loading branch information
benjjneb committed Jan 8, 2025
1 parent 7714487 commit 10d3bf2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/filter.R
Original file line number Diff line number Diff line change
Expand Up @@ -1097,15 1097,15 @@ fastqPairedFilter <- function(fn, fout, maxN = c(0,0), truncQ = c(2,2), truncLen
}

# Remove low complexity
if(rm.lowcomplex[[1]] > 0 && rm.lowcomplex[[2]] > 0) {
if(rm.lowcomplex[[1]] && rm.lowcomplex[[2]]) {
is.lowc <- (seqComplexity(sread(fqF), ...) < rm.lowcomplex[[1]])
is.lowc <- is.lowc | (seqComplexity(sread(fqF), ...) < rm.lowcomplex[[2]])
is.lowc <- is.lowc | (seqComplexity(sread(fqR), ...) < rm.lowcomplex[[2]])
} else if(rm.lowcomplex[[1]] && !rm.lowcomplex[[2]]) {
is.lowc <- (seqComplexity(sread(fqF), ...) < rm.lowcomplex[[1]])
} else if(!rm.lowcomplex[[1]] && rm.lowcomplex[[2]]) {
is.lowc <- (seqComplexity(sread(fqR), ...) < rm.lowcomplex[[2]])
}
if(rm.lowcomplex[[1]] > 0 && rm.lowcomplex[[2]] > 0) {
if(rm.lowcomplex[[1]] || rm.lowcomplex[[2]]) {
fqF <- fqF[!is.lowc]
fqR <- fqR[!is.lowc]
}
Expand Down

0 comments on commit 10d3bf2

Please sign in to comment.