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 MetadatagetMetadata()Getter for the fieldmetadata.protected voidhandleAssay(Matcher matcher, String defineLabel, MetadataElement element, String valueLabel)protected voidhandleColunit(String defineLabel, String valueLabel)protected voidhandleContact(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel)protected voidhandleCustom(String defineLabel, Matcher matcher, String valueLabel)protected voidhandleCv(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel)protected voidhandleDatabase(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel)protected voidhandleDerivatizationAgent(String defineLabel, Matcher matcher, String valueLabel)protected voidhandleDescription(String defineLabel, String valueLabel)protected voidhandleExternalStudyUri(String defineLabel, Matcher matcher, String valueLabel)protected voidhandleIdConfidenceMeasure(String defineLabel, Matcher matcher, String valueLabel)protected voidhandleInstrument(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel)protected voidhandleMsRun(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel)protected voidhandleMzTab(MetadataElement element, Matcher matcher, String defineLabel, String valueLabel)voidhandleParam(String defineLabel, String valueLabel, MZTabErrorType errorType, int lineNumber, Consumer<Parameter> consumer)handleParam.protected voidhandlePublication(String defineLabel, Matcher matcher, String valueLabel)protected voidhandleQuantificationMethod(String defineLabel, String valueLabel)protected voidhandleSample(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel)protected voidhandleSampleProcessing(String defineLabel, Matcher matcher, String valueLabel)protected voidhandleSmallMolecule(MetadataElement element, Matcher matcher, String defineLabel, String valueLabel)protected voidhandleSmallMoleculeFeature(MetadataElement element, Matcher matcher, String defineLabel, String valueLabel)protected voidhandleSoftware(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel)protected voidhandleStudyVariable(String defineLabel, Matcher matcher, MetadataElement element, String valueLabel)protected voidhandleTitle(String defineLabel, String valueLabel)protected voidhandleUri(String defineLabel, Matcher matcher, String valueLabel, boolean mandatory)voidparse(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.voidrefineNormalMetadata()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- aMZTabParserContextobject.
-
-
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:
parsein classMZTabLineParser- Parameters:
lineNumber- a int.mtdLine- aStringobject.errorList- aMZTabErrorListobject.- 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
Metadataobject.
-
handleParam
public void handleParam(String defineLabel, String valueLabel, MZTabErrorType errorType, int lineNumber, Consumer<Parameter> consumer) throws MZTabErrorOverflowException
handleParam.
- Parameters:
defineLabel- aStringobject.valueLabel- aStringobject.errorType- aMZTabErrorTypeobject.lineNumber- a int.consumer- aConsumerobject.- Throws:
MZTabErrorOverflowException- if any.
-
-