Currently I have two sequences(adapters) need to be remove. I used Cutadapt --time 2
option to run 2 rounds of trimming. However, from the Cutadapt documentation, I saw it mentions a drawback in the session of Recipes and FAQ/Remove more than one adapter :
The problem is that it could happen that one adapter is found twice
I come up with an example here: Assuming that we have to remove ADAPTER and NOTNEED in the following raw data.
sequenceAADAPTERDAPTERsequenceNOTNEEDsequence
I used the following command two perform two runs:
cutadapt -b ADAPTER -b NOTNEED -n 2 -o trim_sequence.fastq raw_data.fastq
So I believe first run is to remove ADAPTER, and the second run is to remove NOTNEED
My question is: do the bases shift after trimming the ADAPTER in the first run? If it does, the cutadapt would detect ADAPTER again when it processes the second run of trimming NOTNEED. How do I safely remove multiple adapters?
Normally trimming programs will remove entire sequence to the right of where the adapter is found so only the first adapter sequence would be needed. At least that is how
bbduk.sh
from BBMap suite will work inktrim=r
mode. A guide is available. You can also specify multiple adapter sequences on command line withliteral=seq1,seq2,seq3..
when trimming.it helps to post some example data and expected output instead of problem description. Following is an dummy data (doesn't exist):
input sequence:
with multiple rounds of trimming:
-n 4
was not necessary. Just to show that any number beyond number of adapters do not change the outputBut you can also use linked adapter as follows:
Coming to your queries:
Do not know what you mean by shift here. If regular 5' adapter is provided, all the upstream sequence {wrt 5' adapter) including adapter is trimmed. If regular 3' adapter is provided, all down stream sequence (wrt 3' adapter) is trimmed. No base repositioning happens, it's only trimming upstread and downstream trimming depending on the options furnished.
Order of execution (trimming in this case) is the order of appearance of options (-a, -g etc). In each round (time), only first found adapter is removed (as in the order of appearance)
There are multiple ways and multiple tools. Unless you provide example input and expected output, it is difficult to say.