This is a test version of Biostars. For the public version, visit https://www.biostars.org.
orient flipped reads - adapter ligation

Hi all,

I am analyzing 2x150bp paired-end amplicons that were amplified using one sample-indexed primer. The illumina adapters were attached using ligation, i.e. half the reads are in flipped orientation.

I am planning to use dada2 after demultiplexing to count individual amplicon variants. However this requires all reads in the same orientation.

Therefore: How do I flip/reverse complement reads which have the 'wrong' orientation (meaning sample barcode on the 3' end)? (preferred with a command line tool)

adapter reads flipped ligation

How do I flip/reverse complement reads which have the 'wrong' orientation

Using reformat.sh from BBMap suite:

reformat.sh -Xmx4g in=selected.fq out=rcomp.fq rcomp=t 

Take a look at other in-line help to check additional options.

Thanks for your quick reply, GenoMax.

Your solution would flip all reads, correct? How can I only select those that are in the wrong orientation? (I know the 5' sequence of "wrong" reads

If you had noticed I had said selected.fq to only choose reads you want to RC. You can get those reads by using another tool bbduk.sh in filter mode (you could also use to to trim data if needed). You can do something like this

bbduk.sh -Xmx2g in=orig.fq literal=5_prime_sequence_you_know restrictleft=NN (replace with length of 5'-sequence + 5) out=stdout.fq outu=save.fq | eformat.sh -Xmx4g in=stdin.fq out=rcomp.fq rcomp=t 

You can then cat save.fq rcomp.fq > all.fq to get the full set back.

BBduk failed for an unknown reason, but I managed to select the correct reads using "je demultiplex" and used reformat.sh to reverse complement

Thx for your help :)

0 answers

No answers yet.

Log in to answer this question.