Giter Site home page Giter Site logo

biomart-client's Introduction

biomart-client

Clojure library to query unRESTful BioMart web services.

Usage

Querying

(use '[biomart-client.utils :only (martservice-url)]
     '[biomart-client.query])

(def ms (martservice-url "http://www.i-dcc.org/biomart"))
;=> #'user/ms
;=> "http://www.i-dcc.org/biomart/martservice"

(query ms {:dataset "dcc"
           :filter  {:marker_symbol ["Art4" "Cbx1"]}
           :attrs   [:marker_symbol :mgi_accession_id]}))
;=> ({:mgi_accession_id "MGI:1202710", :marker_symbol "Art4"}
     {:mgi_accession_id "MGI:105369", :marker_symbol "Cbx1"})

(query ms {:count true} {:dataset "dcc"
                         :filter  {:marker_symbol '(art4 abcd1 cbx1)}
                         :attrs   [:mgi_accession_id]}))
;=> ({:count 3})

BioMart metadata

(use '[biomart-client.metadata])

(def r (registry ms))
(map :name (marts r))
;=> ("ikmc" "biomart" "htgt" "ikmc_unitrap" "emma_biomart"
     "Eurexpress Biomart" "europhenomeannotations" "ENSEMBL_MART_ENSEMBL"
     "ENSEMBL_MART_VEGA")

(datasets ms "ikmc")
;=> (("TableSet" "kermits" "IKMC Mouse Production" "1" "" "200" "50000" "default" "2011-03-24 16:09:13") ("TableSet" "omim" "OMIM (with MGI Mouse Orthologue Mappings)" "1" "" "200" "50000" "default" "2011-03-24 16:09:14") ("TableSet" "idcc_targ_rep" "IKMC Targeted Products" "1" "" "200" "50000" "default" "2011-03-24 16:09:13") ("TableSet" "dcc" "IKMC Projects / Alleles" "1" "" "200" "50000" "default" "2011-03-24 16:09:12"))

(map #(nth % 1) (datasets ms "ikmc"))
;=> ("kermits" "omim" "idcc_targ_rep" "dcc")

(def c (configuration ms "dcc"))
(default-attributes c)
;=> ("marker_symbol" "mgi_accession_id" "ikmc_project" "ikmc_project_id" "status" "mouse_available" "escell_available" "vector_available")

(map first (attributes ms "dcc"))
;=> ("marker_symbol" "marker_name" "mgi_accession_id" "secondary_mgi_accession_id" "synonym" "ensembl_gene_id" "vega_gene_id" "ncbi_gene_id" "ccds_id" "omim_id" "omim_description" "chromosome" "strand" "start" "end" "ikmc_project" "ikmc_project_id" "status" "mouse_available" "escell_available" "vector_available" "mgi_gene_traps" "tigm_gene_traps" "igtc" "imsr" "targeted_mutations" "other_mutations")

(def f (filters ms "dcc"))
(map first f)
;=> ("marker_symbol" "mgi_accession_id" "secondary_mgi_accession_id" "ensembl_gene_id" "vega_gene_id" "ncbi_gene_id" "ccds_id" "omim_id" "chromosome" "start" "end" "strand" "project" "ikmc_project_id" "mouse_available" "escell_available" "vector_available" "status" "regeneron_status")

Installation

Available from clojars.org; add:

[biomart-client "1.0.0-SNAPSHOT"]

to your project.clj

License

Copyright (C) 2010, Ray Miller [email protected].

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE, http://www.eclipse.org/org/documents/epl-v10.php.

ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT’S ACCEPTANCE OF THIS AGREEMENT.

TODO

  • Write more tests

  • Deal with duplicate attrs in query parser? At the moment, for federated queries, an attribute in the second dataset will trample on data from the first dataset with the same attribute name.

  • Implement work-around for boolean filters from Darren's Ruby library

    • see his dataset.rb class.

biomart-client's People

Contributors

chapmanb avatar ray1729 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

gilesc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.