Sha256: 72c0510da1de3e9fe3c7b3d9f9376a54eaa862be076acb00f1155a1da6242af8

Contents?: true

Size: 558 Bytes

Versions: 168

Compression:

Stored size: 558 Bytes

Contents

class RnaTranscription {

    private def dnaMap = ["G":"C","C":"G","T":"A","A":"U"]
    private def rnaMap = ["C":"G","G":"C","A":"T","U":"A"]

    private def transcribe(seq, seqMap) {
        def result = new String()
        seq.split('').each() {
            if ( !seqMap[it] ) {
                throw new IllegalArgumentException()
            }
            result += seqMap[it]
        }
        return result
    }

    def ofDNA(strand) {
        transcribe(strand, dnaMap)
    }

    def ofRNA(strand) {
        transcribe(strand, rnaMap)
    }

}

Version data entries

168 entries across 168 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/groovy/exercises/rna-transcription/Example.groovy
trackler-2.2.1.179 tracks/groovy/exercises/rna-transcription/Example.groovy
trackler-2.2.1.178 tracks/groovy/exercises/rna-transcription/Example.groovy
trackler-2.2.1.177 tracks/groovy/exercises/rna-transcription/Example.groovy
trackler-2.2.1.176 tracks/groovy/exercises/rna-transcription/Example.groovy
trackler-2.2.1.175 tracks/groovy/exercises/rna-transcription/Example.groovy
trackler-2.2.1.174 tracks/groovy/exercises/rna-transcription/Example.groovy
trackler-2.2.1.173 tracks/groovy/exercises/rna-transcription/Example.groovy
trackler-2.2.1.172 tracks/groovy/exercises/rna-transcription/Example.groovy
trackler-2.2.1.171 tracks/groovy/exercises/rna-transcription/Example.groovy
trackler-2.2.1.170 tracks/groovy/exercises/rna-transcription/Example.groovy
trackler-2.2.1.169 tracks/groovy/exercises/rna-transcription/Example.groovy
trackler-2.2.1.167 tracks/groovy/exercises/rna-transcription/Example.groovy
trackler-2.2.1.166 tracks/groovy/exercises/rna-transcription/Example.groovy
trackler-2.2.1.165 tracks/groovy/exercises/rna-transcription/Example.groovy
trackler-2.2.1.164 tracks/groovy/exercises/rna-transcription/Example.groovy
trackler-2.2.1.163 tracks/groovy/exercises/rna-transcription/Example.groovy
trackler-2.2.1.162 tracks/groovy/exercises/rna-transcription/Example.groovy
trackler-2.2.1.161 tracks/groovy/exercises/rna-transcription/Example.groovy
trackler-2.2.1.160 tracks/groovy/exercises/rna-transcription/Example.groovy