Class MZTabHeaderLineParser

    • Method Detail

      • parse

        public void parse​(int lineNumber,
                          String line,
                          uk.ac.ebi.pride.jmztab2.utils.errors.MZTabErrorList errorList)
                   throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
        We assume that user before call this method, have parse the raw line is not empty line and start with section prefix. Parse a header line into MZTabColumnFactory structure. There are several steps in this method: Step 1: parseColumns() focus on validate and parse all columns. Step 2: refine()
        Overrides:
        parse in class MZTabLineParser
        Parameters:
        lineNumber - a int.
        line - a String object.
        errorList - a MZTabErrorList object.
        Throws:
        uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException - if any.
      • parseColumns

        protected abstract int parseColumns()
                                     throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
        This methods delegates to the subclasses the parsing of the columns. All of the columns are defined in SmallMoleculeColumn, SmallMoleculeFeatureColumn, or SmallMoleculeEvidenceColumn.
        Returns:
        the next physical index of column available after the parsing.
        Throws:
        uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException - if any structural or logical errors are encountered that prohibit further processing.
      • refine

        protected abstract void refine()
                                throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
        Some validate operation need to be done after the whole MZTabColumnFactory created. Thus, user can add them, and called at the end of the parse(int, String, MZTabErrorList) method.
        Throws:
        uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException - if any structural or logical errors are encountered that prohibit further processing.
      • refineOptionalColumn

        protected void refineOptionalColumn​(Section section,
                                            String columnHeader)
                                     throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
        Refine optional columns and check, whether they were properly defined. These re-validate operation will called in refine() method.
        Parameters:
        section - a Section object defining the part of the document.
        columnHeader - a String object.
        Throws:
        uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException - if any structural or logical errors are encountered that prohibit further processing.
      • checkOptColumnName

        protected boolean checkOptColumnName​(String nameLabel)
                                      throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
        Additional columns can be added to the end of the protein table. These column headers MUST start with the prefix "opt_". Column names MUST only contain the following characters: 'A'-'Z', 'a'-'z', '0'-'9', '_', '-', '[', ']', and ':'. the format: opt_{IndexedElement[id]}_{value}. Spaces within the parameter's name MUST be replaced by '_'.
        Parameters:
        nameLabel - a String object.
        Returns:
        a boolean.
        Throws:
        uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException - if any structural or logical errors are encountered that prohibit further processing.
      • checkAbundanceColumns

        protected int checkAbundanceColumns​(int offset,
                                            String order)
                                     throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException

        checkAbundanceColumns.

        Parameters:
        offset - a int.
        order - a String object.
        Returns:
        a int.
        Throws:
        uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException - if any structural or logical errors are encountered that prohibit further processing.
      • parseIndex

        protected int parseIndex​(String header,
                                 String id)
                          throws uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException
        Parse header to a index id number. If exists parse error, stop validate and throw MZTabException directly.
        Parameters:
        header - a String object.
        id - a String object.
        Returns:
        a int.
        Throws:
        uk.ac.ebi.pride.jmztab2.utils.errors.MZTabException - if any structural or logical errors are encountered that prohibit further processing.