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 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, MZTabErrorType errorType, int lineNumber, Consumer<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, 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, MZTabErrorList errorList) throws 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:
MZTabException
- if any.
-
handleIdConfidenceMeasure
protected void handleIdConfidenceMeasure(String defineLabel, Matcher matcher, String valueLabel) throws MZTabException
- Throws:
MZTabException
-
handleColunit
protected void handleColunit(String defineLabel, String valueLabel) throws MZTabErrorOverflowException
- Throws:
MZTabErrorOverflowException
-
handleDatabase
protected void handleDatabase(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel) throws MZTabException
- Throws:
MZTabException
-
handleCv
protected void handleCv(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel) throws MZTabException
- Throws:
MZTabException
-
handleStudyVariable
protected void handleStudyVariable(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel) throws MZTabException, MZTabErrorOverflowException
-
handleAssay
protected void handleAssay(Matcher matcher, String defineLabel, MetadataElement element, String valueLabel) throws MZTabException
- Throws:
MZTabException
-
handleSample
protected void handleSample(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel) throws MZTabException
- Throws:
MZTabException
-
handleCustom
protected void handleCustom(String defineLabel, Matcher matcher, String valueLabel) throws MZTabException
- Throws:
MZTabException
-
handleDerivatizationAgent
protected void handleDerivatizationAgent(String defineLabel, Matcher matcher, String valueLabel) throws MZTabException
- Throws:
MZTabException
-
handleMsRun
protected void handleMsRun(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel) throws MZTabException
- Throws:
MZTabException
-
handleSmallMoleculeFeature
protected void handleSmallMoleculeFeature(MetadataElement element, Matcher matcher, String defineLabel, String valueLabel) throws MZTabException
- Throws:
MZTabException
-
handleSmallMolecule
protected void handleSmallMolecule(MetadataElement element, Matcher matcher, String defineLabel, String valueLabel) throws MZTabException
- Throws:
MZTabException
-
handleQuantificationMethod
protected void handleQuantificationMethod(String defineLabel, String valueLabel) throws MZTabException
- Throws:
MZTabException
-
handleExternalStudyUri
protected void handleExternalStudyUri(String defineLabel, Matcher matcher, String valueLabel) throws MZTabException
- Throws:
MZTabException
-
handleUri
protected void handleUri(String defineLabel, Matcher matcher, String valueLabel, boolean mandatory) throws MZTabException
- Throws:
MZTabException
-
handleContact
protected void handleContact(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel) throws MZTabException
- Throws:
MZTabException
-
handlePublication
protected void handlePublication(String defineLabel, Matcher matcher, String valueLabel) throws MZTabException
- Throws:
MZTabException
-
handleSoftware
protected void handleSoftware(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel) throws MZTabErrorOverflowException, MZTabException
-
handleInstrument
protected void handleInstrument(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel) throws MZTabException
- Throws:
MZTabException
-
handleSampleProcessing
protected void handleSampleProcessing(String defineLabel, Matcher matcher, String valueLabel) throws MZTabException
- Throws:
MZTabException
-
handleDescription
protected void handleDescription(String defineLabel, String valueLabel) throws MZTabException
- Throws:
MZTabException
-
handleTitle
protected void handleTitle(String defineLabel, String valueLabel) throws MZTabException
- Throws:
MZTabException
-
handleMzTab
protected void handleMzTab(MetadataElement element, Matcher matcher, String defineLabel, String valueLabel) throws MZTabException
- Throws:
MZTabException
-
refineNormalMetadata
public void refineNormalMetadata() throws 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:
MZTabException
- if any.
-
getMetadata
public Metadata getMetadata()
Getter for the field
metadata
.- Returns:
- a
Metadata
object.
-
handleParam
public void handleParam(String defineLabel, String valueLabel, MZTabErrorType errorType, int lineNumber, Consumer<Parameter> consumer) throws MZTabErrorOverflowException
handleParam.
- Parameters:
defineLabel
- aString
object.valueLabel
- aString
object.errorType
- aMZTabErrorType
object.lineNumber
- a int.consumer
- aConsumer
object.- Throws:
MZTabErrorOverflowException
- if any.
-
-