Difference between revisions of "PSU Presentation"
From GMOD
m |
m (Text replace - "</xml>" to "</syntaxhighlight>") |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
* GeneDB is the organism data and annotation database for the Pathogen Sequencing Unit (PSU) at the Sanger Institute, UK | * GeneDB is the organism data and annotation database for the Pathogen Sequencing Unit (PSU) at the Sanger Institute, UK | ||
* Contains 37 organisms, which is expected to grow to 62 | * Contains 37 organisms, which is expected to grow to 62 | ||
− | * Artemis is an annotation/DNA graphical interface | + | * [[Artemis]] is an annotation/DNA graphical interface |
* PSU is currently migrating to chado schema | * PSU is currently migrating to chado schema | ||
* We've implemented a common interface with the two leading open source frameworks: Hibernate and iBatis | * We've implemented a common interface with the two leading open source frameworks: Hibernate and iBatis | ||
Line 12: | Line 12: | ||
Connections for the '''Hibernate''' engine are configured in the Spring configuration file | Connections for the '''Hibernate''' engine are configured in the Spring configuration file | ||
− | <xml> | + | <syntaxhighlight lang="xml"> |
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> | <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> | ||
<property name="driverClassName" value="org.postgresql.Driver" /> | <property name="driverClassName" value="org.postgresql.Driver" /> | ||
Line 19: | Line 19: | ||
<property name="password" value="WIBBLE" /> | <property name="password" value="WIBBLE" /> | ||
</bean> | </bean> | ||
− | </ | + | </syntaxhighlight> |
* Uses a connection pool | * Uses a connection pool | ||
* Connection to the database is specified graphically, so the '''iBatis''' configuration file has variables for the location: | * Connection to the database is specified graphically, so the '''iBatis''' configuration file has variables for the location: | ||
− | <xml> | + | <syntaxhighlight lang="xml"> |
<property name="JDBC.Driver" value="org.postgresql.Driver"/> | <property name="JDBC.Driver" value="org.postgresql.Driver"/> | ||
Line 30: | Line 30: | ||
<property name="JDBC.Password" value="${password}"/> | <property name="JDBC.Password" value="${password}"/> | ||
− | </ | + | </syntaxhighlight> |
* provide database location, username & password | * provide database location, username & password | ||
Line 47: | Line 47: | ||
Creating a gene | Creating a gene | ||
− | <java> | + | <syntaxhighlight lang="java"> |
genes[0] = new Feature(ORG, GENE, "xfile", false, false, now, now); | genes[0] = new Feature(ORG, GENE, "xfile", false, false, now, now); | ||
Line 64: | Line 64: | ||
createExon("exon2", genes[0], 14687, 14720, now, 1); | createExon("exon2", genes[0], 14687, 14720, now, 1); | ||
− | </ | + | </syntaxhighlight> |
Retrieve a gene | Retrieve a gene | ||
− | <java> | + | <syntaxhighlight lang="java"> |
Feature f = sequenceDao.getFeatureByUniqueName("xfile"); | Feature f = sequenceDao.getFeatureByUniqueName("xfile"); | ||
displayGene(f); | displayGene(f); | ||
− | </ | + | </syntaxhighlight> |
Update a gene | Update a gene | ||
− | <java> | + | <syntaxhighlight lang="java"> |
genes[0].setUniqueName("x-file"); | genes[0].setUniqueName("x-file"); | ||
sequenceDao.merge(genes[0]); | sequenceDao.merge(genes[0]); | ||
− | </ | + | </syntaxhighlight> |
− | <java> | + | <syntaxhighlight lang="java"> |
private Feature createExon(String name, Feature gene, int min, int max, Timestamp now, int rank) { | private Feature createExon(String name, Feature gene, int min, int max, Timestamp now, int rank) { | ||
Line 95: | Line 95: | ||
} | } | ||
− | </ | + | </syntaxhighlight> |
=====Demo – Sample Problem===== | =====Demo – Sample Problem===== | ||
Line 101: | Line 101: | ||
Simple web page to demonstrate displaying a basic feature | Simple web page to demonstrate displaying a basic feature | ||
− | <xml> | + | <syntaxhighlight lang="xml"> |
<st:section name="Naming" id="gene_naming" collapsed="false" collapsible="false" | <st:section name="Naming" id="gene_naming" collapsed="false" collapsible="false" | ||
hideIfEmpty="true"> | hideIfEmpty="true"> | ||
Line 126: | Line 126: | ||
<b>${feature.residues}</b> | <b>${feature.residues}</b> | ||
</st:section> | </st:section> | ||
− | </ | + | </syntaxhighlight> |
[[Category:Middleware Presentations]] | [[Category:Middleware Presentations]] |
Latest revision as of 21:16, 9 October 2012
This Wiki page is an edited version of Chinmay's presentation.
Contents
Sanger Pathogen Sequencing Unit (PSU)
- GeneDB is the organism data and annotation database for the Pathogen Sequencing Unit (PSU) at the Sanger Institute, UK
- Contains 37 organisms, which is expected to grow to 62
- Artemis is an annotation/DNA graphical interface
- PSU is currently migrating to chado schema
- We've implemented a common interface with the two leading open source frameworks: Hibernate and iBatis
Technical - Connections
Connections for the Hibernate engine are configured in the Spring configuration file
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="org.postgresql.Driver" /> <property name="url" value="jdbc:postgresql://holly.sanger.ac.uk:5432/chado" /> <property name="username" value="DELIBERATELY_BOGUS_NAME"/> <property name="password" value="WIBBLE" /> </bean>
- Uses a connection pool
- Connection to the database is specified graphically, so the iBatis configuration file has variables for the location:
<property name="JDBC.Driver" value="org.postgresql.Driver"/> <property name="JDBC.ConnectionURL” value="jdbc:postgresql://${chado}"/> <property name="JDBC.Username" value="${username}"/> <property name="JDBC.Password" value="${password}"/>
- provide database location, username & password
- select from scrollable list of feature with residues (organisms in separate Postgres schemas) what to open in Artemis
Technical - Code Generation
- The shared interface and hibernate implementation were originally generated
- There’s no explicit code generation (although the Spring and Hibernate runtimes may use them behinds the scenes)
Technical - Transactions
- Transactions are fully supported
Problems 1, 2, & 3
Creating a gene
genes[0] = new Feature(ORG, GENE, "xfile", false, false, now, now); genes[0].setSeqLen(1029); sequenceDao.persist(genes[0]); FeatureLoc loc = new FeatureLoc(SOURCE_FEATURE, genes[0], 13691, false, 14720, false, (short)1, 0, 0 ,0); sequenceDao.persist(loc); addFeatureProp(genes[0], "description", "A test gene for GMOD meeting"); addSynonymsToFeature(genes[0], "mulder", "scully"); createExon("exon1", genes[0], 13691, 13767, now, 0); createExon("exon2", genes[0], 14687, 14720, now, 1);
Retrieve a gene
Feature f = sequenceDao.getFeatureByUniqueName("xfile"); displayGene(f);
Update a gene
genes[0].setUniqueName("x-file"); sequenceDao.merge(genes[0]);
private Feature createExon(String name, Feature gene, int min, int max, Timestamp now, int rank) { Feature exon = new Feature(ORG, EXON, name, false, false, now, now); exon.setSeqLen(max-min); sequenceDao.persist(exon); FeatureLoc loc = new FeatureLoc(SOURCE_FEATURE, exon, min, false, max, false, (short)1, 0, 0 ,0); sequenceDao.persist(loc); return exon; }
Demo – Sample Problem
Simple web page to demonstrate displaying a basic feature
<st:section name="Naming" id="gene_naming" collapsed="false" collapsible="false" hideIfEmpty="true"> <dl> <dt><b>symbol:</b></dt> <dd>${feature.uniqueName}</dd> </dl> <db:synonym name="synonym" var="name" collection="${feature.featureSynonyms}"> <br /><b>Synonym:</b> <db:list-string collection="${name}" /> </db:synonym> <dt><b>Type:</b></dt> <dd>${feature.cvTerm.name}</dd> <st:section name="Exons" collapsed="false" collapsible="true" hideIfEmpty="true"> <display:table name="exons" uid="tmp" pagesize="30" class="simple" cellspacing="0" cellpadding="4"> <display:column property="uniqueName" title="Exon"/> <display:column property="featureLocsForSrcFeatureId.fmin" title="Start"/> <display:column property="featureLocsForSrcFeatureId.fmax" title="end"/> </display:table> </st:section> <st:section name="cds" collapsible="true"> <b>${feature.residues}</b> </st:section>