Archive for November, 2011

How to create a genotype database for use as a DAS source

Assuming your data is of the following format seperated by tabs (genotype id, chromosome, position, genotype bases):

rs7763	16	544555	TT
rs763158	16	546105	GG
rs7190878	16	549131	AG
rs4984890	16	552699	CT
rs710925	16	573355	AG

if you have access to a mysql database and admin priveleges you can use the following commands to set up a database called genotype1 with a table called genotype.

First you have to make sure you have a user set up for creating and reading from the database:

if it’s not a production database you can usually log in as root using:

-mysql -u uroot

Then run the following commands:

create database genotype1;

grant all privileges on genotype1.* to genotype@localhost;

then type exit and then login as the genotype user.

mysql -u genotype -p

use genotype;

CREATE TABLE `genotype` (

`rs_id` varchar (100) NOT NULL,

`chromosome` mediumint(8) unsigned NOT NULL,

`position` bigint(8) unsigned NOT NULL,

`bases` varchar(5) default NULL,

PRIMARY KEY  (`rs_id`)


you now have a database called genotype1 set up with a user genotype and password genotype (which obviously you would set to something different).

To load your data file using the unix command line and not when logged into mysql:

mysqlimport -u genotype -pgenotype –local genotype1 genotype.txt

loads the genotype.txt file into the genotype table (note file names need to be same as table name) into the genotype1 database.

Or from the mysql command line: LOAD DATA INFILE ‘/Users/jw12/genotype.txt’ into table genotype;
example configuration for MyDAS:

<datasource uri="person1"

title="genotype db person1"

description="genotype db person1"



<maintainer email="" />

<version uri="person1" created="2010-04-01">


<coordinates uri=""




test_range="ENSG00000160916">Ensembl,Gene_ID,Homo sapiens</coordinates>

<capability type="das1:sources" query_uri="http://localhost:8080/das/ensemblTest" />

<capability type="das1:types" query_uri="http://localhost:8080/das/ensemblTest/types" />

<capability type="das1:features" query_uri="http://localhost:8080/das/ensemblTest/features" />

<capability type="das1:feature-by-id" query_uri="http://localhost:8080/das/ensemblTest/features" />

<capability type="das1:stylesheet" query_uri="http://localhost:8080/das/ensemblTest/stylesheet" />

<capability type="das1:unknown-feature" />

<capability     type="das1:maxbins"     />

<capability     type="das1:entry_points"        />






Setting up a MyDAS data source from svn using eclipse

select new -> project from svn.

make sure mydas repository is added in your svn repository list.

navigate to the svn repository mydas->mydastemplate.

select open project with wizard.

open the project as a “dynammic web project”

right click on the “pom.xml” file and select “package”. wait for maven to package the project

right click on the project and select “enable maven dependencies” – project icon will then have “M” on it and may take a minute to build.

right click on the project and select run on server. select a tomcat server and the server should then run.

put this url into your browser: http://localhost:8080/MyDasTemplate/das/referencegff/features?segment=L47615.1

if the page responds with a blank try right clicking on the page and select “view source”. This should then have an xml response containing this data:

<SEGMENT id=”L47615.1″ start=”1″ stop=”3221″ total=”2″ version=”FromFile” label=”L47615.1″>
<FEATURE id=”GFF_feature_1″ label=”GFF_feature_1″>
<TYPE id=”TSS”/>
<METHOD id=”hand_built”>hand_built</METHOD>
<FEATURE id=”GFF_feature_2″ label=”GFF_feature_2″>
<TYPE id=”TSS”/>
<METHOD id=”hand_built”>hand_built</METHOD>
if this is not the case and you get a class not found error. right click on your project and then “Deployment Assembly” then “add”, add maven library dependencies (select the whole library not individual ones).
when developing a new adapter:
I changed the mydas log to be to the console by changing the rootCategory line in the file:

log4j.rootCategory=DEBUG, console