Package org.biojava.nbio.ontology.obo
Class OboFileParser
java.lang.Object
org.biojava.nbio.ontology.obo.OboFileParser
A class to parse the content of an OBO file. It delegates handling of the
content to the OBOFileEventListener implementation.
This file contains parts of the OBO-Edit file OBOParseEngine, (particularly the encoding and decoding part)
http://geneontology.cvs.sourceforge.net/geneontology/go-dev/java/oboedit/sources/org/geneontology/oboedit/dataadapter/OBOParseEngine.java?revision=1.10&view=markup
Thanks to the OboEdit developers for giving permission to release this in BioJava.
- Since:
- 1.6
- Author:
- Andreas Prlic, John Day Richter
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
protected SimpleDateFormat
protected String
protected int
protected StringBuffer
protected int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addOboFileEventListener
(OboFileEventListener listener) static String
static int
findUnescaped
(String str, char toChar) static int
findUnescaped
(String str, char toChar, int startIndex, int endIndex) static int
findUnescaped
(String str, char toChar, int startindex, int endindex, boolean honorQuotes) getDbxrefList
(String line, int startoffset, int endoffset) protected int
getNestedValue
(org.biojava.nbio.ontology.obo.NestedValue nv, String str, int startIndex) protected StringBuffer
static boolean
isEscapeStarter
(char c) static boolean
isQuote
(char c) void
parseOBO
(BufferedReader oboFile) parse an ontology fileprotected OboFileParser.SOPair
readQuotedString
(String value, int startIndex, int stopIndex, char terminatingChar, boolean requireQuotes, boolean legalEndOfLine)
-
Field Details
-
line
-
linenum
protected int linenum -
totalSize
protected int totalSize -
bytesRead
protected int bytesRead -
tempBuffer
-
dateFormat
-
escapeChars
-
unescapeChars
-
-
Constructor Details
-
OboFileParser
public OboFileParser()
-
-
Method Details
-
addOboFileEventListener
-
getOboFileEventListener
-
parseOBO
parse an ontology file- Parameters:
oboFile
-- Throws:
IOException
IOException
-
getDbxrefList
protected Map<String,Object>[] getDbxrefList(String line, int startoffset, int endoffset) throws IOException - Throws:
IOException
-
parseXref
protected Map<String,Object> parseXref(String line, int startoffset, int endoffset) throws IOException - Throws:
IOException
-
escape
-
unescape
- Throws:
IOException
-
unescape
public OboFileParser.SOPair unescape(String str, char toChar, int startindex, boolean mustFindChar) throws IOException - Throws:
IOException
-
unescape
public OboFileParser.SOPair unescape(String str, char toChar, int startindex, int endindex, boolean mustFindChar) throws IOException - Throws:
IOException
-
findUnescaped
-
findUnescaped
-
findUnescaped
public static int findUnescaped(String str, char toChar, int startindex, int endindex, boolean honorQuotes) -
isEscapeStarter
public static boolean isEscapeStarter(char c) -
isQuote
public static boolean isQuote(char c) -
getTempBuffer
-
readQuotedString
protected OboFileParser.SOPair readQuotedString(String value, int startIndex, int stopIndex, char terminatingChar, boolean requireQuotes, boolean legalEndOfLine) throws IOException - Throws:
IOException
-
getNestedValue
protected int getNestedValue(org.biojava.nbio.ontology.obo.NestedValue nv, String str, int startIndex) throws IOException - Throws:
IOException
-