Thank you so much! That helps.
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.
1 answer
You are NOT using the official software repo that is hosted on SF. Here is the link for that.
You are also using a 2 yr old version of BBMap suite. bbduk2 was included/supported in that version (current BBMap is at v.38.01 and does not have bbduk2). I suggest that you switch to using the software from SourceForge.
There are adapters on both ends of the fragment being sequenced. Sequencing primer is located at a position where the first base sequenced is from the insert. So generally you should worry about adapters sequence being present only on 3'-end of the read.
for anyone reading this in the future: https://emea.support.illumina.com/bulletins/2016/04/adapter-trimming-why-are-adapter-sequences-trimmed-from-only-the--ends-of-reads.html
Log in to answer this question.
Couple of questions.
bbduk2is 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.