Created
June 14, 2010 13:12
-
-
Save timyates/437658 to your computer and use it in GitHub Desktop.
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
(ns user) | |
(defn- reverse-base [base] | |
(let [mapping { :A \T :T \A :G \C :C \G } | |
key (keyword (.toString base))] | |
(key mapping))) | |
(defn reverse-complement [sequence] | |
(let [rev-seq (reverse (.toUpperCase sequence))] | |
(map reverse-base rev-seq))) | |
(println "Reverse complement gives" (reverse-complement "TGAC")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@wmacgyver: This is the code that we're trying to get going:
Output should be: "GGTCA"