From 8aa63770b765b0dac4af64a309b7a3c4ef0e5601 Mon Sep 17 00:00:00 2001 From: gmagoon Date: Mon, 24 Feb 2020 16:14:19 -0500 Subject: [PATCH] improve primer matching with orient=TRUE this allows identification of fwd+rev match on reverse complement in situations where a fwd-only match is found on the original read sequence --- R/filter.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/filter.R b/R/filter.R index 2214163..d34446f 100644 --- a/R/filter.R +++ b/R/filter.R @@ -169,6 +169,7 @@ removePrimers <- function(fn, fout, # If orient, replace non-matches with rc matches where they exist if(orient) { flip <- !hits.fwd & hits.fwd.rc + if(has.rev && require.rev) flip <- flip | (!hits.rev & hits.rev.rc) if(any(flip) && verbose) cat(sum(flip), "sequences out of", length(flip), "are being reverse-complemented.\n") fq[flip] <- fq.rc[flip] match.fwd[flip] <- match.fwd.rc[flip]