Skip to content

Commit

Permalink
Added warning when no reads pass filterAndTrim
Browse files Browse the repository at this point in the history
  • Loading branch information
bcallah authored and bcallah committed Aug 13, 2017
1 parent 3271207 commit 28c4684
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions R/filter.R
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ filterAndTrim <- function(fwd, filt, rev=NULL, filt.rev=NULL, compress=TRUE,
mc.cores=ncores, mc.silent=TRUE)
}
colnames(rval) <- basename(fwd)
if(all(rval["reads.out",]==0)) {
warning("No reads passed the filter. Please revisit your filtering parameters.")
} else if(any(rval["reads.out",]==0)) {
message("Some input samples had no reads pass the filter.")
}
return(invisible(t(rval)))
}
#' Filter and trim a fastq file.
Expand Down

0 comments on commit 28c4684

Please sign in to comment.