Skip to content

Commit a2dda9e

Browse files
committed
solved the first problem
0 parents  commit a2dda9e

File tree

9 files changed

+85
-0
lines changed

9 files changed

+85
-0
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/target
2+
/lib
3+
/classes
4+
/checkouts
5+
pom.xml
6+
*.jar
7+
*.class
8+
.lein-deps-sum
9+
.lein-failures
10+
.lein-plugins

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# rosalind
2+
3+
A Clojure library designed to ... well, that part is up to you.
4+
5+
## Usage
6+
7+
FIXME
8+
9+
## License
10+
11+
Copyright © 2013 FIXME
12+
13+
Distributed under the Eclipse Public License, the same as Clojure.

data/rosalind_dna.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ATATTCTAAGTTCCCGCACTATCTTCTAACCCGACTACGGGACCGGCATACGACCACACCCTCTCTTATACATGGCGGTTCTGACCATTGTTGATGCCTCTCTTGATACCGCAGAACGGAATCTAAGCCCGCGACAACTTATGTCGGCCCCAAGGGCATGGCCAGGCTTTTTATCAGTTACATTACATTGGAATAGGCATCTGCGGCGAGTCACTCTCGTGTCTACGGTCCGCTTCGACGAGGTTTGCCTTTGCCGGTCTCGGACGAATATCTATCGAGAATCATGCTGGACTTAACTCTATGAGTGGTCGTTAACACGCAACTTAAAACCAAAGACTAAAGGAATTGCCGTTGCATACTCGGAGATACTAACCACGACAAGATTTAGGATCGCTCCTGTCGGGTCATTACTGATTGGTTAGTGAGATTTCGACTCTTTGAGAAGAGCACTTTACTTAAGTCGCCGGTGACGTCATCACCTCAGCCATATAATAGGTACATTTTTCCGATCTCGGTGCTGGACGTCACACGCGGTTGTAGTGAGACGACGAGAATGGACTCAGTCAGAAGCTATTAACTGCTTGACACGCCCTCGACCTGGTGCCGAAAAAGTGAACTCTGTTTTGATTTTTATAAAGGGATCACGGTTTCAAAGATCCTGCTCTCTGCCTATGAACGTCATTCTTAATGCAGAGATTTACAGATGAGACGATGTAGCGGCGGCACCTAATACTGTATAGCATACCGGTGGCAGCAAATCTGTATGCGATGCCATCTGGGCCAGCTATATATCACGATGTTCTAGATAGGAGTTGCAACACGGACTCGACATCACTACGAATACAAAACCATATTATAGTCTAGCATTGAATGCTTGGAATTACTCCTAGAACTAGCCCGCACGGTATGTGGCAAAGG

doc/intro.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Introduction to rosalind
2+
3+
TODO: write [great documentation](http://jacobian.org/writing/great-documentation/what-to-write/)

project.clj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
(defproject rosalind "0.1.0"
2+
:description "FIXME: write description"
3+
:url "http://example.com/FIXME"
4+
:license {:name "Eclipse Public License"
5+
:url "http://www.eclipse.org/legal/epl-v10.html"}
6+
:dependencies [[org.clojure/clojure "1.4.0"]]
7+
:main rosalind.core)

src/rosalind/basics.clj

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
(ns rosalind.basics)
2+
3+
(defn dna-counter-fn
4+
"This actually does the counting"
5+
[dna cnt]
6+
(loop [d dna
7+
c cnt]
8+
(let [l (first d)
9+
r (rest d)]
10+
(case l
11+
\A (def h (assoc c :A (+ 1 (:A c))))
12+
\G (def h (assoc c :G (+ 1 (:G c))))
13+
\C (def h (assoc c :C (+ 1 (:C c))))
14+
\T (def h (assoc c :T (+ 1 (:T c))))
15+
nil)
16+
(if (empty? r)
17+
h
18+
(recur r h)))))
19+
20+
(defn dna-count
21+
"Counts DNA Neucleotides"
22+
[dna]
23+
(let [h (dna-counter-fn dna {:A 0 :C 0 :T 0 :G 0})]
24+
[(:A h) (:C h) (:G h) (:T h)]))

src/rosalind/core.clj

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
(ns rosalind.core)
2+
3+
(defn foo
4+
"I don't do a whole lot."
5+
[x]
6+
(println x "Hello, World!"))
7+
8+
(defn -main
9+
"Main entry point"
10+
[]
11+
(foo "oh bother..."))

test/rosalind/basics_test.clj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(ns rosalind.basics-test
2+
(:use clojure.test
3+
rosalind.basics))
4+
5+
(deftest a-test
6+
(testing "DNA counting stuff"
7+
(is (=
8+
[20 12 17 21]
9+
(dna-count "AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC")))))

test/rosalind/core_test.clj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
(ns rosalind.core-test
2+
(:use clojure.test
3+
rosalind.core))
4+
5+
(deftest a-test
6+
(testing "FIXME, I fail."
7+
(is (= 0 0))))

0 commit comments

Comments
 (0)