Permalink
Browse files

Delete obsolete code

  • Loading branch information...
1 parent cbf0dfe commit 17153608e9ec7d1ce22b272aafc59f7adb9fca71 @ray1729 committed Oct 3, 2012
Showing with 0 additions and 75 deletions.
  1. +0 −7 project.clj
  2. +0 −62 src/ray1729/bio/ensembl/core.clj
  3. +0 −6 test/ray1729/bio/ensembl/test/core.clj
View
7 project.clj
@@ -1,7 +0,0 @@
-(defproject ray1729/bio.ensembl "1.0.0-SNAPSHOT"
- :description "Clojure functions for interacting with EnsEMBL database"
- :dependencies [[org.clojure/clojure "1.2.0"]
- [org.clojure/clojure-contrib "1.2.0"]
- [clojureql "1.0.0"]
- [mysql/mysql-connector-java "5.1.15"]]
- :dev-dependencies [[swank-clojure "1.2.1"]])
View
62 src/ray1729/bio/ensembl/core.clj
@@ -1,62 +0,0 @@
-(ns ray1729.bio.ensembl.core
- (:refer-clojure
- :exclude [take drop sort distinct conj! disj! compile case])
- (:use
- [clojure.contrib.sql :only (with-connection)]
- [clojureql.core]))
-
-(def *ensembldb-host* "ensembldb.ensembl.org")
-(def *ensembldb-port* 5306)
-(def *species-id* 1)
-
-(defn ensembldb
- [dbname]
- {:classname "com.mysql.jdbc.Driver"
- :subprotocol "mysql"
- :user "anonymous"
- :subname (format "//%s:%s/%s" *ensembldb-host* *ensembldb-port* dbname)
- :auto-commit true
- :fetch-size 500})
-
-(def mousedb (ensembldb "mus_musculus_core_61_37n"))
-
-;;(open-global :mousedb mousedb)
-
-(defn fetch-gene-by-stable-id
- [id]
- (-> (table :gene_stable_id)
- (select (where (= :stable_id id)))
- (join (table :gene) :gene_id)
- (project [:gene.* :gene_stable_id.stable_id])))
-
-(defn fetch-gene-by-external-name
- [name]
- (let [base-query (-> (table :gene)
- (select (where (= :gene.is_current 1)))
- (join (table :gene_stable_id) :gene_id)
- (join (table :seq_region)
- (where (= :gene.seq_region_id :seq_region.seq_region_id)))
- (join (table :coord_system)
- (where (and (= :coord_system.coord_system_id :seq_region.coord_system_id)
- (= :coord_system.species_id *species-id*))))
- (join (table :object_xref)
- (where (and (= :object_xref.ensembl_id :gene.gene_id)
- (= :object_xref.ensembl_object_type "Gene"))))
- (join (table :xref)
- (where (= :xref.xref_id :object_xref.xref_id))))
- query1 (-> base-query
- (select (where (or (= :xref.dbprimary_acc name)
- (= :xref.display_label name))))
- (project [:gene.*, :gene_stable_id.stable_id])
- (distinct))
- query2 (-> base-query
- (join (table :external_synonym)
- (where (= :external_synonym.xref_id :object_xref.xref_id)))
- (select (where (= :external_synonym.synonym name)))
- (project [:gene.*, :gene_stable_id.stable_id])
- (distinct))]
- (union query1 query2)))
-
-;; XXX Throws exception "No value specified for parameter 7"
-;; (with-connection mousedb @(fetch-gene-by-external-name "Cbx1"))
-
View
6 test/ray1729/bio/ensembl/test/core.clj
@@ -1,6 +0,0 @@
-(ns ray1729.bio.ensembl.test.core
- (:use [ray1729.bio.ensembl.core] :reload)
- (:use [clojure.test]))
-
-(deftest replace-me ;; FIXME: write
- (is false "No tests have been written."))

0 comments on commit 1715360

Please sign in to comment.