Skip to content

Commit

Permalink
solved the first problem
Browse files Browse the repository at this point in the history
  • Loading branch information
serialhex committed Apr 2, 2013
0 parents commit a2dda9e
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .gitignore
@@ -0,0 +1,10 @@
/target
/lib
/classes
/checkouts
pom.xml
*.jar
*.class
.lein-deps-sum
.lein-failures
.lein-plugins
13 changes: 13 additions & 0 deletions README.md
@@ -0,0 +1,13 @@
# rosalind

A Clojure library designed to ... well, that part is up to you.

## Usage

FIXME

## License

Copyright © 2013 FIXME

Distributed under the Eclipse Public License, the same as Clojure.
1 change: 1 addition & 0 deletions data/rosalind_dna.txt
@@ -0,0 +1 @@
ATATTCTAAGTTCCCGCACTATCTTCTAACCCGACTACGGGACCGGCATACGACCACACCCTCTCTTATACATGGCGGTTCTGACCATTGTTGATGCCTCTCTTGATACCGCAGAACGGAATCTAAGCCCGCGACAACTTATGTCGGCCCCAAGGGCATGGCCAGGCTTTTTATCAGTTACATTACATTGGAATAGGCATCTGCGGCGAGTCACTCTCGTGTCTACGGTCCGCTTCGACGAGGTTTGCCTTTGCCGGTCTCGGACGAATATCTATCGAGAATCATGCTGGACTTAACTCTATGAGTGGTCGTTAACACGCAACTTAAAACCAAAGACTAAAGGAATTGCCGTTGCATACTCGGAGATACTAACCACGACAAGATTTAGGATCGCTCCTGTCGGGTCATTACTGATTGGTTAGTGAGATTTCGACTCTTTGAGAAGAGCACTTTACTTAAGTCGCCGGTGACGTCATCACCTCAGCCATATAATAGGTACATTTTTCCGATCTCGGTGCTGGACGTCACACGCGGTTGTAGTGAGACGACGAGAATGGACTCAGTCAGAAGCTATTAACTGCTTGACACGCCCTCGACCTGGTGCCGAAAAAGTGAACTCTGTTTTGATTTTTATAAAGGGATCACGGTTTCAAAGATCCTGCTCTCTGCCTATGAACGTCATTCTTAATGCAGAGATTTACAGATGAGACGATGTAGCGGCGGCACCTAATACTGTATAGCATACCGGTGGCAGCAAATCTGTATGCGATGCCATCTGGGCCAGCTATATATCACGATGTTCTAGATAGGAGTTGCAACACGGACTCGACATCACTACGAATACAAAACCATATTATAGTCTAGCATTGAATGCTTGGAATTACTCCTAGAACTAGCCCGCACGGTATGTGGCAAAGG
3 changes: 3 additions & 0 deletions doc/intro.md
@@ -0,0 +1,3 @@
# Introduction to rosalind

TODO: write [great documentation](http://jacobian.org/writing/great-documentation/what-to-write/)
7 changes: 7 additions & 0 deletions project.clj
@@ -0,0 +1,7 @@
(defproject rosalind "0.1.0"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.4.0"]]
:main rosalind.core)
24 changes: 24 additions & 0 deletions src/rosalind/basics.clj
@@ -0,0 +1,24 @@
(ns rosalind.basics)

(defn dna-counter-fn
"This actually does the counting"
[dna cnt]
(loop [d dna
c cnt]
(let [l (first d)
r (rest d)]
(case l
\A (def h (assoc c :A (+ 1 (:A c))))
\G (def h (assoc c :G (+ 1 (:G c))))
\C (def h (assoc c :C (+ 1 (:C c))))
\T (def h (assoc c :T (+ 1 (:T c))))
nil)
(if (empty? r)
h
(recur r h)))))

(defn dna-count
"Counts DNA Neucleotides"
[dna]
(let [h (dna-counter-fn dna {:A 0 :C 0 :T 0 :G 0})]
[(:A h) (:C h) (:G h) (:T h)]))
11 changes: 11 additions & 0 deletions src/rosalind/core.clj
@@ -0,0 +1,11 @@
(ns rosalind.core)

(defn foo
"I don't do a whole lot."
[x]
(println x "Hello, World!"))

(defn -main
"Main entry point"
[]
(foo "oh bother..."))
9 changes: 9 additions & 0 deletions test/rosalind/basics_test.clj
@@ -0,0 +1,9 @@
(ns rosalind.basics-test
(:use clojure.test
rosalind.basics))

(deftest a-test
(testing "DNA counting stuff"
(is (=
[20 12 17 21]
(dna-count "AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC")))))
7 changes: 7 additions & 0 deletions test/rosalind/core_test.clj
@@ -0,0 +1,7 @@
(ns rosalind.core-test
(:use clojure.test
rosalind.core))

(deftest a-test
(testing "FIXME, I fail."
(is (= 0 0))))

0 comments on commit a2dda9e

Please sign in to comment.