Class MZTabParserContext
- java.lang.Object
-
- uk.ac.ebi.pride.jmztab2.utils.parser.MZTabParserContext
-
public class MZTabParserContext extends Object
MZTabParserContext is used to keep track of indexed elements and interrelations during parsing.
- Since:
- 11/09/17
- Author:
- nilshoffmann
-
-
Constructor Summary
Constructors Constructor Description MZTabParserContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Assay
addAssay(Metadata metadata, Assay assay)
Add a assay into metadata.Assay
addAssayCustom(Metadata metadata, Integer id, Parameter param)
Add a assay[id]-custom[i] into metadata.Assay
addAssayExternalUri(Metadata metadata, Integer id, URI location)
Add a assay[id]-external_uri into metadata.Assay
addAssayMsRun(Metadata metadata, Integer id, MsRun msRun)
Add assay[id]-ms_run_ref into metadata.Assay
addAssaySample(Metadata metadata, Integer id, Sample sample)
Add assay[id]-sample_ref into metadata.Contact
addContact(Metadata metadata, Contact contact)
Add a contact into metadata.Contact
addContactAffiliation(Metadata metadata, Integer id, String affiliation)
Add contact[id]-affiliation.Contact
addContactEmail(Metadata metadata, Integer id, String email)
Add contact[id]-emailContact
addContactName(Metadata metadata, Integer id, String name)
Add contact[id]-name.CV
addCV(Metadata metadata, CV cv)
Add a controlled vocabularies/ontologies into metadata.CV
addCVFullName(Metadata metadata, Integer id, String fullName)
Add a cv[id]-full_name.CV
addCVLabel(Metadata metadata, Integer id, String label)
Add a cv[id]-label.CV
addCVURI(Metadata metadata, Integer id, String uri)
Add a cv[id]-uri.CV
addCVVersion(Metadata metadata, Integer id, String version)
Add a cv[id]-version.Database
addDatabase(Metadata metadata, Database database)
addDatabase.Database
addDatabasePrefix(Metadata metadata, Integer id, String valueLabel)
addDatabasePrefix.Database
addDatabaseUri(Metadata metadata, Integer id, URI checkURI)
addDatabaseUri.Database
addDatabaseVersion(Metadata metadata, Integer id, String version)
addDatabaseVersion.Instrument
addInstrument(Metadata metadata, Instrument instrument)
Add a instrument[id] to metadata.Instrument
addInstrumentAnalyzer(Metadata metadata, Integer id, Parameter analyzer)
Add a parameter for instrument[id]-analyzer[i]Instrument
addInstrumentDetector(Metadata metadata, Integer id, Parameter detector)
Add a parameter for instrument[id]-detectorInstrument
addInstrumentName(Metadata metadata, Integer id, Parameter name)
Add a parameter for instrument[id]-nameInstrument
addInstrumentSource(Metadata metadata, Integer id, Parameter source)
Add a parameter for instrument[id]-sourceMsRun
addMsRun(Metadata metadata, MsRun msRun)
Add a ms_run[id] into metadata.MsRun
addMsRunFormat(Metadata metadata, Integer id, Parameter format)
Add ms_run[id]-format into metadata.MsRun
addMsRunFragmentationMethod(Metadata metadata, Integer id, Parameter fragmentationMethod)
Add ms_run[id]-fragmentation_method into metadata.MsRun
addMsRunHash(Metadata metadata, Integer id, String hash)
addMsRunHash.MsRun
addMsRunHashMethod(Metadata metadata, Integer id, Parameter hashMethod)
addMsRunHashMethod.MsRun
addMsRunIdFormat(Metadata metadata, Integer id, Parameter idFormat)
Add ms_run[id]-id_format into metadata.MsRun
addMsRunInstrumentRef(Metadata metadata, Integer id, Instrument instrument)
Add ms_run[id]-instrument_ref into metadata.MsRun
addMsRunLocation(Metadata metadata, Integer id, URI location)
Add ms_run[id]-location into metadata.MsRun
addMsRunScanPolarity(Metadata metadata, Integer id, Parameter scanPolarity)
addMsRunScanPolarity.Publication
addPublication(Metadata metadata, Publication publication)
Add a publiction to metadata.Publication
addPublicationItem(Metadata metadata, Integer id, PublicationItem.TypeEnum type, String accession)
Add a publication item to metadata.Publication
addPublicationItems(Metadata metadata, Integer id, Collection<PublicationItem> items)
Add a couple of publication items into publication[id].Sample
addSample(Metadata metadata, Sample sample)
Add a sample to metadata.Sample
addSampleCellType(Metadata metadata, Integer id, Parameter cellType)
Add a sample[id]-cell_type into sample.Sample
addSampleCustom(Metadata metadata, Integer id, Parameter custom)
Add a sample[id]-custom into sample.Sample
addSampleDescription(Metadata metadata, Integer id, String description)
Add a sample[id]-description into sample.Sample
addSampleDisease(Metadata metadata, Integer id, Parameter disease)
Add a sample[id]-disease into sample.SampleProcessing
addSampleProcessing(Metadata metadata, Integer id, List<Parameter> sampleProcessing)
Add a sample_processing[id].SampleProcessing
addSampleProcessingParameter(Metadata metadata, Integer id, Parameter param)
Add a processing parameter to sample_processing[id]Sample
addSampleSpecies(Metadata metadata, Integer id, Parameter species)
Add a sample[id]-species into sample.Sample
addSampleTissue(Metadata metadata, Integer id, Parameter tissue)
Add a sample[id]-tissue into sample.void
addSmallMoleculeColUnit(Metadata metadata, String columnName, Parameter param)
Defines the unit for the data reported in a column of the small molecule section.void
addSmallMoleculeEvidenceColUnit(Metadata metadata, String columnName, Parameter param)
Defines the unit for the data reported in a column of the small molecule section.void
addSmallMoleculeFeatureColUnit(Metadata metadata, String columnName, Parameter param)
Defines the unit for the data reported in a column of the small molecule section.Software
addSoftware(Metadata metadata, Software software)
Add a software to metadata, which used to analyze the data and obtain the reported results.Software
addSoftwareParameter(Metadata metadata, Integer id, Parameter param)
Add a software[id] parameter.Software
addSoftwareSetting(Metadata metadata, Integer id, String setting)
Add a software[id]-setting.StudyVariable
addStudyVariable(Metadata metadata, StudyVariable studyVariable)
Add a study variable into metadata.StudyVariable
addStudyVariableAssay(Metadata metadata, Integer id, Assay assay)
Add a study_variable[id]-assay_refs.StudyVariable
addStudyVariableAverageFunction(Metadata metadata, Integer id, Parameter checkParameter)
Add a study_variable[id]-average_function.StudyVariable
addStudyVariableDescription(Metadata metadata, Integer id, String description)
Add a study_variable[id]-description.StudyVariable
addStudyVariableFactors(Metadata metadata, Integer id, Parameter checkParameter)
Add a study_variable[id]-factor.StudyVariable
addStudyVariableVariationFunction(Metadata metadata, Integer id, Parameter checkParameter)
Add a study_variable[id]-variation_function.Map<String,String>
getColUnitMap()
Defines a method to access the colUnit to help in the transformation from columnName String -> to columnName MZTabColumn
-
-
-
Constructor Detail
-
MZTabParserContext
public MZTabParserContext()
-
-
Method Detail
-
addSample
public Sample addSample(Metadata metadata, Sample sample)
Add a sample to metadata. Samples are NOT MANDATORY in mzTab, since many software packages cannot determine what type of sample was analysed (e.g. whether biological or technical replication was performed).
-
addSampleSpecies
public Sample addSampleSpecies(Metadata metadata, Integer id, Parameter species)
Add a sample[id]-species into sample.
-
addSampleTissue
public Sample addSampleTissue(Metadata metadata, Integer id, Parameter tissue)
Add a sample[id]-tissue into sample.
-
addSampleCellType
public Sample addSampleCellType(Metadata metadata, Integer id, Parameter cellType)
Add a sample[id]-cell_type into sample.
-
addSampleDisease
public Sample addSampleDisease(Metadata metadata, Integer id, Parameter disease)
Add a sample[id]-disease into sample.
-
addSampleDescription
public Sample addSampleDescription(Metadata metadata, Integer id, String description)
Add a sample[id]-description into sample.
-
addSampleCustom
public Sample addSampleCustom(Metadata metadata, Integer id, Parameter custom)
Add a sample[id]-custom into sample. Add a custom parameter for sample.
-
addSampleProcessing
public SampleProcessing addSampleProcessing(Metadata metadata, Integer id, List<Parameter> sampleProcessing)
Add a sample_processing[id]. A list of parameters describing a sample processing step. The order of the data_processing items should reflect the order these processing steps were performed in. If multiple parameters are given for a step these MUST be separated by a "|".- Parameters:
id
- SHOULD be positive integer.sampleProcessing
- if null ignore operation.metadata
- aMetadata
object.- Returns:
- a
SampleProcessing
object.
-
addSampleProcessingParameter
public SampleProcessing addSampleProcessingParameter(Metadata metadata, Integer id, Parameter param)
Add a processing parameter to sample_processing[id]- Parameters:
id
- SHOULD be positive integer.param
- if null ignore operation.metadata
- aMetadata
object.- Returns:
- a
SampleProcessing
object.
-
addInstrument
public Instrument addInstrument(Metadata metadata, Instrument instrument)
Add a instrument[id] to metadata.- Parameters:
instrument
- SHOULD NOT be null.metadata
- aMetadata
object.- Returns:
- a
Instrument
object.
-
addInstrumentName
public Instrument addInstrumentName(Metadata metadata, Integer id, Parameter name)
Add a parameter for instrument[id]-name- Parameters:
id
- SHOULD be positive integer.name
- if null ignore operation.metadata
- aMetadata
object.- Returns:
- a
Instrument
object.
-
addInstrumentSource
public Instrument addInstrumentSource(Metadata metadata, Integer id, Parameter source)
Add a parameter for instrument[id]-source- Parameters:
id
- SHOULD be positive integer.source
- if null ignore operation.metadata
- aMetadata
object.- Returns:
- a
Instrument
object.
-
addInstrumentAnalyzer
public Instrument addInstrumentAnalyzer(Metadata metadata, Integer id, Parameter analyzer)
Add a parameter for instrument[id]-analyzer[i]- Parameters:
id
- SHOULD be positive integer.analyzer
- if null ignore operation.metadata
- aMetadata
object.- Returns:
- a
Instrument
object.
-
addInstrumentDetector
public Instrument addInstrumentDetector(Metadata metadata, Integer id, Parameter detector)
Add a parameter for instrument[id]-detector- Parameters:
id
- SHOULD be positive integer.detector
- if null ignore operation.metadata
- aMetadata
object.- Returns:
- a
Instrument
object.
-
addSoftware
public Software addSoftware(Metadata metadata, Software software)
Add a software to metadata, which used to analyze the data and obtain the reported results.
-
addSoftwareParameter
public Software addSoftwareParameter(Metadata metadata, Integer id, Parameter param)
Add a software[id] parameter. The parameter's value SHOULD contain the software's version. The order (numbering) should reflect the order in which the tools were used.
-
addSoftwareSetting
public Software addSoftwareSetting(Metadata metadata, Integer id, String setting)
Add a software[id]-setting. This field MAY occur multiple times for a single software. The value of this field is deliberately set as a String, since there currently do not exist cvParameters for every possible setting.
-
addPublication
public Publication addPublication(Metadata metadata, Publication publication)
Add a publiction to metadata. A publication associated with this file. Several publications can be given by indicating the number in the square brackets after "publication". PubMed ids must be prefixed by "pubmed:", DOIs by "doi:". Multiple identifiers MUST be separated by "|".- Parameters:
publication
- SHOULD NOT be null.metadata
- aMetadata
object.- Returns:
- a
Publication
object.
-
addPublicationItem
public Publication addPublicationItem(Metadata metadata, Integer id, PublicationItem.TypeEnum type, String accession)
Add a publication item to metadata. PubMed ids must be prefixed by "pubmed:", DOIs by "doi:". Multiple identifiers MUST be separated by "|".- Parameters:
id
- SHOULD be positive integer.type
- SHOULD NOT be null.accession
- SHOULD NOT set empty.metadata
- aMetadata
object.- Returns:
- a
Publication
object.
-
addPublicationItems
public Publication addPublicationItems(Metadata metadata, Integer id, Collection<PublicationItem> items)
Add a couple of publication items into publication[id]. Several publications can be given by indicating the number in the square brackets after "publication". PubMed ids must be prefixed by "pubmed:", DOIs by "doi:". Multiple identifiers MUST be separated by "|".- Parameters:
id
- SHOULD be positive integer.items
- SHOULD NOT be null.metadata
- aMetadata
object.- Returns:
- a
Publication
object.
-
addContact
public Contact addContact(Metadata metadata, Contact contact)
Add a contact into metadata.
-
addContactName
public Contact addContactName(Metadata metadata, Integer id, String name)
Add contact[id]-name. Several contacts can be given by indicating the number in the square brackets after "contact". A contact has to be supplied in the format [first name] [initials] [last name] (see example).
-
addContactAffiliation
public Contact addContactAffiliation(Metadata metadata, Integer id, String affiliation)
Add contact[id]-affiliation.
-
addContactEmail
public Contact addContactEmail(Metadata metadata, Integer id, String email)
Add contact[id]-email
-
addMsRun
public MsRun addMsRun(Metadata metadata, MsRun msRun)
Add a ms_run[id] into metadata. An MS run is effectively one run (or set of runs on pre-fractionated samples) on an MS instrument, and is referenced from assay in different contexts.
-
addMsRunFormat
public MsRun addMsRunFormat(Metadata metadata, Integer id, Parameter format)
Add ms_run[id]-format into metadata. A parameter specifying the data format of the external MS data file.
-
addMsRunLocation
public MsRun addMsRunLocation(Metadata metadata, Integer id, URI location)
Add ms_run[id]-location into metadata. Location of the external data file. If the actual location of the MS run is unknown, a "null" MUST be used as a place holder value.
-
addMsRunInstrumentRef
public MsRun addMsRunInstrumentRef(Metadata metadata, Integer id, Instrument instrument)
Add ms_run[id]-instrument_ref into metadata. Reference to a commonly used instrument.
-
addMsRunIdFormat
public MsRun addMsRunIdFormat(Metadata metadata, Integer id, Parameter idFormat)
Add ms_run[id]-id_format into metadata. Parameter specifying the id format used in the external data file.
-
addMsRunFragmentationMethod
public MsRun addMsRunFragmentationMethod(Metadata metadata, Integer id, Parameter fragmentationMethod)
Add ms_run[id]-fragmentation_method into metadata. A list of "|" separated parameters describing all the types of fragmentation used in a given ms run.
-
addMsRunHash
public MsRun addMsRunHash(Metadata metadata, Integer id, String hash)
addMsRunHash.
-
addMsRunHashMethod
public MsRun addMsRunHashMethod(Metadata metadata, Integer id, Parameter hashMethod)
addMsRunHashMethod.
-
addMsRunScanPolarity
public MsRun addMsRunScanPolarity(Metadata metadata, Integer id, Parameter scanPolarity)
addMsRunScanPolarity.
-
addAssay
public Assay addAssay(Metadata metadata, Assay assay)
Add a assay into metadata. The application of a measurement about the sample (in this case through MS) - producing values about small molecules, peptides or proteins. One assay is typically mapped to one MS run in the case of label-free MS analysis or multiple assays are mapped to one MS run for multiplexed techniques, along with a description of the label or tag applied.
-
addAssayCustom
public Assay addAssayCustom(Metadata metadata, Integer id, Parameter param)
Add a assay[id]-custom[i] into metadata. The application of a measurement about the sample (in this case through MS) - producing values about small molecules, peptides or proteins. One assay is typically mapped to one MS run in the case of label-free MS analysis or multiple assays are mapped to one MS run for multiplexed techniques, along with a description of the label or tag applied.
-
addAssayExternalUri
public Assay addAssayExternalUri(Metadata metadata, Integer id, URI location)
Add a assay[id]-external_uri into metadata. The application of a measurement about the sample (in this case through MS) - producing values about small molecules, peptides or proteins. One assay is typically mapped to one MS run in the case of label-free MS analysis or multiple assays are mapped to one MS run for multiplexed techniques, along with a description of the label or tag applied.
-
addAssaySample
public Assay addAssaySample(Metadata metadata, Integer id, Sample sample)
Add assay[id]-sample_ref into metadata. An association from a given assay to the sample analysed.
-
addAssayMsRun
public Assay addAssayMsRun(Metadata metadata, Integer id, MsRun msRun)
Add assay[id]-ms_run_ref into metadata. An association from a given assay to the source MS run.
-
addStudyVariable
public StudyVariable addStudyVariable(Metadata metadata, StudyVariable studyVariable)
Add a study variable into metadata. The variables about which the final results of a study are reported, which may have been derived following averaging across a group of replicate measurements (assays). In files where assays are reported, study variables have references to assays. The same concept has been defined by others as "experimental factor".- Parameters:
studyVariable
- SHOULD NOT be null.metadata
- aMetadata
object.- Returns:
- a
StudyVariable
object.
-
addStudyVariableAssay
public StudyVariable addStudyVariableAssay(Metadata metadata, Integer id, Assay assay)
Add a study_variable[id]-assay_refs. Comma-separated references to the IDs of assays grouped in the study variable.- Parameters:
id
- SHOULD be positive integer.assay
- SHOULD NOT be null, and should be defined in metadata first.metadata
- aMetadata
object.- Returns:
- a
StudyVariable
object.
-
addStudyVariableDescription
public StudyVariable addStudyVariableDescription(Metadata metadata, Integer id, String description)
Add a study_variable[id]-description. A textual description of the study variable.- Parameters:
metadata
- aMetadata
object.id
- SHOULD be positive integer.description
- if empty ignore operation.- Returns:
- a
StudyVariable
object.
-
addStudyVariableFactors
public StudyVariable addStudyVariableFactors(Metadata metadata, Integer id, Parameter checkParameter)
Add a study_variable[id]-factor. A Parameter further refining what is known about the study design.- Parameters:
metadata
- aMetadata
object.id
- id SHOULD be positive integer.checkParameter
- the study variable factor Parameter to add.- Returns:
- a
StudyVariable
object.
-
addStudyVariableVariationFunction
public StudyVariable addStudyVariableVariationFunction(Metadata metadata, Integer id, Parameter checkParameter)
Add a study_variable[id]-variation_function. This is a Parameter detailing how the reported study variable abundances have been calculated.- Parameters:
metadata
- aMetadata
object.id
- SHOULD be positive integer.checkParameter
- the parameter.- Returns:
- a
StudyVariable
object.
-
addStudyVariableAverageFunction
public StudyVariable addStudyVariableAverageFunction(Metadata metadata, Integer id, Parameter checkParameter)
Add a study_variable[id]-average_function. This is a Parameter detailing how the reported study variable abundances have been calculated.- Parameters:
metadata
- aMetadata
object.id
- SHOULD be positive integer.checkParameter
- the parameter.- Returns:
- a
StudyVariable
object.
-
addCV
public CV addCV(Metadata metadata, CV cv)
Add a controlled vocabularies/ontologies into metadata. Define the controlled vocabularies/ontologies used in the mzTab file.
-
addCVLabel
public CV addCVLabel(Metadata metadata, Integer id, String label)
Add a cv[id]-label. A string describing the labels of the controlled vocabularies/ontologies used in the mzTab file
-
addCVFullName
public CV addCVFullName(Metadata metadata, Integer id, String fullName)
Add a cv[id]-full_name. A string describing the full names of the controlled vocabularies/ontologies used in the mzTab file
-
addCVVersion
public CV addCVVersion(Metadata metadata, Integer id, String version)
Add a cv[id]-version. A string describing the version of the controlled vocabularies/ontologies used in the mzTab file
-
addCVURI
public CV addCVURI(Metadata metadata, Integer id, String uri)
Add a cv[id]-uri. A string containing the URIs of the controlled vocabularies/ontologies used in the mzTab file
-
addSmallMoleculeColUnit
public void addSmallMoleculeColUnit(Metadata metadata, String columnName, Parameter param)
Defines the unit for the data reported in a column of the small molecule section. Defines the used unit for a column in the small molecule section. The format of the value has to be {column name}={Parameter defining the unit} This field MUST NOT be used to define a unit for quantification columns. The unit used for small molecule quantification values MUST be set in small_molecule-quantification_unit.- Parameters:
metadata
- aMetadata
object.columnName
- SHOULD NOT be nullparam
- SHOULD NOT be null
-
addSmallMoleculeFeatureColUnit
public void addSmallMoleculeFeatureColUnit(Metadata metadata, String columnName, Parameter param)
Defines the unit for the data reported in a column of the small molecule section. Defines the used unit for a column in the small molecule section. The format of the value has to be {column name}={Parameter defining the unit} This field MUST NOT be used to define a unit for quantification columns. The unit used for small molecule quantification values MUST be set in small_molecule-quantification_unit.- Parameters:
metadata
- aMetadata
object.columnName
- SHOULD NOT be nullparam
- SHOULD NOT be null
-
addSmallMoleculeEvidenceColUnit
public void addSmallMoleculeEvidenceColUnit(Metadata metadata, String columnName, Parameter param)
Defines the unit for the data reported in a column of the small molecule section. Defines the used unit for a column in the small molecule section. The format of the value has to be {column name}={Parameter defining the unit} This field MUST NOT be used to define a unit for quantification columns. The unit used for small molecule quantification values MUST be set in small_molecule-quantification_unit.- Parameters:
metadata
- aMetadata
object.columnName
- SHOULD NOT be nullparam
- SHOULD NOT be null
-
getColUnitMap
public Map<String,String> getColUnitMap()
Defines a method to access the colUnit to help in the transformation from columnName String -> to columnName MZTabColumn- Returns:
- a
Map
object.
-
addDatabase
public Database addDatabase(Metadata metadata, Database database)
addDatabase.
-
addDatabasePrefix
public Database addDatabasePrefix(Metadata metadata, Integer id, String valueLabel)
addDatabasePrefix.
-
addDatabaseVersion
public Database addDatabaseVersion(Metadata metadata, Integer id, String version)
addDatabaseVersion.
-
-