Sorry for the delay. We seem to have a small bug in how we process the reverse index reads. Until the next release comes out (end of summerish), here’s what you need to do…
First, you don’t need the primer line in the oligos file since the sequencing primers aren’t actually in the sequence data.
Second, you need to use the reverse complement of the barcode sequence and put it in the second column of the oligos file (not the third).
Third, when you run make.contigs, use findex, not reindex.
So the command would look like this:
mothur “#make.contigs(ffastq=r1.fastq, rfastq=r2.fastq, findex=indices.fastq, oligos=m1.rc_oligos)”
If you have an oligos file that has the Caporasso reverse indices in the third column, the following R code will get you the correct formatting (assuming you’ve removed the primer line):
reverseComp <- function(x) {
rev.x <- paste0(rev(unlist(strsplit(x, ""))), collapse="")
rev.x <- chartr("ATGC", "TACG", rev.x)
return(rev.x)
}
a <- scan(file="my.oligos", sep="\n", what="")
barcodes <- matrix(unlist(strsplit(a, "\t")),ncol=4, byrow=T)
barcodes[,2] <- unlist(lapply(barcodes[,3], reverseComp))
barcodes[,3] <- rep("NONE", nrow(barcodes))
write.table(file="my.rc_oligos", barcodes, row.names=F, col.names=F, quote=F)
The “my.rc_oligos” should be replaced with the name of your oligos file.