Difference between revisions of "PSU Presentation"

From GMOD
Jump to: navigation, search
m (Text replace - "<java>" to "<syntaxhighlight lang="java">")
m (Text replace - "</java>" to "</syntaxhighlight>")
Line 64: Line 64:
  
 
createExon("exon2", genes[0], 14687, 14720, now, 1);
 
createExon("exon2", genes[0], 14687, 14720, now, 1);
</java>
+
</syntaxhighlight>
  
 
Retrieve a gene
 
Retrieve a gene
Line 70: Line 70:
 
Feature f = sequenceDao.getFeatureByUniqueName("xfile");
 
Feature f = sequenceDao.getFeatureByUniqueName("xfile");
 
displayGene(f);
 
displayGene(f);
</java>
+
</syntaxhighlight>
  
 
Update a gene
 
Update a gene
Line 77: Line 77:
  
 
sequenceDao.merge(genes[0]);
 
sequenceDao.merge(genes[0]);
</java>
+
</syntaxhighlight>
  
  
Line 95: Line 95:
  
 
}
 
}
</java>
+
</syntaxhighlight>
  
 
=====Demo – Sample Problem=====
 
=====Demo – Sample Problem=====

Revision as of 23:29, 8 October 2012

This Wiki page is an edited version of Chinmay's presentation.

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 <xml> <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> </xml>

  • Uses a connection pool
  • Connection to the database is specified graphically, so the iBatis configuration file has variables for the location:

<xml> <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}"/> </xml>

  • 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

<xml> <st:section name="Naming" id="gene_naming" collapsed="false" collapsible="false" hideIfEmpty="true">

symbol:
${feature.uniqueName}
 <db:synonym name="synonym" var="name" collection="${feature.featureSynonyms}">
   
Synonym: <db:list-string collection="${name}" /> </db:synonym>
Type:
${feature.cvTerm.name}

<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">

           ${feature.residues}

</st:section> </xml>