DNA to Protein Toolkit
0 of 4 stages done
  1. 1 Profile the fragment
  2. 2 Transcribe and mirror
  3. 3 Translate to protein
  4. 4 Weigh the protein
STAGE 2 OF 4

Transcribe and mirror

Code not passed yet Explanation needed Self-check
You are browsing as a guest: read the stage and run code freely. To be graded and save your progress, sign in or create an account →

THE BRIEF

The first step of the central dogma is transcription: the cell copies a gene into messenger RNA. In RNA the base thymine (T) is replaced by uracil (U). DNA is also double stranded, and the other strand is the reverse complement of the one you were given, so genes can be read from either strand.

Your task. For the DNA fragment you are given, print two lines:

  1. The RNA transcript of the given strand (replace every T with U).
  2. The reverse complement of the given strand: swap every base for its partner (A/T, C/G) and then reverse the whole string.

Input. One line: the DNA fragment (letters A, C, G, T only).

Output. Two lines.

GIVEN INPUT

Your code reads this from standard input (input() or sys.stdin), both here and when it is graded.

ATGGCCATGGCGCCCAGAACTGAGATCAATAGTACCCGTATTAACGGGTGA

EXPECTED OUTPUT FOR THIS INPUT

AUGGCCAUGGCGCCCAGAACUGAGAUCAAUAGUACCCGUAUUAACGGGUGA
TCACCCGTTAATACGGGTACTATTGATCTCAGTTCTGGGCGCCATGGCCAT

SKILLS YOU'LL USE

Stuck? These bank problems practise the same techniques.

Write your code

.ipynb
Shift + Enter runs a cell. Your notebook runs and is saved in this browser only; nothing is sent to us until you submit in step 3.

Check your understanding

A quick self-check, marked right here in your browser. It is not graded or saved.

1.

What is the reverse complement of the strand 5'-ATGC-3'?

2.

During transcription, which RNA base takes the place of thymine?

Explain and submit

Describe how you built the reverse complement and why you need to reverse the string as well as swap the bases.

Submitting sends the code in your solution cell and this explanation. The code is checked on our server against the given input and hidden tests. The stage is complete when the code passes and the explanation has at least 20 words.

You can look ahead; come back to finish this stage.