I have a fasta file with multiple headers and want to get reverse complement sequences.
I usually use FASTX-TOOLKIT, but I want to learn how to do with linux commands.
I tried it using 'awk' and 'if' something like below, but I got a tedious result.
$L and "$L" there is no difference
while read L: the programs reads one line (the header), we print the line; we read the very next line into L; we print the last L, we reverse and translate it.
Thank you for the answer! However, the code didn't work because gsubs serially change the sequences. Firstly. all A's are turned to T's, then second 'gsub' change them back to A's. So finally, all the sequences become a pool of A's and G's. Can I use gsub to change multiple strings at once?
This is the kind of thing one shouldn't bother doing with awk or similar tools. Sure, you can come up with a solution, but why bother?
I have this script for quick rev comp, but it assumes pure sequence as input (no headers).