Skip to content

Commit 25854f7

Browse files
add rna transcription (#40)
* exercise boilerplate * example solution * format test
1 parent 57fbe7d commit 25854f7

16 files changed

Lines changed: 1794 additions & 0 deletions

config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@
149149
"prerequisites": [],
150150
"difficulty": 3
151151
},
152+
{
153+
"slug": "rna-transcription",
154+
"name": "RNA Transcription",
155+
"uuid": "ae2cde1b-f9e7-4473-88f8-484c3f4349f8",
156+
"practices": [],
157+
"prerequisites": [],
158+
"difficulty": 2
159+
},
152160
{
153161
"slug": "rotational-cipher",
154162
"name": "Rotational Cipher",
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 to 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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
**/*.res.js
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
type dna =
2+
| A
3+
| C
4+
| G
5+
| T
6+
7+
let fromString = s => {
8+
switch s {
9+
| "A" => A
10+
| "C" => C
11+
| "G" => G
12+
| "T" => T
13+
| _ => panic("Invalid DNA base")
14+
}
15+
}
16+
17+
let convert = s => {
18+
switch s {
19+
| A => "U"
20+
| C => "G"
21+
| G => "C"
22+
| T => "A"
23+
}
24+
}
25+
26+
let toRna = dna => dna->String.split("")->Array.map(fromString)->Array.map(convert)->Array.join("")
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let toRna: string => string
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"authors": [
3+
"therealowenrees"
4+
],
5+
"files": {
6+
"solution": [
7+
"src/RnaTranscription.res",
8+
"src/RnaTranscription.resi"
9+
],
10+
"test": [
11+
"tests/RnaTranscription_test.res"
12+
],
13+
"example": [
14+
".meta/RnaTranscription.res",
15+
".meta/RnaTranscription.resi"
16+
]
17+
},
18+
"blurb": "Given a DNA strand, return its RNA complement.",
19+
"source": "Hyperphysics",
20+
"source_url": "https://web.archive.org/web/20220408112140/http://hyperphysics.phy-astr.gsu.edu/hbase/Organic/transcription.html"
21+
}
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: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Exercism
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)