Started the kotlin track

This commit is contained in:
2018-06-21 08:54:16 -05:00
parent ce5ea92f79
commit c0f0c379fa
446 changed files with 3085 additions and 574 deletions

View 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.

View 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"]
}
}

View File

@@ -0,0 +1 @@
fun transcribeToRna(dna: String): String = ""

View File

@@ -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"))
}
}