コード例 #1
0
  public Param getColunitProtein(ProteinTableField column) throws MzTabParsingException {
    if (column == ProteinTableField.PROTEIN_ABUNDANCE
        || column == ProteinTableField.PROTEIN_ABUNDANCE_STD
        || column == ProteinTableField.PROTEIN_ABUNDANCE_STD_ERROR) {
      throw new MzTabParsingException(
          "The colunit field cannot be used to store units for abundance columns. Please use getProteinQuantificationUnit");
    }

    if (column == ProteinTableField.CUSTOM) {
      throw new MzTabParsingException(
          "This function cannot be used to retrieve units for optional columns");
    }
    return getColunitProtein(column.toString());
  }
コード例 #2
0
  /**
   * Sets the unit for the specified column.
   *
   * @param column
   * @param unit
   * @throws MzTabParsingException Thrown if the unit is set for a column that is not supported.
   */
  public void setColunitProtein(ProteinTableField column, Param unit) throws MzTabParsingException {
    if (column == ProteinTableField.PROTEIN_ABUNDANCE
        || column == ProteinTableField.PROTEIN_ABUNDANCE_STD
        || column == ProteinTableField.PROTEIN_ABUNDANCE_STD_ERROR) {
      throw new MzTabParsingException("Colunits must not be set for abundance columns.");
    }

    if (column == ProteinTableField.CUSTOM) {
      throw new MzTabParsingException("This function cannot be used to set custom column units");
    }

    if (column == ProteinTableField.HEADER_PREFIX || column == ProteinTableField.ROW_PREFIX) {
      throw new MzTabParsingException("ROW_PREFIX and HEADER_PREFIX are not valid columns.");
    }

    setColunitProtein(column.toString(), unit);
  }