Package de.isas.mztab2.io
Class MzTabFileParser
- java.lang.Object
-
- de.isas.mztab2.io.MzTabFileParser
-
public class MzTabFileParser extends Object
MZTabFileParser provides reading functionality of the mzTab file. During the parsing process, minimal integrity checks are preformed.- Since:
- 21/02/13
- Author:
- qingwei, nilshoffmann
-
-
Constructor Summary
Constructors Constructor Description MzTabFileParser(File tabFile)
Create a newMZTabFileParser
for the given file.MzTabFileParser(URI tabFileUri)
Create a newMZTabFileParser
for the given file URI.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkColunitMapping(MZTabColumnFactory columnFactory, Optional<Collection<de.isas.mztab2.model.ColumnParameterMapping>> columnParameterMapping, de.isas.mztab2.model.Metadata.Properties colUnitProperty, de.isas.mztab2.model.MzTab.Properties mzTabSection)
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorList
getErrorList()
Getter for the fielderrorList
.de.isas.mztab2.model.MzTab
getMZTabFile()
getMZTabFile.uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorList
parse(OutputStream out)
Create a newMZTabParserContext
andMZTabErrorList
for the given file URI.uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorList
parse(OutputStream out, uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorType.Level level)
Create a newMZTabParserContext
andMZTabErrorList
for the given file URI.uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorList
parse(OutputStream out, uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorType.Level level, int maxErrorCount)
Create a newMZTabParserContext
andMZTabErrorList
for the given file URI.
-
-
-
Constructor Detail
-
MzTabFileParser
public MzTabFileParser(File tabFile) throws IllegalArgumentException
Create a newMZTabFileParser
for the given file.- Parameters:
tabFile
- the MZTab file. The file SHOULD not be null and MUST exist- Throws:
IllegalArgumentException
- if the provided argument in invalid.
-
MzTabFileParser
public MzTabFileParser(URI tabFileUri) throws IllegalArgumentException
Create a newMZTabFileParser
for the given file URI.- Parameters:
tabFileUri
- the MZTab file URI. The file SHOULD not be null and MUST existMZTabErrorList
return bygetErrorList()
- Throws:
IllegalArgumentException
- if the provided argument in invalid.
-
-
Method Detail
-
parse
public uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorList parse(OutputStream out, uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorType.Level level, int maxErrorCount) throws IOException
Create a newMZTabParserContext
andMZTabErrorList
for the given file URI. Parsing output and errors are written to the providedOutputStream
.- Parameters:
out
- the output stream for parsing messageslevel
- the minimum error level to report errors formaxErrorCount
- the maximum number of errors to report in theMZTabErrorList
return bygetErrorList()
- Returns:
- the error list
- Throws:
IOException
- if any io related errors occur.
-
parse
public uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorList parse(OutputStream out, uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorType.Level level) throws IOException
Create a newMZTabParserContext
andMZTabErrorList
for the given file URI. Parsing output and errors are written to the providedOutputStream
. Reports up toMZTabProperties.MAX_ERROR_COUNT
errors.- Parameters:
out
- the output stream for parsing messageslevel
- the minimum error level to report errors for- Returns:
- the error list
- Throws:
IOException
- if any io related errors occur.
-
parse
public uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorList parse(OutputStream out) throws IOException
Create a newMZTabParserContext
andMZTabErrorList
for the given file URI. Parsing output and errors are written to the providedOutputStream
. Reports up toMZTabProperties.MAX_ERROR_COUNT
errors on levelMZTabProperties.LEVEL
.- Parameters:
out
- the output stream for parsing messages- Returns:
- the error list
- Throws:
IOException
- if any io related errors occur.
-
getErrorList
public uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorList getErrorList()
Getter for the field
errorList
.- Returns:
- a
MZTabErrorList
object.
-
checkColunitMapping
protected void checkColunitMapping(MZTabColumnFactory columnFactory, Optional<Collection<de.isas.mztab2.model.ColumnParameterMapping>> columnParameterMapping, de.isas.mztab2.model.Metadata.Properties colUnitProperty, de.isas.mztab2.model.MzTab.Properties mzTabSection)
-
getMZTabFile
public de.isas.mztab2.model.MzTab getMZTabFile()
getMZTabFile.
- Returns:
- a
MzTab
object.
-
-