Greetings Lindsay,
I would take a subset of the raw reads (before running cutadapt) and manually inspect them. I will try and find where the key elements (i.e., barcodes, cutsite, adapters) are in the FASTQ files. For example, if the library prep uses a
PstI-
MspI double digest with in-line barcodes, we expect the forward read to start with the barcode followed by the TGCAG of the
PstI (see section 4.1.1 of the
Stacks Manual for some examples). Compare those first few bases of the putative barcode against your list of barcodes to make sure they match, check for any differences in barcode lengths, verify that the enzymes are in the correct orientation (i.e.,
PstI in the forward and
MspI in the reverse read), etc. Similarly, look for the presence of adapters to confirm that the trim is necessary. Any patterns here will give you an idea of the exact issue you encounter and how to handle it. It might be possible to address some these issues by changing the parameters in process_radtags; however, in other cases might reflect larger problems with the library preparation and sequencing. Nonetheless, keep a close eye on the barcodes, since they seem to be the main reason reads are discarded.
Afterwards, do the same thing with a subset of reads after processing with cutadapt. Are the barcodes and enzyme cutsites still in the expected location? Given that the main reason for discarding the read is the lack of barcodes, I would confirm that the trimming hasn't removed the barcodes for some reason. In my experience, if using in-line barcodes, the Illumina adapters mainly "eat" into the usable length of the sequencing read, and tend not to interfere with barcodes/cutsites given their position in the reads.
In summary, I think it is important to raw check the reads to make sure they follow the expected configuration as specified by the library prep. This might help you identify if it is just an issue addressable with just changing a parameter in the software, or if the problem is due to some larger problem in library preparation.
Thanks,
Angel