In DNA, the reverse complement is the sequence that is created by reversing the order of the nucleotides and then replacing each nucleotide with its complementary base. Bases A and T are each others complement, and so are bases G and C. For example, the reverse complement of the DNA sequence ATCG is CGAT.
The reverse complement is important in many biological processes, including DNA replication and RNA transcription. During DNA replication, the two strands of DNA are separated, and each strand serves as a template for the synthesis of a new complementary strand. During RNA transcription, the DNA template is read in a 5’ to 3’ direction, and the RNA polymerase synthesizes an RNA molecule in the opposite direction, from 3’ to 5’. The RNA molecule is then used as a template for protein synthesis.
Write a Unix pipeline that combines multiple commands to transform a list of DNA sequences into their reverse complement. Only submit a solution for what is missing in place of the three dots:
cat dna.txt | ...
Reversing lines of text
Although it is possible to reverse lines of text using the commands that were covered in the lectures, there is a far easier solution. Try to search online for a Unix command that has been specifically created for this task.