I want to use bbduk to remove adapters from my paired end reads. I am using my own file with adapters, but I have to specify if I want to use that file as lref (to trim the left side / 5' ends) or rref (to trim the right side / 3' ends). The following is my code:
bbduk2 in1=sample_R.fq in2=sample_L.fq out1=sample_R_trimmed.fq out2=sample_L_trimmed.fq lref=/path_to_file_with_adapters.fa k=23 mink=11 hdist=1 tbo tpe
I don't understand why I have to specify lref or rref, and which one to choose. Are adapters only found on one side of the reads?
I ran the command with both rref and lref. Both methods produced two output files of smaller sizes than the original (so something was trimmed using either method), but only rref produced outputs that were of the same size (meaning that both the left and right reads were kept in pairs). I don't understand why this is so.
Couple of questions.
bbduk2
is a spelling error above. Can you provide a reference to thelref=
? I don't recollect seeing that option before.ktrim=
orqtrim=
) in your command above.bbduk2 is almost the same as bbduk but can run several operations simultaneously (and I will eventually want to do that). There doesn't seem to be a simple "ref" option: instead there are fref (file used for filtering), rref (for trimming right), lref (for trimming left), etc. Here is a good summary of bbduk2 parameters: https://github.com/BioInfoTools/BBMap/blob/master/sh/bbduk2.sh
The library is not anything special (I'm just new at this) - it is a stranded Illumina truseq cDNA library for paired end reads. I wasn't aware that I would only find adapters on the 3'-end. In that case, I would only need to do right trimming. Do you have a reference for this? I thought Ilumina put adapters on both sides, which is why I was confused as to why I had to pick right or left trimming.
Also, I tried to run the command using ktrim but got errors saying that I had to specify rref or lref instead.