I need to invert a DNA text string by changing all numbers from A to T, from T to A, C-> G and G-> C.
Can I elegantly handle this in sed (or on another command line) without a chain of chains of global replacement commands?
this is how you do it with sed
$ echo "test ATCG GATC test" | sed 'y/ATCG/TAGC/' test TAGC CTAG test
use tr.cat file | tr ATCG TAGC