Skip to content

Commit 3499410

Browse files
author
koehlers
committed
rm javautil_pheno
1 parent dd50971 commit 3499410

File tree

3 files changed

+43
-13
lines changed

3 files changed

+43
-13
lines changed

.classpath

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,12 @@
1212
</attributes>
1313
</classpathentry>
1414
<classpathentry kind="var" path="M2_REPO/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar"/>
15-
<classpathentry kind="var" path="M2_REPO/junit/junit/4.10/junit-4.10.jar" sourcepath="M2_REPO/junit/junit/4.10/junit-4.10-sources.jar">
16-
<attributes>
17-
<attribute name="javadoc_location" value="jar:file:/Users/sebastiankohler/.m2/repository/junit/junit/4.10/junit-4.10-javadoc.jar!/"/>
18-
</attributes>
19-
</classpathentry>
20-
<classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar" sourcepath="M2_REPO/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1-sources.jar"/>
15+
<classpathentry kind="var" path="M2_REPO/junit/junit/4.10/junit-4.10.jar"/>
16+
<classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar"/>
2117
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
2218
<attributes>
2319
<attribute name="maven.pomderived" value="true"/>
2420
</attributes>
2521
</classpathentry>
26-
<classpathentry combineaccessrules="false" kind="src" path="/javautil_pheno"/>
27-
<classpathentry combineaccessrules="false" kind="src" path="/ontologizer"/>
2822
<classpathentry kind="output" path="target/classes"/>
2923
</classpath>

pom.xml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
34
<modelVersion>4.0.0</modelVersion>
45
<groupId>phenotero</groupId>
56
<artifactId>phenotero</artifactId>
67
<version>0.0.1-SNAPSHOT</version>
78

89

10+
<repositories>
11+
<repository>
12+
<id>compbio</id>
13+
<url>http://compbio.charite.de/tl_files/maven</url>
14+
</repository>
15+
</repositories>
16+
917
<dependencies>
1018

1119
<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
@@ -14,7 +22,11 @@
1422
<artifactId>json-simple</artifactId>
1523
<version>1.1.1</version>
1624
</dependency>
17-
25+
<dependency>
26+
<groupId>ontologizer</groupId>
27+
<artifactId>ontologizer</artifactId>
28+
<version>0.0.3-SNAPSHOT</version>
29+
</dependency>
1830
</dependencies>
1931

2032
<build>
@@ -48,7 +60,7 @@
4860
</descriptorRefs>
4961
<archive>
5062
<manifest>
51-
<mainClass>de.phenomics.Onto2Zotero</mainClass>
63+
<mainClass>de.phenomics.Obo2ZoteroJson</mainClass>
5264
</manifest>
5365
</archive>
5466
</configuration>

src/de/phenomics/Obo2ZoteroJson.java

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
import org.json.simple.JSONArray;
1212
import org.json.simple.JSONObject;
1313

14+
import ontologizer.go.OBOParser;
15+
import ontologizer.go.OBOParserException;
1416
import ontologizer.go.Ontology;
1517
import ontologizer.go.Term;
18+
import ontologizer.go.TermContainer;
1619
import sonumina.math.graph.SlimDirectedGraphView;
17-
import util.OntologyUtil;
1820

1921
/**
2022
* @author Sebastian Köhler (dr.sebastian.koehler@gmail.com)
@@ -39,7 +41,7 @@ public static void main(String[] args) {
3941

4042
// init json document
4143
JSONArray jsonArrayTerms = new JSONArray();
42-
Ontology ontology = OntologyUtil.parseOntology(oboFile);
44+
Ontology ontology = parseOntology(oboFile);
4345
SlimDirectedGraphView<Term> ontologySlim = ontology.getSlimGraphView();
4446
HashSet<Term> rootChildren = new HashSet<Term>(ontologySlim.getChildren(ontology.getRootTerm()));
4547

@@ -111,6 +113,28 @@ public static void main(String[] args) {
111113

112114
}
113115

116+
/**
117+
* @param oboFile
118+
* @return
119+
*/
120+
private static Ontology parseOntology(String oboFile) {
121+
OBOParser oboParser = null;
122+
oboParser = new OBOParser(oboFile, OBOParser.PARSE_DEFINITIONS | OBOParser.PARSE_XREFS);
123+
124+
try {
125+
String parseInfo = oboParser.doParse();
126+
System.out.println(parseInfo);
127+
128+
} catch (IOException | OBOParserException e) {
129+
// TODO Auto-generated catch block
130+
e.printStackTrace();
131+
}
132+
// get the complete hpo
133+
TermContainer termContainer = new TermContainer(oboParser.getTermMap(), oboParser.getFormatVersion(),
134+
oboParser.getDataVersion());
135+
return Ontology.create(termContainer);
136+
}
137+
114138
/**
115139
* @param allSyns
116140
* @return

0 commit comments

Comments
 (0)