Started the kotlin track
This commit is contained in:
28
kotlin/rna-transcription/README.md
Normal file
28
kotlin/rna-transcription/README.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# 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`
|
||||
|
||||
|
||||
|
||||
## Source
|
||||
|
||||
Rosalind [http://rosalind.info/problems/rna](http://rosalind.info/problems/rna)
|
||||
|
||||
## Submitting Incomplete Solutions
|
||||
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
28
kotlin/rna-transcription/build.gradle
Normal file
28
kotlin/rna-transcription/build.gradle
Normal file
@@ -0,0 +1,28 @@
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.2.40'
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'kotlin'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
|
||||
testCompile 'junit:junit:4.12'
|
||||
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
|
||||
}
|
||||
test {
|
||||
testLogging {
|
||||
exceptionFormat = 'full'
|
||||
events = ["passed", "failed", "skipped"]
|
||||
}
|
||||
}
|
@@ -0,0 +1 @@
|
||||
fun transcribeToRna(dna: String): String = ""
|
@@ -0,0 +1,45 @@
|
||||
import org.junit.Test
|
||||
import org.junit.Ignore
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
class RnaTranscriptionTest {
|
||||
|
||||
/*
|
||||
In Kotlin functions can be declared at top level in a file, meaning
|
||||
you do not need to create a class to hold a function, like languages
|
||||
such as Java, C# or Scala.
|
||||
|
||||
http://kotlinlang.org/docs/reference/functions.html#function-scope
|
||||
|
||||
*/
|
||||
|
||||
@Test
|
||||
fun cytosineComplementIsGuanine() {
|
||||
assertEquals("G", transcribeToRna("C"))
|
||||
}
|
||||
|
||||
@Ignore
|
||||
@Test
|
||||
fun guanineComplementIsCytosine() {
|
||||
assertEquals("C", transcribeToRna("G"))
|
||||
}
|
||||
|
||||
@Ignore
|
||||
@Test
|
||||
fun thymineComplementIsAdenine() {
|
||||
assertEquals("A", transcribeToRna("T"))
|
||||
}
|
||||
|
||||
@Ignore
|
||||
@Test
|
||||
fun adenineComplementIsUracil() {
|
||||
assertEquals("U", transcribeToRna("A"))
|
||||
}
|
||||
|
||||
@Ignore
|
||||
@Test
|
||||
fun rnaTranscription() {
|
||||
assertEquals("UGCACCAGAAUU", transcribeToRna("ACGTGGTCTTAA"))
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user