Skip to content

Commit

Permalink
fixing some import issues after refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
drseb committed Nov 25, 2018
1 parent 6237f15 commit 42804a0
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 82 deletions.
59 changes: 0 additions & 59 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -11,65 +11,6 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpclient/4.5.3/httpclient-4.5.3.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpclient/4.5.3/httpclient-4.5.3-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:file:/Users/sebastiankohler/.m2/repository/org/apache/httpcomponents/httpclient/4.5.3/httpclient-4.5.3-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpcore/4.4.6/httpcore-4.4.6.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpcore/4.4.6/httpcore-4.4.6-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:file:/Users/sebastiankohler/.m2/repository/org/apache/httpcomponents/httpcore/4.4.6/httpcore-4.4.6-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.2/commons-logging-1.2.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.2/commons-logging-1.2-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:file:/Users/sebastiankohler/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.9/commons-codec-1.9.jar" sourcepath="M2_REPO/commons-codec/commons-codec/1.9/commons-codec-1.9-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:file:/Users/sebastiankohler/.m2/repository/commons-codec/commons-codec/1.9/commons-codec-1.9-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="var" path="M2_REPO/org/apache/poi/poi-ooxml/3.9/poi-ooxml-3.9.jar" sourcepath="M2_REPO/org/apache/poi/poi-ooxml/3.9/poi-ooxml-3.9-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/poi/poi/3.9/poi-3.9.jar" sourcepath="M2_REPO/org/apache/poi/poi/3.9/poi-3.9-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/poi/poi-ooxml-schemas/3.9/poi-ooxml-schemas-3.9.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/xmlbeans/xmlbeans/2.3.0/xmlbeans-2.3.0.jar"/>
<classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0.1/stax-api-1.0.1.jar"/>
<classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar" sourcepath="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar" sourcepath="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/ontologizer/ontologizer/0.0.3-SNAPSHOT/ontologizer-0.0.3-SNAPSHOT.jar" sourcepath="M2_REPO/ontologizer/ontologizer/0.0.3-SNAPSHOT/ontologizer-0.0.3-SNAPSHOT-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:file:/Users/sebastiankohler/.m2/repository/ontologizer/ontologizer/0.0.3-SNAPSHOT/ontologizer-0.0.3-SNAPSHOT-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="var" path="M2_REPO/javautil_pheno/javautil_pheno/0.0.2-SNAPSHOT/javautil_pheno-0.0.2-SNAPSHOT.jar" sourcepath="/ECLIPSE_HOME"/>
<classpathentry kind="var" path="M2_REPO/com/google/guava/guava/23.0/guava-23.0.jar" sourcepath="M2_REPO/com/google/guava/guava/23.0/guava-23.0-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:file:/Users/sebastiankohler/.m2/repository/com/google/guava/guava/23.0/guava-23.0-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="var" path="M2_REPO/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/errorprone/error_prone_annotations/2.0.18/error_prone_annotations-2.0.18.jar" sourcepath="M2_REPO/com/google/errorprone/error_prone_annotations/2.0.18/error_prone_annotations-2.0.18-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:file:/Users/sebastiankohler/.m2/repository/com/google/errorprone/error_prone_annotations/2.0.18/error_prone_annotations-2.0.18-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="var" path="M2_REPO/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar" sourcepath="M2_REPO/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:file:/Users/sebastiankohler/.m2/repository/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="var" path="M2_REPO/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar" sourcepath="M2_REPO/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:file:/Users/sebastiankohler/.m2/repository/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="var" path="M2_REPO/gov/nist/math/jama/1.0.3/jama-1.0.3.jar" sourcepath="M2_REPO/gov/nist/math/jama/1.0.3/jama-1.0.3-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:file:/Users/sebastiankohler/.m2/repository/gov/nist/math/jama/1.0.3/jama-1.0.3-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
Expand Down
1 change: 1 addition & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
5 changes: 0 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@
<artifactId>poi-ooxml</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>ontologizer</groupId>
<artifactId>ontologizer</artifactId>
<version>0.0.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>javautil_pheno</groupId>
<artifactId>javautil_pheno</artifactId>
Expand Down
42 changes: 24 additions & 18 deletions src/de/phenomics/Obo2Xls.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
import java.util.Arrays;
import java.util.stream.Collectors;

import ontologizer.go.Ontology;
import ontologizer.go.Term;

import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.DefaultParser;
Expand All @@ -27,6 +24,8 @@
import org.apache.poi.xssf.usermodel.XSSFFont;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import ontologizer.ontology.Ontology;
import ontologizer.ontology.Term;
import sonumina.math.graph.SlimDirectedGraphView;
import util.OntologyUtil;

Expand All @@ -53,7 +52,8 @@ public static void main(String[] args) throws IOException, ParseException {
options.addOption(ontologyOpt);

// the folder where the output is written to...
Option classOpt = new Option("c", "class", true, "The ontology class for which the excel file shall be created.");
Option classOpt = new Option("c", "class", true,
"The ontology class for which the excel file shall be created.");
options.addOption(classOpt);

/*
Expand All @@ -68,14 +68,16 @@ public static void main(String[] args) throws IOException, ParseException {
// check that required parameters are set
String parameterError = null;
if (oboFilePath == null) {
parameterError = "Please provide the obo file using -" + ontologyOpt.getOpt() + " or --" + ontologyOpt.getLongOpt();
} else if (!(new File(oboFilePath).exists())) {
parameterError = "Please provide the obo file using -" + ontologyOpt.getOpt() + " or --"
+ ontologyOpt.getLongOpt();
}
else if (!(new File(oboFilePath).exists())) {
parameterError = "obo file does not exist!";
}

/*
* Maybe something was wrong with the parameter. Print help for the user
* and die here...
* Maybe something was wrong with the parameter. Print help for the user and die
* here...
*/
if (parameterError != null) {
String className = Obo2Xls.class.getSimpleName();
Expand All @@ -97,7 +99,8 @@ public static void main(String[] args) throws IOException, ParseException {
Term t = ontology.getTermIncludingAlternatives(classId);
if (t != null) {
selectedRootTerm = t;
} else {
}
else {
System.err.println("Warning! You selected " + classId
+ " as class to be investigated, but this ID couldn't be found in the ontology.");
}
Expand All @@ -111,7 +114,8 @@ public static void main(String[] args) throws IOException, ParseException {

}

private static void createXlsFromObo(Ontology ontology, Term selectedRootTerm, String fileNameParsedOboFrom, String outfile) throws IOException {
private static void createXlsFromObo(Ontology ontology, Term selectedRootTerm, String fileNameParsedOboFrom,
String outfile) throws IOException {

SlimDirectedGraphView<Term> ontologySlim = ontology.getSlimGraphView();

Expand All @@ -128,8 +132,8 @@ private static void createXlsFromObo(Ontology ontology, Term selectedRootTerm, S
style.setFont(bold);

Sheet sheet0 = wb.createSheet("Excel version of " + fileNameParsedOboFrom + " version: " + date);
String[] headersTermAdd = new String[] { "Class Label", "Class ID", "Alternative IDs", "Synonyms (separated by semicolon)", "Definition",
"Subclass-of (label+id)" };
String[] headersTermAdd = new String[] { "Class Label", "Class ID", "Alternative IDs",
"Synonyms (separated by semicolon)", "Definition", "Subclass-of (label+id)" };

rowIndexNextRow = 1;

Expand All @@ -145,8 +149,8 @@ private static void createXlsFromObo(Ontology ontology, Term selectedRootTerm, S
fileOut.close();
}

private static void recursiveWriteTermsAndTheirChildren(Term currentTerm, XSSFWorkbook wb, Sheet sheet0, XSSFCreationHelper createHelper,
SlimDirectedGraphView<Term> ontologySlim, boolean style, boolean isLast) {
private static void recursiveWriteTermsAndTheirChildren(Term currentTerm, XSSFWorkbook wb, Sheet sheet0,
XSSFCreationHelper createHelper, SlimDirectedGraphView<Term> ontologySlim, boolean style, boolean isLast) {

if (currentTerm.isObsolete())
return;
Expand All @@ -163,8 +167,8 @@ private static void recursiveWriteTermsAndTheirChildren(Term currentTerm, XSSFWo
++rowIndexNextRow;
}

private static void createRowForTerm(Term term, Sheet sheet0, XSSFCreationHelper createHelper, SlimDirectedGraphView<Term> ontologySlim,
XSSFWorkbook wb, boolean style) {
private static void createRowForTerm(Term term, Sheet sheet0, XSSFCreationHelper createHelper,
SlimDirectedGraphView<Term> ontologySlim, XSSFWorkbook wb, boolean style) {

Row row = sheet0.createRow(rowIndexNextRow);
rowIndexNextRow++;
Expand Down Expand Up @@ -193,7 +197,8 @@ private static void createRowForTerm(Term term, Sheet sheet0, XSSFCreationHelper

}

private static void addCellWithStyle(String content, XSSFCreationHelper createHelper, Row row, int columnIndex, XSSFCellStyle style1) {
private static void addCellWithStyle(String content, XSSFCreationHelper createHelper, Row row, int columnIndex,
XSSFCellStyle style1) {
Cell c = row.createCell(columnIndex);
c.setCellValue(createHelper.createRichTextString(content));

Expand All @@ -202,7 +207,8 @@ private static void addCellWithStyle(String content, XSSFCreationHelper createHe
}
}

private static void createHeaderRow(XSSFCreationHelper createHelper, XSSFCellStyle style, Sheet sheet, String[] strings) {
private static void createHeaderRow(XSSFCreationHelper createHelper, XSSFCellStyle style, Sheet sheet,
String[] strings) {
Row headerrow = sheet.createRow((short) rowIndexNextRow);
rowIndexNextRow++;
int colIndex = 0;
Expand Down

0 comments on commit 42804a0

Please sign in to comment.