I have a DNA sequence for which I would like to quickly find the reverse complement. Is there a quick way of doing this on the bash command line using only GNU tools?
Asked
Active
Viewed 7,451 times
3 Answers
32
Thanks to Manu Tamminen for this solution:
echo ACCTTGAAA | tr ACGTacgt TGCAtgca | rev
Chris_Rands
- 3,948
- 12
- 31
winni2k
- 2,266
- 11
- 28
-
And if I want to put it into a variable instead of echo it? – Adi Ro Jan 06 '20 at 09:44
-
1I would enclose the code in $() and assign to a variable assuming you are using a recent version of bash. – winni2k Jan 06 '20 at 11:35
-
that works thanks! – Adi Ro Jan 09 '20 at 09:29
2
You may either install the emboss package (http://emboss.sourceforge.net/download/) and use the revseq program. It contains many useful command-line programs such as the pairwise alignment tool needle.
thomas duge de bernonville
- 472
- 2
- 8