Home >
Community >
When using cutadapt, can I specify an R2 adapter as optional when I have a required R1 adapter?
Upvote
22
Downvote
+ Bioinformatics
+ Sequencing
Posted by
Adlai Armundsen
When using cutadapt, can I specify an R2 adapter as optional when I have a required R1 adapter?
This is not possible in a single cutadapt call, but can be done fairly seamlessly with a pipe between two calls and with cutadapt's interleaving feature. (Thanks to the author for help with this.)
Giving the R2 3' adapter to one cutadapt command and interleaving the read pairs to piped output, a second cutadapt command can take that interleaved output and use both of R1's adapters as a linked adapter:
cutadapt -A GGGGGGGG --interleaved example.R{1,2}.fastq | \
cutadapt -a "^AAAAAAAA...TTTTTTTT" --interleaved --discard-untrimmed -o out.R1.fastq -p out.R2.fastq -
Now I can add other filters to the second call.
An additional read pair that should be filtered:
R1:
@read4 would be kept but R2 is too short
AAAAAAAACAATTTTTACTCTAGAAATGTCTGTGCTCATCACCCCGACACCGAATAGCTATGACTCAC
+
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
This is not possible in a single cutadapt call, but can be done fairly seamlessly with a pipe between two calls and with cutadapt's interleaving feature. (Thanks to the author for help with this.)
Giving the R2 3' adapter to one cutadapt command and interleaving the read pairs to piped output, a second cutadapt command can take that interleaved output and use both of R1's adapters as a linked adapter:
cutadapt -A GGGGGGGG --interleaved example.R{1,2}.fastq | \cutadapt -a "^AAAAAAAA...TTTTTTTT" --interleaved --discard-untrimmed -o out.R1.fastq -p out.R2.fastq -
Now I can add other filters to the second call.
An additional read pair that should be filtered:
R1:
@read4 would be kept but R2 is too shortAAAAAAAACAATTTTTACTCTAGAAATGTCTGTGCTCATCACCCCGACACCGAATAGCTATGACTCAC+FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
This is not possible in a single cutadapt call, but can be done fairly seamlessly with a pipe between two calls and with cutadapt's interleaving feature. (Thanks to the author for help with this.)
Giving the R2 3' adapter to one cutadapt command and interleaving the read pairs to piped output, a second cutadapt command can take that interleaved output and use both of R1's adapters as a linked adapter:
Now I can add other filters to the second call.
An additional read pair that should be filtered:
R1:
R2:
I can now give a minimum length that applies to both in each pair:
With that I get read1 and read3 in the output, as intended.
This is not possible in a single cutadapt call, but can be done fairly seamlessly with a pipe between two calls and with cutadapt's interleaving feature. (Thanks to the author for help with this.)
Giving the R2 3' adapter to one cutadapt command and interleaving the read pairs to piped output, a second cutadapt command can take that interleaved output and use both of R1's adapters as a linked adapter:
Now I can add other filters to the second call.
An additional read pair that should be filtered:
R1:
R2:
I can now give a minimum length that applies to both in each pair:
With that I get read1 and read3 in the output, as intended.
More
VOTE