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:MZTabColumnFactory
maintain a couple ofIMZTabColumn
which 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 usePositionMapping
structure 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>
exchangeMapping
protected MZTabColumnFactory
factory
protected SortedMap<Integer,IMZTabColumn>
mapping
protected Metadata
metadata
protected PositionMapping
positionMapping
-
Fields inherited from class uk.ac.ebi.pride.jmztab2.utils.parser.MZTabLineParser
context, errorList, items, line, lineNumber, section
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
MZTabDataLineParser(MZTabParserContext context)
Constructor for MZTabDataLineParser.protected
MZTabDataLineParser(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 Double
checkBestSearchEngineScore(IMZTabColumn column, String bestSearchEngineScore)
The best search engine score (for this type of score) for the given peptide across all replicates reported.protected Double
checkCalcMassToCharge(IMZTabColumn column, String calc_mass_to_charge)
Check and translate calc_mass_to_charge string into Double.protected Integer
checkCharge(IMZTabColumn column, String charge)
Check and translate charge string into Integer.protected String
checkChemicalFormula(IMZTabColumn column, String chemical_formula)
Check chemical_formula string.protected abstract int
checkData()
Check and translate the columns into mzTab elements.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.protected String
checkDatabase(IMZTabColumn column, String database)
Check target string.protected String
checkDatabaseVersion(IMZTabColumn column, String databaseVersion)
Check target string.protected String
checkDescription(IMZTabColumn column, String description)
Check target string.protected Double
checkDouble(IMZTabColumn column, String target)
Check and translate target string into Double.protected Double
checkDouble(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 String
checkEnd(IMZTabColumn column, String end)
Check target string.protected Double
checkExpMassToCharge(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 Integer
checkInteger(IMZTabColumn column, String target)
Check and translate target string into Integer.protected Integer
checkInteger(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 Double
checkMassToCharge(IMZTabColumn column, String mass_to_charge)
Check and translate mass_to_charge string into Double.protected MZBoolean
checkMZBoolean(IMZTabColumn column, String target)
Check and translate target toMZBoolean
.protected Integer
checkNumPeptidesDistinct(IMZTabColumn column, String numPeptidesDistinct)
Check and translate numPeptidesDistinct string into Integer.protected Integer
checkNumPeptidesUnique(IMZTabColumn column, String numPeptidesUnique)
Check and translate numPeptidesUnique string into Integer.protected Integer
checkNumPSMs(IMZTabColumn column, String numPSMs)
Check and translate numPSMs string into Integer.protected Parameter
checkParameter(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 String
checkPost(IMZTabColumn column, String post)
Check target string.protected String
checkPre(IMZTabColumn column, String pre)
Check target string.protected Double
checkProteinCoverage(IMZTabColumn column, String protein_coverage)
Check and translate protein_coverage string into Double.protected Integer
checkPSMID(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 Double
checkSearchEngineScore(IMZTabColumn column, String searchEngineScore)
The search engine score for the given peptide in the defined ms run.protected String
checkSequence(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 String
checkSpecies(IMZTabColumn column, String species)
Check target string.protected List<SpectraRef>
checkSpectraRef(MZTabParserContext context, IMZTabColumn column, String spectraRef, boolean allowNull)
Check and translate spectraRef string intoSpectraRef
list.protected String
checkStart(IMZTabColumn column, String start)
Check target string.protected String
checkString(IMZTabColumn column, String target)
In the table-based sections (protein, peptide, and small molecule) there MUST NOT be any empty cells.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.protected List<String>
checkStringList(IMZTabColumn column, String target, char splitChar)
Check and translate target string into parameter list which split by splitChar character..protected Integer
checkTaxid(IMZTabColumn column, String taxid)
Check and translate taxid string into Integer.protected MZBoolean
checkUnique(IMZTabColumn column, String unique)
Check and translate unique toMZBoolean
.protected String
checkURI(IMZTabColumn column, String uri)
Checks the provided URI string.abstract T
getRecord()
Retrieve the data line to a type mzTab domain object.protected Integer
loadBestSearchEngineScoreId(String bestSearchEngineScoreLabel)
load best_search_engine_score[id], read id value.protected Integer
loadSearchEngineScoreId(String searchEngineLabel)
load search_engine_score[id]_ms_run[..], read id value.void
parse(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
- aMZTabParserContext
object.
-
MZTabDataLineParser
protected MZTabDataLineParser(MZTabParserContext context, MZTabColumnFactory factory, PositionMapping positionMapping, Metadata metadata, MZTabErrorList errorList)
Generate a mzTab data line parser. NOTICE:MZTabColumnFactory
maintain a couple ofIMZTabColumn
which 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 usePositionMapping
structure 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
- aMZTabErrorList
object.
-
-
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:
parse
in classMZTabLineParser
- Parameters:
lineNumber
- a int.line
- aString
object.errorList
- aMZTabErrorList
object.- 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
String
object.
-
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
String
object.
-
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
String
object.
-
checkInteger
protected Integer checkInteger(IMZTabColumn column, String target)
Check and translate target string into Integer. If parse is incorrect, throwsFormatErrorType.Integer
error.- Parameters:
column
- SHOULD NOT be set to nulltarget
- SHOULD NOT be empty.- Returns:
- a
Integer
object.
-
checkInteger
protected Integer checkInteger(IMZTabColumn column, String target, boolean allowNull)
Check and translate target string into Integer. If parse is incorrect, throwsFormatErrorType.Integer
error.- 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
Integer
object.
-
checkDouble
protected Double checkDouble(IMZTabColumn column, String target)
Check and translate target string into Double. If parse is incorrect, throwsFormatErrorType.Double
error. 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
Double
object.
-
checkDouble
protected Double checkDouble(IMZTabColumn column, String target, boolean allowNull)
Check and translate target string into Double. If parse is incorrect, throwsFormatErrorType.Double
error. 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
Double
object.
-
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.ParamList
error.- Parameters:
column
- SHOULD NOT be set to nulltarget
- SHOULD NOT be empty.- Returns:
- a
List
object.
-
checkParameter
protected Parameter checkParameter(IMZTabColumn column, String target, boolean allowNull)
checkParameter.
- Parameters:
column
- aIMZTabColumn
object.target
- aString
object.allowNull
- a boolean.- Returns:
- a
Parameter
object.
-
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.StringList
error.- Parameters:
column
- SHOULD NOT be set to nulltarget
- SHOULD NOT be empty.splitChar
- a char.- Returns:
- a
List
object.
-
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.StringList
error.- Parameters:
column
- SHOULD NOT be set to nulltarget
- SHOULD NOT be empty.splitChar
- a char.- Returns:
- a
List
object.
-
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.StringList
error.- 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
List
object.
-
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.StringList
error.- Parameters:
column
- SHOULD NOT be set to nulltarget
- SHOULD NOT be empty.- Returns:
- a
List
object.
-
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.MZBoolean
error.- Parameters:
column
- SHOULD NOT be set to nulltarget
- SHOULD NOT be empty.- Returns:
- a
MZBoolean
object.
-
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
String
object. - 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.Integer
error. 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
Integer
object.
-
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
String
object. - 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
String
object. - 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
String
object. - 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.ParamList
error. 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
List
object.
-
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
Double
object.
-
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
Double
object.
-
checkNumPSMs
protected Integer checkNumPSMs(IMZTabColumn column, String numPSMs)
Check and translate numPSMs string into Integer. If exists error during parse, raiseFormatErrorType.Integer
error. 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
Integer
object.
-
checkNumPeptidesDistinct
protected Integer checkNumPeptidesDistinct(IMZTabColumn column, String numPeptidesDistinct)
Check and translate numPeptidesDistinct string into Integer. If exists error during parse, raiseFormatErrorType.Integer
error. 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
Integer
object.
-
checkNumPeptidesUnique
protected Integer checkNumPeptidesUnique(IMZTabColumn column, String numPeptidesUnique)
Check and translate numPeptidesUnique string into Integer. If exists error during parse, raiseFormatErrorType.Integer
error. 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
Integer
object.
-
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.StringList
error. 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
List
object.
-
checkURI
protected String checkURI(IMZTabColumn column, String uri)
Checks the provided URI string.- Parameters:
column
- SHOULD NOT be set to nulluri
- aString
object, 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 intoSpectraRef
list. If parse incorrect, or ms_run not defined in metadata raiseFormatErrorType.SpectraRef
error. 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
- aMZTabParserContext
object.allowNull
- if true, allow null for value. Otherwise, an error will be added to the error list.- Returns:
- a
List
object.
-
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
String
object. - 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
String
object. - 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
String
object. - 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
String
object. - 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.StringList
error. Besides, each item in list should be start with "GO:", otherwise system raiseFormatErrorType.GOTermList
error. 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
List
object.
-
checkProteinCoverage
protected Double checkProteinCoverage(IMZTabColumn column, String protein_coverage)
Check and translate protein_coverage string into Double. If parse is incorrect, throwsFormatErrorType.Double
error. protein_coverage range should be in the [0, 1), otherwise raiseLogicalErrorType.ProteinCoverage
error. 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
Double
object.
-
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.Sequence
error.- Parameters:
column
- SHOULD NOT be set to nullsequence
- SHOULD NOT be empty.- Returns:
- a
String
object.
-
checkPSMID
protected Integer checkPSMID(IMZTabColumn column, String psm_id)
Check and translate psm_id string into Integer. If exists error during parse, raiseFormatErrorType.Integer
error. 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
Integer
object.
-
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.MZBoolean
error.- Parameters:
column
- SHOULD NOT be set to nullunique
- SHOULD NOT be empty.- Returns:
- a
MZBoolean
object.
-
checkCharge
protected Integer checkCharge(IMZTabColumn column, String charge)
Check and translate charge string into Integer. If exists error during parse, raiseFormatErrorType.Integer
error. 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
Integer
object.
-
checkMassToCharge
protected Double checkMassToCharge(IMZTabColumn column, String mass_to_charge)
Check and translate mass_to_charge string into Double. If parse is incorrect, throwsFormatErrorType.Double
error. 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
Double
object.
-
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.Double
error. 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
Double
object.
-
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.Double
error. 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
Double
object.
-
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.StringList
error. 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
List
object.
-
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
String
object. - 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.StringList
error. 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
List
object.
-
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.StringList
error. 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
List
object.
-
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.DoubleList
error. 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
List
object.
-
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.DoubleList
error. 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
List
object.
-
-