Skip to content

Commit ce38147

Browse files
authored
Add RNA Transcription exercise (#78)
1 parent 627833f commit ce38147

File tree

13 files changed

+245
-0
lines changed

13 files changed

+245
-0
lines changed

config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,14 @@
217217
"practices": [],
218218
"prerequisites": [],
219219
"difficulty": 8
220+
},
221+
{
222+
"slug": "rna-transcription",
223+
"name": "RNA Transcription",
224+
"uuid": "71556996-0d47-4c34-bd8c-373d55ee03fd",
225+
"practices": [],
226+
"prerequisites": [],
227+
"difficulty": 2
220228
}
221229
]
222230
},
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Instructions
2+
3+
Your task is determine the RNA complement of a given DNA sequence.
4+
5+
Both DNA and RNA strands are a sequence of nucleotides.
6+
7+
The four nucleotides found in DNA are adenine (**A**), cytosine (**C**), guanine (**G**) and thymine (**T**).
8+
9+
The four nucleotides found in RNA are adenine (**A**), cytosine (**C**), guanine (**G**) and uracil (**U**).
10+
11+
Given a DNA strand, its transcribed RNA strand is formed by replacing each nucleotide with its complement:
12+
13+
- `G` -> `C`
14+
- `C` -> `G`
15+
- `T` -> `A`
16+
- `A` -> `U`
17+
18+
~~~~exercism/note
19+
If you want to look at how the inputs and outputs are structured, take a look at the examples in the test suite.
20+
~~~~
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Introduction
2+
3+
You work for a bioengineering company that specializes in developing therapeutic solutions.
4+
5+
Your team has just been given a new project to develop a targeted therapy for a rare type of cancer.
6+
7+
~~~~exercism/note
8+
It's all very complicated, but the basic idea is that sometimes people's bodies produce too much of a given protein.
9+
That can cause all sorts of havoc.
10+
11+
But if you can create a very specific molecule (called a micro-RNA), it can prevent the protein from being produced.
12+
13+
This technique is called [RNA Interference][rnai].
14+
15+
[rnai]: https://admin.acceleratingscience.com/ask-a-scientist/what-is-rnai/
16+
~~~~
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"authors": [
3+
"Steffan153"
4+
],
5+
"files": {
6+
"solution": [
7+
"rna-transcription.sql"
8+
],
9+
"test": [
10+
"rna-transcription_test.sql"
11+
],
12+
"example": [
13+
".meta/example.sql"
14+
],
15+
"editor": [
16+
"data.csv"
17+
]
18+
},
19+
"blurb": "Given a DNA strand, return its RNA Complement Transcription.",
20+
"source": "Hyperphysics",
21+
"source_url": "https://web.archive.org/web/20220408112140/http://hyperphysics.phy-astr.gsu.edu/hbase/Organic/transcription.html"
22+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
UPDATE "rna-transcription"
2+
SET result = REPLACE(
3+
REPLACE(
4+
REPLACE(
5+
REPLACE(
6+
REPLACE(dna, 'A', 'U'),
7+
'T', 'A'
8+
),
9+
'C', 'Z'
10+
),
11+
'G', 'C'
12+
),
13+
'Z', 'G'
14+
);
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This is an auto-generated file.
2+
#
3+
# Regenerating this file via `configlet sync` will:
4+
# - Recreate every `description` key/value pair
5+
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
6+
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
7+
# - Preserve any other key/value pair
8+
#
9+
# As user-added comments (using the # character) will be removed when this file
10+
# is regenerated, comments can be added via a `comment` key.
11+
12+
[b4631f82-c98c-4a2f-90b3-c5c2b6c6f661]
13+
description = "Empty RNA sequence"
14+
15+
[a9558a3c-318c-4240-9256-5d5ed47005a6]
16+
description = "RNA complement of cytosine is guanine"
17+
18+
[6eedbb5c-12cb-4c8b-9f51-f8320b4dc2e7]
19+
description = "RNA complement of guanine is cytosine"
20+
21+
[870bd3ec-8487-471d-8d9a-a25046488d3e]
22+
description = "RNA complement of thymine is adenine"
23+
24+
[aade8964-02e1-4073-872f-42d3ffd74c5f]
25+
description = "RNA complement of adenine is uracil"
26+
27+
[79ed2757-f018-4f47-a1d7-34a559392dbf]
28+
description = "RNA complement"
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"exercise": "rna-transcription",
3+
"cases": [
4+
{
5+
"uuid": "b4631f82-c98c-4a2f-90b3-c5c2b6c6f661",
6+
"description": "Empty RNA sequence",
7+
"property": "toRna",
8+
"input": {
9+
"dna": ""
10+
},
11+
"expected": ""
12+
},
13+
{
14+
"uuid": "a9558a3c-318c-4240-9256-5d5ed47005a6",
15+
"description": "RNA complement of cytosine is guanine",
16+
"property": "toRna",
17+
"input": {
18+
"dna": "C"
19+
},
20+
"expected": "G"
21+
},
22+
{
23+
"uuid": "6eedbb5c-12cb-4c8b-9f51-f8320b4dc2e7",
24+
"description": "RNA complement of guanine is cytosine",
25+
"property": "toRna",
26+
"input": {
27+
"dna": "G"
28+
},
29+
"expected": "C"
30+
},
31+
{
32+
"uuid": "870bd3ec-8487-471d-8d9a-a25046488d3e",
33+
"description": "RNA complement of thymine is adenine",
34+
"property": "toRna",
35+
"input": {
36+
"dna": "T"
37+
},
38+
"expected": "A"
39+
},
40+
{
41+
"uuid": "aade8964-02e1-4073-872f-42d3ffd74c5f",
42+
"description": "RNA complement of adenine is uracil",
43+
"property": "toRna",
44+
"input": {
45+
"dna": "A"
46+
},
47+
"expected": "U"
48+
},
49+
{
50+
"uuid": "79ed2757-f018-4f47-a1d7-34a559392dbf",
51+
"description": "RNA complement",
52+
"property": "toRna",
53+
"input": {
54+
"dna": "ACGTGGTCTTAA"
55+
},
56+
"expected": "UGCACCAGAAUU"
57+
}
58+
]
59+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
DROP TABLE IF EXISTS "rna-transcription";
2+
CREATE TABLE "rna-transcription" (
3+
"dna" TEXT,
4+
"result" TEXT
5+
);
6+
7+
.mode csv
8+
.import ./data.csv rna-transcription
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"",""
2+
"C",""
3+
"G",""
4+
"T",""
5+
"A",""
6+
"ACGTGGTCTTAA",""
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- Schema: CREATE TABLE "rna-transcription" ("dna" TEXT, "result" TEXT);
2+
-- Task: update the rna-transcription table and set the result based on the dna field.

0 commit comments

Comments
 (0)