diff --git a/.classpath b/.classpath index 6cae17e..149cb3c 100644 --- a/.classpath +++ b/.classpath @@ -11,65 +11,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 714351a..b8947ec 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -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 diff --git a/pom.xml b/pom.xml index b70a027..6fba82a 100644 --- a/pom.xml +++ b/pom.xml @@ -25,11 +25,6 @@ poi-ooxml 3.9 - - ontologizer - ontologizer - 0.0.3-SNAPSHOT - javautil_pheno javautil_pheno diff --git a/src/de/phenomics/Obo2Xls.java b/src/de/phenomics/Obo2Xls.java index 41172d8..c972563 100644 --- a/src/de/phenomics/Obo2Xls.java +++ b/src/de/phenomics/Obo2Xls.java @@ -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; @@ -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; @@ -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); /* @@ -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(); @@ -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."); } @@ -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 ontologySlim = ontology.getSlimGraphView(); @@ -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; @@ -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 ontologySlim, boolean style, boolean isLast) { + private static void recursiveWriteTermsAndTheirChildren(Term currentTerm, XSSFWorkbook wb, Sheet sheet0, + XSSFCreationHelper createHelper, SlimDirectedGraphView ontologySlim, boolean style, boolean isLast) { if (currentTerm.isObsolete()) return; @@ -163,8 +167,8 @@ private static void recursiveWriteTermsAndTheirChildren(Term currentTerm, XSSFWo ++rowIndexNextRow; } - private static void createRowForTerm(Term term, Sheet sheet0, XSSFCreationHelper createHelper, SlimDirectedGraphView ontologySlim, - XSSFWorkbook wb, boolean style) { + private static void createRowForTerm(Term term, Sheet sheet0, XSSFCreationHelper createHelper, + SlimDirectedGraphView ontologySlim, XSSFWorkbook wb, boolean style) { Row row = sheet0.createRow(rowIndexNextRow); rowIndexNextRow++; @@ -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)); @@ -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;