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 newMZTabFileParserfor the given file.MzTabFileParser(URI tabFileUri)Create a newMZTabFileParserfor the given file URI.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckColunitMapping(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.MZTabErrorListgetErrorList()Getter for the fielderrorList.de.isas.mztab2.model.MzTabgetMZTabFile()getMZTabFile.uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorListparse(OutputStream out)Create a newMZTabParserContextandMZTabErrorListfor the given file URI.uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorListparse(OutputStream out, uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorType.Level level)Create a newMZTabParserContextandMZTabErrorListfor the given file URI.uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorListparse(OutputStream out, uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorType.Level level, int maxErrorCount)Create a newMZTabParserContextandMZTabErrorListfor the given file URI.
-
-
-
Constructor Detail
-
MzTabFileParser
public MzTabFileParser(File tabFile) throws IllegalArgumentException
Create a newMZTabFileParserfor 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 newMZTabFileParserfor the given file URI.- Parameters:
tabFileUri- the MZTab file URI. The file SHOULD not be null and MUST existMZTabErrorListreturn 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 newMZTabParserContextandMZTabErrorListfor 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 theMZTabErrorListreturn 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 newMZTabParserContextandMZTabErrorListfor the given file URI. Parsing output and errors are written to the providedOutputStream. Reports up toMZTabProperties.MAX_ERROR_COUNTerrors.- 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 newMZTabParserContextandMZTabErrorListfor the given file URI. Parsing output and errors are written to the providedOutputStream. Reports up toMZTabProperties.MAX_ERROR_COUNTerrors 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
MZTabErrorListobject.
-
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
MzTabobject.
-
-