Package de.isas.mztab2.model
Class MzTabAccess
- java.lang.Object
-
- de.isas.mztab2.model.MzTabAccess
-
public class MzTabAccess extends Object
Utility class for easier access to linked information within an mztab-M data object.- Author:
- nilshoffmann
-
-
Constructor Summary
Constructors Constructor Description MzTabAccess(MzTab mzTab)
Create an MzTabAccess object for the provided mzTab object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Double
getAbundanceFor(Assay assay, SmallMoleculeFeature smf)
Retrieves the abundance value for the provided assay and small molecule feature object.Double
getAbundanceFor(Assay assay, SmallMoleculeSummary sms)
Retrieves the abundance value for the provided assay and small molecule summary object.Double
getAbundanceFor(StudyVariable studyVariable, SmallMoleculeSummary sms)
Retrieves the abundance value for the provided study variable and small molecule summary object.Double
getAbundanceVariationFor(StudyVariable studyVariable, SmallMoleculeSummary sms)
Retrieves the abundance variation value for the provided study variable and small molecule summary object.Optional<Assay>
getAssayFor(OptColumnMapping columnMapping, Metadata metadata)
Tries to locate the assay referenced by id from the columnMapping identifier.Optional<Assay>
getAssayFor(Integer id, Metadata metadata)
Tries to locate the assay referenced by id from the metadata section.Optional<Database>
getDatabaseFor(Integer id, Metadata metadata)
Tries to locate the database referenced by id from the metadata section.List<SmallMoleculeEvidence>
getEvidences(SmallMoleculeFeature smf)
Retrieve all small molecule evidences in order of definition for the provided small molecule feature.List<SmallMoleculeEvidence>
getEvidencesByEvidenceInputId(String evidenceInputId)
Retrieve all small molecule evidences for the provided evidence input id.List<SmallMoleculeFeature>
getFeatures(SmallMoleculeSummary sms)
Retrieve all small molecule features in order of definition for the provided small molecule summary.Optional<MsRun>
getMsRunFor(Integer id, Metadata metadata)
Tries to locate the ms run referenced by id from the metadata section.Optional<StudyVariable>
getStudyVariableFor(Integer id, Metadata metadata)
Tries to locate the study variable referenced by id from the metadata section.
-
-
-
Constructor Detail
-
MzTabAccess
public MzTabAccess(MzTab mzTab)
Create an MzTabAccess object for the provided mzTab object.- Parameters:
mzTab
-
-
-
Method Detail
-
getFeatures
public List<SmallMoleculeFeature> getFeatures(SmallMoleculeSummary sms)
Retrieve all small molecule features in order of definition for the provided small molecule summary.- Parameters:
sms
- the small molecule summary.- Returns:
- the list of small molecule features.
-
getEvidences
public List<SmallMoleculeEvidence> getEvidences(SmallMoleculeFeature smf)
Retrieve all small molecule evidences in order of definition for the provided small molecule feature.- Parameters:
smf
- the small molecule feature.- Returns:
- the list of small molecule evidences.
-
getEvidencesByEvidenceInputId
public List<SmallMoleculeEvidence> getEvidencesByEvidenceInputId(String evidenceInputId)
Retrieve all small molecule evidences for the provided evidence input id.- Parameters:
evidenceInputId
- the evidence input it.- Returns:
- the list of small molecule evidences.
-
getAbundanceFor
public Double getAbundanceFor(Assay assay, SmallMoleculeFeature smf)
Retrieves the abundance value for the provided assay and small molecule feature object.- Parameters:
assay
- the assay.smf
- the small molecule feature object.- Returns:
- the feature abundance. May be null.
-
getAbundanceFor
public Double getAbundanceFor(StudyVariable studyVariable, SmallMoleculeSummary sms)
Retrieves the abundance value for the provided study variable and small molecule summary object.- Parameters:
studyVariable
- the study variable.sms
- the small molecule summary object.- Returns:
- the study variable abundance. May be null.
-
getAbundanceVariationFor
public Double getAbundanceVariationFor(StudyVariable studyVariable, SmallMoleculeSummary sms)
Retrieves the abundance variation value for the provided study variable and small molecule summary object.- Parameters:
studyVariable
- the study variable.sms
- the small molecule summary object.- Returns:
- the study variable abundance variation. May be null.
-
getAbundanceFor
public Double getAbundanceFor(Assay assay, SmallMoleculeSummary sms)
Retrieves the abundance value for the provided assay and small molecule summary object.- Parameters:
assay
- the assay.sms
- the small molecule summary object.- Returns:
- the assay abundance. May be null.
-
getAssayFor
public Optional<Assay> getAssayFor(Integer id, Metadata metadata)
Tries to locate the assay referenced by id from the metadata section.- Parameters:
id
- the assay id.metadata
- the metadata used to locate the assay.- Returns:
- an optional with the assay object, or an empty optiona
-
getStudyVariableFor
public Optional<StudyVariable> getStudyVariableFor(Integer id, Metadata metadata)
Tries to locate the study variable referenced by id from the metadata section.- Parameters:
id
- the study variable id.metadata
- the metadata used to locate the study variable.- Returns:
- an optional with the study variable object, or an empty optiona
-
getMsRunFor
public Optional<MsRun> getMsRunFor(Integer id, Metadata metadata)
Tries to locate the ms run referenced by id from the metadata section.- Parameters:
id
- the ms run id.metadata
- the metadata used to locate the ms run.- Returns:
- an optional with the ms run object, or an empty optional.
-
getDatabaseFor
public Optional<Database> getDatabaseFor(Integer id, Metadata metadata)
Tries to locate the database referenced by id from the metadata section.- Parameters:
id
- the database id.metadata
- the metadata used to locate the database.- Returns:
- an optional with the database object, or an empty optional.
-
getAssayFor
public Optional<Assay> getAssayFor(OptColumnMapping columnMapping, Metadata metadata)
Tries to locate the assay referenced by id from the columnMapping identifier. Returns an empty optional if either the identifier was null or not an assay, or no matching assay was found.- Parameters:
columnMapping
- the column mapping.metadata
- the metadata used to locate the assay.- Returns:
- an optional with the assay object, or an empty optional.
-
-