|
|
|
|
|
|
|
|
|
|
|
# RNA Transcription |
|
|
|
|
|
|
|
|
|
|
|
Given a DNA strand, return its RNA complement (per RNA transcription). |
|
|
|
|
|
|
|
|
|
|
|
Both DNA and RNA strands are a sequence of nucleotides. |
|
|
|
|
|
|
|
|
|
|
|
The four nucleotides found in DNA are adenine (**A**), cytosine (**C**), |
|
|
|
|
|
guanine (**G**) and thymine (**T**). |
|
|
|
|
|
|
|
|
|
|
|
The four nucleotides found in RNA are adenine (**A**), cytosine (**C**), |
|
|
|
|
|
guanine (**G**) and uracil (**U**). |
|
|
|
|
|
|
|
|
|
|
|
Given a DNA strand, its transcribed RNA strand is formed by replacing |
|
|
|
|
|
each nucleotide with its complement: |
|
|
|
|
|
|
|
|
|
|
|
* `G` -> `C` |
|
|
|
|
|
* `C` -> `G` |
|
|
|
|
|
* `T` -> `A` |
|
|
|
|
|
* `A` -> `U` |
|
|
|
|
|
|
|
|
|
|
|
## Hints |
|
|
|
|
|
For this exercise the following F# feature comes in handy: |
|
|
|
|
|
- [Match Expressions](https://fsharpforfunandprofit.com/posts/match-expression/) While this can be solved using a dictionary, using a match expression is more idiomatic. |
|
|
|
|
|
|
|
|
|
|
|
## Running the tests |
|
|
|
|
|
|
|
|
|
|
|
To run the tests, run the command `dotnet test` from within the exercise directory. |
|
|
|
|
|
|
|
|
|
|
|
## Autoformatting the code |
|
|
|
|
|
|
|
|
|
|
|
F# source code can be formatted with the [Fantomas](https://github.com/fsprojects/fantomas) tool. |
|
|
|
|
|
|
|
|
|
|
|
After installing it with `dotnet tool restore`, run `dotnet fantomas .` to format code within the current directory. |
|
|
|
|
|
|
|
|
|
|
|
## Further information |
|
|
|
|
|
|
|
|
|
|
|
For more detailed information about the F# track, including how to get help if |
|
|
|
|
|
you're having trouble, please visit the exercism.io [F# language page](http://exercism.io/languages/fsharp/resources). |
|
|
|
|
|
|
|
|
|
|
|
## Source |
|
|
|
|
|
|
|
|
|
|
|
Hyperphysics [http://hyperphysics.phy-astr.gsu.edu/hbase/Organic/transcription.html](http://hyperphysics.phy-astr.gsu.edu/hbase/Organic/transcription.html) |
|
|
|
|
|
|