MCW BioMart
 

RGD Cookbook

Links

 MartService Query Tutorial   version 0.6

The MCW BioMarts can be directly queried by combining the folling URL with a query described in XML.

MCW BioMart URL
http://biomart.mcw.edu:9999/biomart/martservice?query=

Example XML Query
<?xml version="1.0" encoding="UTF-8"?>
<DOCTYPE Query>
<Query virtualSchemaName = "default" count = "0">
<Dataset name = "rgd_genes">
<Attribute name = "rgd_id"/>
<Attribute name = "name"/>
<Filter name = "chromosome_34_list_filter" value = "X"/>
</Dataset>
</Query>

Our current example would return a table that included the RGD ID and Gene Name of all records mapped to chromosome X using the v3.4 map. Let's go line by line through the XML.

The XML should be submitted as a single string with no line breaks. The first three lines of the XML are required and describe the XML document as a query. In most instances the virtualSchema attribute will be default, unless otherwise specified. The count attribute can either be 0 or 1. If it is set to 1 then the query returns a count of the records rather than a tab delimited table.

The Dataset element specifies the dataset that you are going to query. The Attribute elements specify which attributes are going to be returned from each record. And the Filter element is used to filter the records. The name attribute of each element must be the internal name used by the BioMart configuration file. In our example we want the RGD ID and Gene Name so we specify two attribute elements, one with an attribute name equal to rgd_id (the internal name used for the RGD ID) and the other with an attribute name equal to name (the internal name used for the Gene Name). We specify the filter we want to use. We want the gene records on chromosome X as mapped in v3.4, so we select the chromosome_34_list_filter similar to selecting an attribute. Except that a filter element also has a value attribute, which we set equal to X. We then close our XML elements and our query is complete.

For a printer friendly version of the MCW BioMart internal names see below.

It is possible to pass more than one value to a filter. A comma, no space, is used to seperate the values.

For example:
<ValueFilter name = "chromosome_34_list_filter" value = "12,13"/>
would return all the records mapped to chromosomes 12 and 13.

Click Here for the Example Query in Plain Text

Using the MartService XML button
The XML button located near the top of the MartService page is a convenient way to automatically generate an XML query for you. Simply set the filter you desire and select the attributes you are interested in and then press the XML button. This will automatically generate the XML document.