I use this shell script (I'm not the author) to reverse complement DNA:
alias revcomp="echo 'import sys; print \"\".join([dict(zip(\"ACGTacgt\",\"TGCAtgca\"))[c] for c in sys.argv[::-1]])' | python -"
In the terminal it works perfect just to write
revcomp ATGC which outputs GCAT.
And to just complement, I changed it to
I'm working with some files, where for reasons I'm not in charge for, some bases written as a word. So let's say that one base is called
(askJoeaboutthisone), how would I complement this sequence? I.e. so that AT(askJoeaboutthisone)GC returns CG(askJoeaboutthisone)TA.
In my script each letter is converted, but I wish that (askJoeaboutthisone) is treated as one letter.