Skip to content

Commit 1876376

Browse files
committed
bugfix dada2 in the case of only one sample with no reads
1 parent e8ff0ce commit 1876376

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/R_scripts/dada2.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ filtering <- filterAndTrim(fwd=fnFs, rev=fnRs, filt=filtFs, filt.rev=filtRs, mul
5555
filter_stats <- filtering
5656

5757
# extract samples with no reads if any
58-
noReads <- rownames(filtering[filtering[,"reads.out"]==0,])
58+
noReads <- rownames(subset(filtering, filtering[,"reads.out"] == 0))
5959
noReads <- sub("_fwd_noPrimers.fastq", "", noReads)
6060
noReads <- sub("_fwd.fastq", "", noReads)
61-
withReads <- rownames(filtering[filtering[,"reads.out"]!=0,])
61+
withReads <- rownames(subset(filtering, filtering[,"reads.out"] != 0))
6262
withReads <- sub("_fwd_noPrimers.fastq", "", withReads)
6363
withReads <- sub("_fwd.fastq", "", withReads)
6464
# if there was primer filtering on fastq before, the filtering table won't have the empty samples,

0 commit comments

Comments
 (0)