diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7ca6db3..a31bb05 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,13 @@ Changelog ========= +---- +v0.4 +---- + +- Disabling ``mv_store`` feature of H2. +- Fixing various bugs in ``H2ScoreDistributionReader`` and ``H2ScoreDistributionWriter``. + ---- v0.3 ---- diff --git a/README.md b/README.md index b00d911..751f3c2 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ A modern Java library for working with (biological) ontologies. - **Language/Platform:** Java >=8 - **License:** BSD 3-Clause Clear -- **Version:** 0.3 +- **Version:** 0.4 - **Authors:** - Sebastian Bauer - Peter N. Robinson @@ -19,6 +19,6 @@ A modern Java library for working with (biological) ontologies. - Max Schubach - Manuel Holtgrewe - **Availability:** - - Maven module `ontolib-core` for dealing with (biological) ontologies ([Javadoc via javadoc.io](http://javadoc.io/doc/com.github.phenomics/ontolib-core/0.3)). - - Maven module `ontolib-io` for reading ontologies from OBO files ([Javadoc via javadoc.io](http://javadoc.io/doc/com.github.phenomics/ontolib-io/0.3)). + - Maven module `ontolib-core` for dealing with (biological) ontologies ([Javadoc via javadoc.io](http://javadoc.io/doc/com.github.phenomics/ontolib-core/0.4)). + - Maven module `ontolib-io` for reading ontologies from OBO files ([Javadoc via javadoc.io](http://javadoc.io/doc/com.github.phenomics/ontolib-io/0.4)). - Maven module `ontolib-cli` for performing empirical score distribution computation as a stand-alone program. diff --git a/ontolib-cli/pom.xml b/ontolib-cli/pom.xml index ab9fbf9..9b6f7fa 100644 --- a/ontolib-cli/pom.xml +++ b/ontolib-cli/pom.xml @@ -57,7 +57,7 @@ src/main/resources - true @@ -73,7 +73,7 @@ true lib/ - false com.github.phenomics.ontolib.cli.Main @@ -105,7 +105,7 @@ - maven-resources-plugin @@ -122,7 +122,7 @@ src/resources - true @@ -137,7 +137,7 @@ - maven-assembly-plugin diff --git a/ontolib-core/pom.xml b/ontolib-core/pom.xml index 79dfc5a..641daeb 100644 --- a/ontolib-core/pom.xml +++ b/ontolib-core/pom.xml @@ -22,7 +22,7 @@ src/main/resources - true @@ -51,7 +51,7 @@ - maven-resources-plugin @@ -68,7 +68,7 @@ src/main/resources - true diff --git a/ontolib-io/pom.xml b/ontolib-io/pom.xml index d0ae0c1..c71bd57 100644 --- a/ontolib-io/pom.xml +++ b/ontolib-io/pom.xml @@ -45,7 +45,7 @@ src/main/resources - true @@ -109,7 +109,7 @@ - maven-resources-plugin @@ -126,7 +126,7 @@ src/main/resources - true diff --git a/ontolib-io/src/main/java/com/github/phenomics/ontolib/io/obo/mpo/MpoOboFactory.java b/ontolib-io/src/main/java/com/github/phenomics/ontolib/io/obo/mpo/MpoOboFactory.java index 5f07621..d148e0a 100644 --- a/ontolib-io/src/main/java/com/github/phenomics/ontolib/io/obo/mpo/MpoOboFactory.java +++ b/ontolib-io/src/main/java/com/github/phenomics/ontolib/io/obo/mpo/MpoOboFactory.java @@ -140,7 +140,7 @@ public MpoTerm constructTerm(Stanza stanza) { final String creationDateStr = (creationDateEntry == null) ? null : creationDateEntry.getValue(); - final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); + final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); Date creationDate = null; if (creationDateStr != null) { try { diff --git a/ontolib-io/src/main/java/com/github/phenomics/ontolib/io/scoredist/H2ScoreDistributionReader.java b/ontolib-io/src/main/java/com/github/phenomics/ontolib/io/scoredist/H2ScoreDistributionReader.java index feeaad2..61d83ff 100644 --- a/ontolib-io/src/main/java/com/github/phenomics/ontolib/io/scoredist/H2ScoreDistributionReader.java +++ b/ontolib-io/src/main/java/com/github/phenomics/ontolib/io/scoredist/H2ScoreDistributionReader.java @@ -39,15 +39,15 @@ public class H2ScoreDistributionReader implements ScoreDistributionReader { private final Connection conn; /** H2 query for selecting all term counts. */ - private final static String H2_SELECT_TERM_COUNTS = "SELECT DISTINCT (term_count) from %s"; + private final static String H2_SELECT_TERM_COUNTS = "SELECT DISTINCT (num_terms) from %s"; /** H2 query for selecting by term count. */ private final static String H2_SELECT_BY_TERM_COUNT_STATEMENT = - "SELECT (term_count, object_id, scores, p_values) FROM % WHERE (term_count = ?)"; + "SELECT num_terms, entrez_id, sample_size, scores, p_values FROM %s WHERE (num_terms = ?)"; /** H2 query for selecting by term count and object ID. */ private final static String H2_SELECT_BY_TERM_COUNT_AND_OBJECT_STATEMENT = - "SELECT (term_count, object_id, scores, p_values) FROM % WHERE (term_count = ? AND object_id = ?)"; + "SELECT num_terms, entrez_id, sample_size, scores, p_values FROM %s WHERE (num_terms = ? AND entrez_id = ?)"; /** * Create new reader object. @@ -74,7 +74,8 @@ private Connection openConnection() throws OntoLibException { final Connection result; try { Class.forName("org.h2.Driver"); - result = DriverManager.getConnection("jdbc:h2:" + pathDb, "", ""); + result = DriverManager + .getConnection("jdbc:h2:" + pathDb + ";ACCESS_MODE_DATA=r;mv_store=false", "", ""); } catch (ClassNotFoundException e) { throw new OntoLibException("H2 driver class could not be found", e); } catch (SQLException e) { @@ -110,7 +111,7 @@ public ObjectScoreDistribution readForTermCountAndObject(int termCount, int obje } } catch (SQLException e) { throw new OntoLibException("Problem with getting object score distribution for termCount: " - + termCount + ", objectId: " + objectId); + + termCount + ", objectId: " + objectId, e); } throw new OntoLibException( diff --git a/ontolib-io/src/main/java/com/github/phenomics/ontolib/io/scoredist/H2ScoreDistributionWriter.java b/ontolib-io/src/main/java/com/github/phenomics/ontolib/io/scoredist/H2ScoreDistributionWriter.java index 4925427..9d9a5b6 100644 --- a/ontolib-io/src/main/java/com/github/phenomics/ontolib/io/scoredist/H2ScoreDistributionWriter.java +++ b/ontolib-io/src/main/java/com/github/phenomics/ontolib/io/scoredist/H2ScoreDistributionWriter.java @@ -87,7 +87,7 @@ private Connection openConnection(boolean resetTableIfExists) throws OntoLibExce final Connection resultConn; try { Class.forName("org.h2.Driver"); - resultConn = DriverManager.getConnection("jdbc:h2:" + pathDb, "", ""); + resultConn = DriverManager.getConnection("jdbc:h2:" + pathDb + ";mv_store=false", "", ""); } catch (ClassNotFoundException e) { throw new OntoLibException("H2 driver class could not be found", e); } catch (SQLException e) { @@ -190,6 +190,7 @@ private void writeObjectScoreDistribution(int numTerms, ObjectScoreDistribution for (Entry e : dist.getCumulativeFrequencies().entrySet()) { scores[i] = e.getKey(); pValues[i] = e.getValue(); + i += 1; } } diff --git a/pom.xml b/pom.xml index e0d3936..5023611 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.phenomics OntoLib pom - 0.3 + 0.5-SNAPSHOT ${project.groupId}:${project.artifactId} OntoLib contains data structures and algorithms for processing ontologies.