Class MTDLineParser
- java.lang.Object
-
- uk.ac.ebi.pride.jmztab2.utils.parser.MZTabLineParser
-
- uk.ac.ebi.pride.jmztab2.utils.parser.MTDLineParser
-
public class MTDLineParser extends MZTabLineParser
Parse a metadata line into a element. Metadata Element start with MTD, its structure like: MTDMetadataElement
([id])(-MetadataProperty
) {Element Value}- Since:
- 08/02/13
- Author:
- qingwei, nilshoffmann
- See Also:
MetadataElement
,MetadataProperty
-
-
Field Summary
-
Fields inherited from class uk.ac.ebi.pride.jmztab2.utils.parser.MZTabLineParser
context, errorList, items, line, lineNumber, section
-
-
Constructor Summary
Constructors Constructor Description MTDLineParser(MZTabParserContext context)
Constructor for MTDLineParser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description de.isas.mztab2.model.Metadata
getMetadata()
Getter for the fieldmetadata
.protected void
handleAssay(Matcher matcher, String defineLabel, MetadataElement element, String valueLabel)
protected void
handleColunit(String defineLabel, String valueLabel)
protected void
handleContact(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel)
protected void
handleCustom(String defineLabel, Matcher matcher, String valueLabel)
protected void
handleCv(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel)
protected void
handleDatabase(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel)
protected void
handleDerivatizationAgent(String defineLabel, Matcher matcher, String valueLabel)
protected void
handleDescription(String defineLabel, String valueLabel)
protected void
handleExternalStudyUri(String defineLabel, Matcher matcher, String valueLabel)
protected void
handleIdConfidenceMeasure(String defineLabel, Matcher matcher, String valueLabel)
protected void
handleInstrument(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel)
protected void
handleMsRun(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel)
protected void
handleMzTab(MetadataElement element, Matcher matcher, String defineLabel, String valueLabel)
void
handleParam(String defineLabel, String valueLabel, uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorType errorType, int lineNumber, Consumer<de.isas.mztab2.model.Parameter> consumer)
handleParam.protected void
handlePublication(String defineLabel, Matcher matcher, String valueLabel)
protected void
handleQuantificationMethod(String defineLabel, String valueLabel)
protected void
handleSample(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel)
protected void
handleSampleProcessing(String defineLabel, Matcher matcher, String valueLabel)
protected void
handleSmallMolecule(MetadataElement element, Matcher matcher, String defineLabel, String valueLabel)
protected void
handleSmallMoleculeFeature(MetadataElement element, Matcher matcher, String defineLabel, String valueLabel)
protected void
handleSoftware(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel)
protected void
handleStudyVariable(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel)
protected void
handleTitle(String defineLabel, String valueLabel)
protected void
handleUri(String defineLabel, Matcher matcher, String valueLabel, boolean mandatory)
void
parse(int lineNumber, String mtdLine, uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorList errorList)
We assume that user before call this method, have parse the raw line is not empty line and start with section prefix.void
refineNormalMetadata()
Refine the metadata, and check whether missing some important information. fixed_mode, variable_mode must provide in the Complete file.
-
-
-
Constructor Detail
-
MTDLineParser
public MTDLineParser(MZTabParserContext context)
Constructor for MTDLineParser.
- Parameters:
context
- aMZTabParserContext
object.
-
-
Method Detail
-
parse
public void parse(int lineNumber, String mtdLine, uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorList errorList) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
We assume that user before call this method, have parse the raw line is not empty line and start with section prefix. Most of e, we useparseNormalMetadata(String, String)
to parse defineLabel into Metadata Element.- Overrides:
parse
in classMZTabLineParser
- Parameters:
lineNumber
- a int.mtdLine
- aString
object.errorList
- aMZTabErrorList
object.- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
- if any.
-
handleIdConfidenceMeasure
protected void handleIdConfidenceMeasure(String defineLabel, Matcher matcher, String valueLabel) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
-
handleColunit
protected void handleColunit(String defineLabel, String valueLabel) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorOverflowException
- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorOverflowException
-
handleDatabase
protected void handleDatabase(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
-
handleCv
protected void handleCv(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
-
handleStudyVariable
protected void handleStudyVariable(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException, uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorOverflowException
- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorOverflowException
-
handleAssay
protected void handleAssay(Matcher matcher, String defineLabel, MetadataElement element, String valueLabel) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
-
handleSample
protected void handleSample(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
-
handleCustom
protected void handleCustom(String defineLabel, Matcher matcher, String valueLabel) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
-
handleDerivatizationAgent
protected void handleDerivatizationAgent(String defineLabel, Matcher matcher, String valueLabel) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
-
handleMsRun
protected void handleMsRun(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
-
handleSmallMoleculeFeature
protected void handleSmallMoleculeFeature(MetadataElement element, Matcher matcher, String defineLabel, String valueLabel) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
-
handleSmallMolecule
protected void handleSmallMolecule(MetadataElement element, Matcher matcher, String defineLabel, String valueLabel) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
-
handleQuantificationMethod
protected void handleQuantificationMethod(String defineLabel, String valueLabel) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
-
handleExternalStudyUri
protected void handleExternalStudyUri(String defineLabel, Matcher matcher, String valueLabel) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
-
handleUri
protected void handleUri(String defineLabel, Matcher matcher, String valueLabel, boolean mandatory) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
-
handleContact
protected void handleContact(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
-
handlePublication
protected void handlePublication(String defineLabel, Matcher matcher, String valueLabel) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
-
handleSoftware
protected void handleSoftware(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorOverflowException, uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorOverflowException
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
-
handleInstrument
protected void handleInstrument(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
-
handleSampleProcessing
protected void handleSampleProcessing(String defineLabel, Matcher matcher, String valueLabel) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
-
handleDescription
protected void handleDescription(String defineLabel, String valueLabel) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
-
handleTitle
protected void handleTitle(String defineLabel, String valueLabel) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
-
handleMzTab
protected void handleMzTab(MetadataElement element, Matcher matcher, String defineLabel, String valueLabel) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
-
refineNormalMetadata
public void refineNormalMetadata() throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
Refine the metadata, and check whether missing some important information. fixed_mode, variable_mode must provide in the Complete file. Detail information see specification 5.5- Throws:
uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
- if any.
-
getMetadata
public de.isas.mztab2.model.Metadata getMetadata()
Getter for the field
metadata
.- Returns:
- a
Metadata
object.
-
handleParam
public void handleParam(String defineLabel, String valueLabel, uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorType errorType, int lineNumber, Consumer<de.isas.mztab2.model.Parameter> consumer) throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorOverflowException
handleParam.
-
-