Class MZTabDataLineParser<T>
- java.lang.Object
-
- uk.ac.ebi.pride.jmztab2.utils.parser.MZTabLineParser
-
- uk.ac.ebi.pride.jmztab2.utils.parser.MZTabDataLineParser<T>
-
- Type Parameters:
T- the type of domain object the parser creates.
- Direct Known Subclasses:
SMELineParser,SMFLineParser,SMLLineParser
public abstract class MZTabDataLineParser<T> extends MZTabLineParser
This class allows the validation and loading of the data into mzTab domain objects. NOTICE:MZTabColumnFactorymaintain a couple ofIMZTabColumnwhich have internal logical position and order. In physical mzTab file, we allow user not obey this logical position organized way, and provide their date with own order. In order to distinguish them, we use physical position (a positive integer) to record the column location in mzTab file. And usePositionMappingstructure to maintain the mapping between them.- Since:
- 14/02/13
- Author:
- qingwei
- See Also:
SMLLineParser,SMFLineParser,SMELineParser
-
-
Field Summary
Fields Modifier and Type Field Description protected SortedMap<String,Integer>exchangeMappingprotected MZTabColumnFactoryfactoryprotected SortedMap<Integer,IMZTabColumn>mappingprotected Metadatametadataprotected PositionMappingpositionMapping-
Fields inherited from class uk.ac.ebi.pride.jmztab2.utils.parser.MZTabLineParser
context, errorList, items, line, lineNumber, section
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMZTabDataLineParser(MZTabParserContext context)Constructor for MZTabDataLineParser.protectedMZTabDataLineParser(MZTabParserContext context, MZTabColumnFactory factory, PositionMapping positionMapping, Metadata metadata, MZTabErrorList errorList)Generate a mzTab data line parser.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected List<String>checkAmbiguityMembers(IMZTabColumn column, String ambiguityMembers)Check and translate target string into parameter list which split by ',' character..protected DoublecheckBestSearchEngineScore(IMZTabColumn column, String bestSearchEngineScore)The best search engine score (for this type of score) for the given peptide across all replicates reported.protected DoublecheckCalcMassToCharge(IMZTabColumn column, String calc_mass_to_charge)Check and translate calc_mass_to_charge string into Double.protected IntegercheckCharge(IMZTabColumn column, String charge)Check and translate charge string into Integer.protected StringcheckChemicalFormula(IMZTabColumn column, String chemical_formula)Check chemical_formula string.protected abstract intcheckData()Check and translate the columns into mzTab elements.protected StringcheckData(IMZTabColumn column, String target, boolean allowNull)In the table-based sections (protein, peptide, and small molecule) there MUST NOT be any empty cells.protected StringcheckDatabase(IMZTabColumn column, String database)Check target string.protected StringcheckDatabaseVersion(IMZTabColumn column, String databaseVersion)Check target string.protected StringcheckDescription(IMZTabColumn column, String description)Check target string.protected DoublecheckDouble(IMZTabColumn column, String target)Check and translate target string into Double.protected DoublecheckDouble(IMZTabColumn column, String target, boolean allowNull)Check and translate target string into Double.protected List<Double>checkDoubleList(IMZTabColumn column, String target)Check and translate target string into parameter list which split by splitChar character..protected StringcheckEnd(IMZTabColumn column, String end)Check target string.protected DoublecheckExpMassToCharge(IMZTabColumn column, String exp_mass_to_charge)Check and translate exp_mass_to_charge string into Double.protected List<String>checkGOTerms(IMZTabColumn column, String go_terms)Check and translate target string into string list which split by ',' character..protected List<String>checkIdentifier(IMZTabColumn column, String identifier)Check and translate identifier string into string list which split by '|' character..protected List<String>checkInchiKey(IMZTabColumn column, String inchi_key)Check and translate inchi_key string into parameter list which split by '|' character..protected IntegercheckInteger(IMZTabColumn column, String target)Check and translate target string into Integer.protected IntegercheckInteger(IMZTabColumn column, String target, boolean allowNull)Check and translate target string into Integer.protected List<Integer>checkIntegerList(IMZTabColumn column, String target, char splitChar)Check and translate target string into integer list which split by splitChar character..protected List<Integer>checkIntegerList(IMZTabColumn column, String target, char splitChar, boolean allowNull)Check and translate target string into integer list which split by splitChar character..protected DoublecheckMassToCharge(IMZTabColumn column, String mass_to_charge)Check and translate mass_to_charge string into Double.protected MZBooleancheckMZBoolean(IMZTabColumn column, String target)Check and translate target toMZBoolean.protected IntegercheckNumPeptidesDistinct(IMZTabColumn column, String numPeptidesDistinct)Check and translate numPeptidesDistinct string into Integer.protected IntegercheckNumPeptidesUnique(IMZTabColumn column, String numPeptidesUnique)Check and translate numPeptidesUnique string into Integer.protected IntegercheckNumPSMs(IMZTabColumn column, String numPSMs)Check and translate numPSMs string into Integer.protected ParametercheckParameter(IMZTabColumn column, String target, boolean allowNull)checkParameter.protected List<Parameter>checkParamList(IMZTabColumn column, String target)Check and translate target string into parameter list which split by '|' character..protected StringcheckPost(IMZTabColumn column, String post)Check target string.protected StringcheckPre(IMZTabColumn column, String pre)Check target string.protected DoublecheckProteinCoverage(IMZTabColumn column, String protein_coverage)Check and translate protein_coverage string into Double.protected IntegercheckPSMID(IMZTabColumn column, String psm_id)Check and translate psm_id string into Integer.protected List<Double>checkRetentionTime(IMZTabColumn column, String retention_time)Check and translate retention_time string into Double list which split by '|' character..protected List<Double>checkRetentionTimeWindow(IMZTabColumn column, String retention_time_window)Check and translate retention_time_window string into Double list which split by '|' character..protected List<Parameter>checkSearchEngine(IMZTabColumn column, String searchEngine)Check and translate searchEngine string into parameter list which split by '|' character..protected DoublecheckSearchEngineScore(IMZTabColumn column, String searchEngineScore)The search engine score for the given peptide in the defined ms run.protected StringcheckSequence(IMZTabColumn column, String sequence)Check and translate peptide sequence.protected List<String>checkSmiles(IMZTabColumn column, String smiles)Check and translate smiles string into parameter list which split by '|' character..protected StringcheckSpecies(IMZTabColumn column, String species)Check target string.protected List<SpectraRef>checkSpectraRef(MZTabParserContext context, IMZTabColumn column, String spectraRef, boolean allowNull)Check and translate spectraRef string intoSpectraReflist.protected StringcheckStart(IMZTabColumn column, String start)Check target string.protected StringcheckString(IMZTabColumn column, String target)In the table-based sections (protein, peptide, and small molecule) there MUST NOT be any empty cells.protected StringcheckString(IMZTabColumn column, String target, boolean allowNull)In the table-based sections (protein, peptide, and small molecule) there MUST NOT be any empty cells.protected List<String>checkStringList(IMZTabColumn column, String target, char splitChar)Check and translate target string into parameter list which split by splitChar character..protected IntegercheckTaxid(IMZTabColumn column, String taxid)Check and translate taxid string into Integer.protected MZBooleancheckUnique(IMZTabColumn column, String unique)Check and translate unique toMZBoolean.protected StringcheckURI(IMZTabColumn column, String uri)Checks the provided URI string.abstract TgetRecord()Retrieve the data line to a type mzTab domain object.protected IntegerloadBestSearchEngineScoreId(String bestSearchEngineScoreLabel)load best_search_engine_score[id], read id value.protected IntegerloadSearchEngineScoreId(String searchEngineLabel)load search_engine_score[id]_ms_run[..], read id value.voidparse(int lineNumber, String line, MZTabErrorList errorList)We assume that user before call this method, have parse the raw line is not empty line and start with section prefix.
-
-
-
Field Detail
-
factory
protected MZTabColumnFactory factory
-
positionMapping
protected PositionMapping positionMapping
-
exchangeMapping
protected SortedMap<String,Integer> exchangeMapping
-
mapping
protected SortedMap<Integer,IMZTabColumn> mapping
-
-
Constructor Detail
-
MZTabDataLineParser
protected MZTabDataLineParser(MZTabParserContext context)
Constructor for MZTabDataLineParser.
- Parameters:
context- aMZTabParserContextobject.
-
MZTabDataLineParser
protected MZTabDataLineParser(MZTabParserContext context, MZTabColumnFactory factory, PositionMapping positionMapping, Metadata metadata, MZTabErrorList errorList)
Generate a mzTab data line parser. NOTICE:MZTabColumnFactorymaintain a couple ofIMZTabColumnwhich have internal logical position and order. In physical mzTab file, we allow user not obey this logical position organized way, and provide their date with own order. In order to distinguish them, we use physical position (a positive integer) to record the column location in mzTab file. And usePositionMappingstructure the maintain the mapping between them.- Parameters:
context- the parser context, keeping dynamic state and lookup associations.factory- SHOULD NOT be set to nullpositionMapping- SHOULD NOT be set to nullmetadata- SHOULD NOT be set to nullerrorList- aMZTabErrorListobject.
-
-
Method Detail
-
parse
public void parse(int lineNumber, String line, 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. Validate and parse the data line, if there exist errors, add them intoMZTabErrorList.- Overrides:
parsein classMZTabLineParser- Parameters:
lineNumber- a int.line- aStringobject.errorList- aMZTabErrorListobject.- Throws:
MZTabException- if any.
-
getRecord
public abstract T getRecord()
Retrieve the data line to a type mzTab domain object.- Returns:
- a typed mzTab domain object.
-
checkData
protected abstract int checkData()
Check and translate the columns into mzTab elements.- Returns:
- a int.
-
loadBestSearchEngineScoreId
protected Integer loadBestSearchEngineScoreId(String bestSearchEngineScoreLabel)
load best_search_engine_score[id], read id value.
-
loadSearchEngineScoreId
protected Integer loadSearchEngineScoreId(String searchEngineLabel)
load search_engine_score[id]_ms_run[..], read id value.
-
checkData
protected String checkData(IMZTabColumn column, String target, boolean allowNull)
In the table-based sections (protein, peptide, and small molecule) there MUST NOT be any empty cells. Some field not allow "null" value, for example unit_id, accession and so on. In "Complete" file, in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nulltarget- SHOULD NOT be empty.allowNull- a boolean.- Returns:
- a
Stringobject.
-
checkString
protected String checkString(IMZTabColumn column, String target)
In the table-based sections (protein, peptide, and small molecule) there MUST NOT be any empty cells. Some field not allow "null" value, for example unit_id, accession and so on. In "Complete" file, in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nulltarget- SHOULD NOT be empty.- Returns:
- a
Stringobject.
-
checkString
protected String checkString(IMZTabColumn column, String target, boolean allowNull)
In the table-based sections (protein, peptide, and small molecule) there MUST NOT be any empty cells. Some field not allow "null" value, for example unit_id, accession and so on. In "Complete" file, in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nulltarget- SHOULD NOT be empty.allowNull- if true, null target values will pass the check, if false, the check will raise an error in the error list.- Returns:
- a
Stringobject.
-
checkInteger
protected Integer checkInteger(IMZTabColumn column, String target)
Check and translate target string into Integer. If parse is incorrect, throwsFormatErrorType.Integererror.- Parameters:
column- SHOULD NOT be set to nulltarget- SHOULD NOT be empty.- Returns:
- a
Integerobject.
-
checkInteger
protected Integer checkInteger(IMZTabColumn column, String target, boolean allowNull)
Check and translate target string into Integer. If parse is incorrect, throwsFormatErrorType.Integererror.- Parameters:
column- SHOULD NOT be set to nulltarget- SHOULD NOT be empty.allowNull- if true, null target values will pass the check, if false, the check will raise an error in the error list.- Returns:
- a
Integerobject.
-
checkDouble
protected Double checkDouble(IMZTabColumn column, String target)
Check and translate target string into Double. If parse is incorrect, throwsFormatErrorType.Doubleerror. NOTICE: If ratios are included and the denominator is zero, the "INF" value MUST be used. If the result leads to calculation errors (for example 0/0), this MUST be reported as "not a number" ("NaN").- Parameters:
column- SHOULD NOT be set to nulltarget- SHOULD NOT be empty.- Returns:
- a
Doubleobject.
-
checkDouble
protected Double checkDouble(IMZTabColumn column, String target, boolean allowNull)
Check and translate target string into Double. If parse is incorrect, throwsFormatErrorType.Doubleerror. NOTICE: If ratios are included and the denominator is zero, the "INF" value MUST be used. If the result leads to calculation errors (for example 0/0), this MUST be reported as "not a number" ("NaN").- Parameters:
column- SHOULD NOT be set to nulltarget- SHOULD NOT be empty.allowNull- if true, null target values will pass the check, if false, the check will raise an error in the error list.- Returns:
- a
Doubleobject.
-
checkParamList
protected List<Parameter> checkParamList(IMZTabColumn column, String target)
Check and translate target string into parameter list which split by '|' character.. If parse is incorrect, throwsFormatErrorType.ParamListerror.- Parameters:
column- SHOULD NOT be set to nulltarget- SHOULD NOT be empty.- Returns:
- a
Listobject.
-
checkParameter
protected Parameter checkParameter(IMZTabColumn column, String target, boolean allowNull)
checkParameter.
- Parameters:
column- aIMZTabColumnobject.target- aStringobject.allowNull- a boolean.- Returns:
- a
Parameterobject.
-
checkStringList
protected List<String> checkStringList(IMZTabColumn column, String target, char splitChar)
Check and translate target string into parameter list which split by splitChar character.. If parse is incorrect, throwsFormatErrorType.StringListerror.- Parameters:
column- SHOULD NOT be set to nulltarget- SHOULD NOT be empty.splitChar- a char.- Returns:
- a
Listobject.
-
checkIntegerList
protected List<Integer> checkIntegerList(IMZTabColumn column, String target, char splitChar)
Check and translate target string into integer list which split by splitChar character.. If parse is incorrect, throwsFormatErrorType.StringListerror.- Parameters:
column- SHOULD NOT be set to nulltarget- SHOULD NOT be empty.splitChar- a char.- Returns:
- a
Listobject.
-
checkIntegerList
protected List<Integer> checkIntegerList(IMZTabColumn column, String target, char splitChar, boolean allowNull)
Check and translate target string into integer list which split by splitChar character.. If parse is incorrect, throwsFormatErrorType.StringListerror.- Parameters:
column- SHOULD NOT be set to nulltarget- SHOULD NOT be empty.splitChar- a char.allowNull- if true, null will be treated as a valid element of the list. Otherwise, an error will be added to the error list.- Returns:
- a
Listobject.
-
checkDoubleList
protected List<Double> checkDoubleList(IMZTabColumn column, String target)
Check and translate target string into parameter list which split by splitChar character.. If parse is incorrect, throwsFormatErrorType.StringListerror.- Parameters:
column- SHOULD NOT be set to nulltarget- SHOULD NOT be empty.- Returns:
- a
Listobject.
-
checkMZBoolean
protected MZBoolean checkMZBoolean(IMZTabColumn column, String target)
Check and translate target toMZBoolean. Only "0" and "1" allow used in express Boolean (0/1). If parse is incorrect, throwsFormatErrorType.MZBooleanerror.- Parameters:
column- SHOULD NOT be set to nulltarget- SHOULD NOT be empty.- Returns:
- a
MZBooleanobject.
-
checkDescription
protected String checkDescription(IMZTabColumn column, String description)
Check target string. Normally, description can set "null". But in "Complete" file, in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nulldescription- SHOULD NOT be empty.- Returns:
- a
Stringobject. - See Also:
checkData(IMZTabColumn, String, boolean)
-
checkTaxid
protected Integer checkTaxid(IMZTabColumn column, String taxid)
Check and translate taxid string into Integer. If exists error during parse, raiseFormatErrorType.Integererror. Normally, taxid may be set to "null"; in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nulltaxid- SHOULD NOT be empty.- Returns:
- a
Integerobject.
-
checkSpecies
protected String checkSpecies(IMZTabColumn column, String species)
Check target string. Normally, species can set "null". But in "Complete" file, in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nullspecies- SHOULD NOT be empty.- Returns:
- a
Stringobject. - See Also:
checkData(IMZTabColumn, String, boolean)
-
checkDatabase
protected String checkDatabase(IMZTabColumn column, String database)
Check target string. Normally, database can set "null". But in "Complete" file, in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nulldatabase- SHOULD NOT be empty.- Returns:
- a
Stringobject. - See Also:
checkData(IMZTabColumn, String, boolean)
-
checkDatabaseVersion
protected String checkDatabaseVersion(IMZTabColumn column, String databaseVersion)
Check target string. Normally, databaseVersion can set "null". But in "Complete" file, in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nulldatabaseVersion- SHOULD NOT be empty.- Returns:
- a
Stringobject. - See Also:
checkData(IMZTabColumn, String, boolean)
-
checkSearchEngine
protected List<Parameter> checkSearchEngine(IMZTabColumn column, String searchEngine)
Check and translate searchEngine string into parameter list which split by '|' character.. If parse is incorrect, throwsFormatErrorType.ParamListerror. Normally, searchEngine may be set to "null"; in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nullsearchEngine- SHOULD NOT be empty.- Returns:
- a
Listobject.
-
checkBestSearchEngineScore
protected Double checkBestSearchEngineScore(IMZTabColumn column, String bestSearchEngineScore)
The best search engine score (for this type of score) for the given peptide across all replicates reported. The type of score MUST be defined in the metadata section. If the peptide was not identified by the specified search engine, “null” MUST be reported.- Parameters:
column- SHOULD NOT be set to nullbestSearchEngineScore- SHOULD NOT be empty.- Returns:
- a
Doubleobject.
-
checkSearchEngineScore
protected Double checkSearchEngineScore(IMZTabColumn column, String searchEngineScore)
The search engine score for the given peptide in the defined ms run. The type of score MUST be defined in the metadata section. If the peptide was not identified by the specified search engine “null” must be reported.- Parameters:
column- SHOULD NOT be set to nullsearchEngineScore- SHOULD NOT be empty.- Returns:
- a
Doubleobject.
-
checkNumPSMs
protected Integer checkNumPSMs(IMZTabColumn column, String numPSMs)
Check and translate numPSMs string into Integer. If exists error during parse, raiseFormatErrorType.Integererror. Normally, numPSMs may be set to "null"; in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nullnumPSMs- SHOULD NOT be empty.- Returns:
- a
Integerobject.
-
checkNumPeptidesDistinct
protected Integer checkNumPeptidesDistinct(IMZTabColumn column, String numPeptidesDistinct)
Check and translate numPeptidesDistinct string into Integer. If exists error during parse, raiseFormatErrorType.Integererror. Normally, numPeptidesDistinct can set "null", but in "Complete" file, in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nullnumPeptidesDistinct- SHOULD NOT be empty.- Returns:
- a
Integerobject.
-
checkNumPeptidesUnique
protected Integer checkNumPeptidesUnique(IMZTabColumn column, String numPeptidesUnique)
Check and translate numPeptidesUnique string into Integer. If exists error during parse, raiseFormatErrorType.Integererror. Normally, numPeptidesUnique can set "null", but in "Complete" file, in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nullnumPeptidesUnique- SHOULD NOT be empty.- Returns:
- a
Integerobject.
-
checkAmbiguityMembers
protected List<String> checkAmbiguityMembers(IMZTabColumn column, String ambiguityMembers)
Check and translate target string into parameter list which split by ',' character.. If parse is incorrect, throwsFormatErrorType.StringListerror. Normally, ambiguityMembers may be set to "null"; in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nullambiguityMembers- SHOULD NOT be empty.- Returns:
- a
Listobject.
-
checkURI
protected String checkURI(IMZTabColumn column, String uri)
Checks the provided URI string.- Parameters:
column- SHOULD NOT be set to nulluri- aStringobject, conforming to URI format.- Returns:
- the uri as an ASCII encoded string.
-
checkSpectraRef
protected List<SpectraRef> checkSpectraRef(MZTabParserContext context, IMZTabColumn column, String spectraRef, boolean allowNull)
Check and translate spectraRef string intoSpectraReflist. If parse incorrect, or ms_run not defined in metadata raiseFormatErrorType.SpectraReferror. Normally, spectraRef may be set to "null"; in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nullspectraRef- SHOULD NOT be empty.context- aMZTabParserContextobject.allowNull- if true, allow null for value. Otherwise, an error will be added to the error list.- Returns:
- a
Listobject.
-
checkPre
protected String checkPre(IMZTabColumn column, String pre)
Check target string. Normally, pre can set "null". "null" values should only be given, if no value is available and where the specification allows for "null" explicitly."- Parameters:
column- SHOULD NOT be set to nullpre- SHOULD NOT be empty.- Returns:
- a
Stringobject. - See Also:
checkData(IMZTabColumn, String, boolean)
-
checkPost
protected String checkPost(IMZTabColumn column, String post)
Check target string. Normally, post can set "null". But in "Complete" file, in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nullpost- SHOULD NOT be empty.- Returns:
- a
Stringobject. - See Also:
checkData(IMZTabColumn, String, boolean)
-
checkStart
protected String checkStart(IMZTabColumn column, String start)
Check target string. Normally, start can set "null". But in "Complete" file, in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nullstart- SHOULD NOT be empty.- Returns:
- a
Stringobject. - See Also:
checkData(IMZTabColumn, String, boolean)
-
checkEnd
protected String checkEnd(IMZTabColumn column, String end)
Check target string. Normally, end can set "null". But in "Complete" file, in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nullend- SHOULD NOT be empty.- Returns:
- a
Stringobject. - See Also:
checkData(IMZTabColumn, String, boolean)
-
checkGOTerms
protected List<String> checkGOTerms(IMZTabColumn column, String go_terms)
Check and translate target string into string list which split by ',' character.. If parse is incorrect, throwsFormatErrorType.StringListerror. Besides, each item in list should be start with "GO:", otherwise system raiseFormatErrorType.GOTermListerror. Normally, go_terms may be set to "null"; in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nullgo_terms- SHOULD NOT be empty.- Returns:
- a
Listobject.
-
checkProteinCoverage
protected Double checkProteinCoverage(IMZTabColumn column, String protein_coverage)
Check and translate protein_coverage string into Double. If parse is incorrect, throwsFormatErrorType.Doubleerror. protein_coverage range should be in the [0, 1), otherwise raiseLogicalErrorType.ProteinCoverageerror. NOTICE: If ratios are included and the denominator is zero, the "INF" value MUST be used. If the result leads to calculation errors (for example 0/0), this MUST be reported as "not a number" ("NaN").- Parameters:
column- SHOULD NOT be set to nullprotein_coverage- SHOULD NOT be empty.- Returns:
- a
Doubleobject.
-
checkSequence
protected String checkSequence(IMZTabColumn column, String sequence)
Check and translate peptide sequence. 'O' and 'U' are encoded by codons that are usually interpreted as stop codons, which can not displayed in the sequence. So, if find it, system raiseFormatErrorType.Sequenceerror.- Parameters:
column- SHOULD NOT be set to nullsequence- SHOULD NOT be empty.- Returns:
- a
Stringobject.
-
checkPSMID
protected Integer checkPSMID(IMZTabColumn column, String psm_id)
Check and translate psm_id string into Integer. If exists error during parse, raiseFormatErrorType.Integererror. Normally, psm_id may be set to "null"; in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nullpsm_id- SHOULD NOT be empty.- Returns:
- a
Integerobject.
-
checkUnique
protected MZBoolean checkUnique(IMZTabColumn column, String unique)
Check and translate unique toMZBoolean. Only "0" and "1" allow used in express Boolean (0/1). If parse is incorrect, throwsFormatErrorType.MZBooleanerror.- Parameters:
column- SHOULD NOT be set to nullunique- SHOULD NOT be empty.- Returns:
- a
MZBooleanobject.
-
checkCharge
protected Integer checkCharge(IMZTabColumn column, String charge)
Check and translate charge string into Integer. If exists error during parse, raiseFormatErrorType.Integererror. Normally, charge may be set to "null"; in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nullcharge- SHOULD NOT be empty.- Returns:
- a
Integerobject.
-
checkMassToCharge
protected Double checkMassToCharge(IMZTabColumn column, String mass_to_charge)
Check and translate mass_to_charge string into Double. If parse is incorrect, throwsFormatErrorType.Doubleerror. NOTICE: If ratios are included and the denominator is zero, the "INF" value MUST be used. If the result leads to calculation errors (for example 0/0), this MUST be reported as "not a number" ("NaN").- Parameters:
column- SHOULD NOT be set to nullmass_to_charge- SHOULD NOT be empty.- Returns:
- a
Doubleobject.
-
checkExpMassToCharge
protected Double checkExpMassToCharge(IMZTabColumn column, String exp_mass_to_charge)
Check and translate exp_mass_to_charge string into Double. If parse is incorrect, throwsFormatErrorType.Doubleerror. NOTICE: If ratios are included and the denominator is zero, the "INF" value MUST be used. If the result leads to calculation errors (for example 0/0), this MUST be reported as "not a number" ("NaN").- Parameters:
column- SHOULD NOT be set to nullexp_mass_to_charge- SHOULD NOT be empty.- Returns:
- a
Doubleobject.
-
checkCalcMassToCharge
protected Double checkCalcMassToCharge(IMZTabColumn column, String calc_mass_to_charge)
Check and translate calc_mass_to_charge string into Double. If parse is incorrect, throwsFormatErrorType.Doubleerror. NOTICE: If ratios are included and the denominator is zero, the "INF" value MUST be used. If the result leads to calculation errors (for example 0/0), this MUST be reported as "not a number" ("NaN").- Parameters:
column- SHOULD NOT be set to nullcalc_mass_to_charge- SHOULD NOT be empty.- Returns:
- a
Doubleobject.
-
checkIdentifier
protected List<String> checkIdentifier(IMZTabColumn column, String identifier)
Check and translate identifier string into string list which split by '|' character.. If parse is incorrect, throwsFormatErrorType.StringListerror. Normally, identifier may be set to "null"; in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nullidentifier- SHOULD NOT be empty.- Returns:
- a
Listobject.
-
checkChemicalFormula
protected String checkChemicalFormula(IMZTabColumn column, String chemical_formula)
Check chemical_formula string. Normally, chemical_formula can set "null". But in "Complete" file, in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nullchemical_formula- SHOULD NOT be empty.- Returns:
- a
Stringobject. - See Also:
checkData(IMZTabColumn, String, boolean)
-
checkSmiles
protected List<String> checkSmiles(IMZTabColumn column, String smiles)
Check and translate smiles string into parameter list which split by '|' character.. If parse is incorrect, throwsFormatErrorType.StringListerror. Normally, smiles may be set to "null"; in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nullsmiles- SHOULD NOT be empty.- Returns:
- a
Listobject.
-
checkInchiKey
protected List<String> checkInchiKey(IMZTabColumn column, String inchi_key)
Check and translate inchi_key string into parameter list which split by '|' character.. If parse is incorrect, throwsFormatErrorType.StringListerror. Normally, inchi_key may be set to "null"; in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nullinchi_key- SHOULD NOT be empty.- Returns:
- a
Listobject.
-
checkRetentionTime
protected List<Double> checkRetentionTime(IMZTabColumn column, String retention_time)
Check and translate retention_time string into Double list which split by '|' character.. If parse is incorrect, throwsFormatErrorType.DoubleListerror. Normally, retention_time may be set to "null"; in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nullretention_time- SHOULD NOT be empty.- Returns:
- a
Listobject.
-
checkRetentionTimeWindow
protected List<Double> checkRetentionTimeWindow(IMZTabColumn column, String retention_time_window)
Check and translate retention_time_window string into Double list which split by '|' character.. If parse is incorrect, throwsFormatErrorType.DoubleListerror. Normally, retention_time_window can set "null", but in "Complete" file, in general "null" values SHOULD not be given.- Parameters:
column- SHOULD NOT be set to nullretention_time_window- SHOULD NOT be empty.- Returns:
- a
Listobject.
-
-