Last active
August 29, 2015 14:10
-
-
Save taisukeoe/d63cd82c2d7a5f8a1cd6 to your computer and use it in GitHub Desktop.
for rosalind
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package hemplant.rosalind.dna | |
sealed abstract trait Nucleotide{ | |
def complementary:Nucleotide = Nucleotide.complementary(this) | |
} | |
case object A extends Nucleotide | |
case object T extends Nucleotide | |
case object G extends Nucleotide | |
case object C extends Nucleotide | |
object Nucleotide{ | |
def apply:Char => Nucleotide = { | |
case 'A' => A | |
case 'T' => T | |
case 'G' => G | |
case 'C' => C | |
} | |
def complementary:Nucleotide => Nucleotide = { | |
case A => T | |
case G => C | |
case C => G | |
case T => A | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment