@Override
  public void configure(final Set<Parameter> conf) throws EoulsanException {

    // The merge does not need any parameter
    for (Parameter p : conf) {
      throw new EoulsanException(
          "Unknown parameter for " + getFormat().getName() + " merger: " + p.getName());
    }
  }
  /**
   * Set the constants values
   *
   * @param parameters a set with the parameters
   * @throws EoulsanException if an error occurs while evaluating the parameters
   */
  private void addConstants(final Set<Parameter> parameters) throws EoulsanException {

    if (parameters == null) {
      return;
    }

    for (Parameter p : parameters) {
      if (!"".equals(p.getName())) {
        addConstant(p.getName(), p.getValue(), true);
      }
    }
  }
  /**
   * Set the "gtf.feature.exon" and "gtf.tag.exon.parent.transcript" parameter from the expression
   * step parameters.
   *
   * @param context the context of the task
   * @throws EoulsanException if more than one expression step exists
   */
  private void searchExpressionStepParameters(final TaskContext context) throws EoulsanException {

    int count = 0;

    for (Step step : context.getWorkflow().getSteps()) {

      if (AbstractExpressionModule.MODULE_NAME.equals(step.getModuleName())) {

        for (Parameter p : step.getParameters()) {

          switch (p.getName()) {
            case AbstractExpressionModule.OLD_GENOMIC_TYPE_PARAMETER_NAME:
            case AbstractExpressionModule.GENOMIC_TYPE_PARAMETER_NAME:
              gtfFeatureExon = p.getStringValue();
              break;

            case AbstractExpressionModule.OLD_ATTRIBUTE_ID_PARAMETER_NAME:
            case AbstractExpressionModule.ATTRIBUTE_ID_PARAMETER_NAME:
              gtfTagExonParentTranscript = p.getStringValue();
              break;

            default:
              break;
          }
        }
        count++;
      }
    }

    if (count == 0) {
      throw new EoulsanException("No expression step found in the workflow");
    }

    if (count > 1) {
      throw new EoulsanException("Found more than one expression step in the workflow");
    }
  }
  @Override
  public void configure(final StepConfigurationContext context, final Set<Parameter> stepParameters)
      throws EoulsanException {

    if (stepParameters == null) {
      throw new EoulsanException("No parameters set in " + getName() + " generator");
    }

    for (Parameter p : stepParameters) {

      switch (p.getName()) {
        case "overhang":
          this.overhang = p.getIntValueGreaterOrEqualsTo(1);
          break;

        case "gtf.file":
          Modules.renamedParameter(context, p, "use.gtf.file");
        case "use.gtf.file":
          this.gtfFile = p.getBooleanValue();
          break;

        case "file.chr.start.end":
          this.chrStartEndFilename = p.getStringValue();
          break;

        case "gtf.feature.exon":
          this.gtfFeatureExon = p.getStringValue();
          break;

        case "gtf.tag.exon.parent.transcript":
          this.gtfTagExonParentTranscript = p.getStringValue();
          break;

        case "genome.sa.index.nbases":
          this.genomeSAindexNbases = p.getIntValueGreaterOrEqualsTo(0);
          break;

        case "genome.chr.bin.nbits":
          this.genomeChrBinNbits = p.getIntValueGreaterOrEqualsTo(0);
          break;

        case "use.expression.step.parameters":
          this.useExpressionStepParameters = p.getBooleanValue();
          break;

        case "local.threads":
          this.localThreads = p.getIntValueGreaterOrEqualsTo(1);
          break;

        case "max.local.threads":
          this.maxLocalThreads = p.getIntValueGreaterOrEqualsTo(1);
          break;

        case "features.file.format":
          switch (p.getLowerStringValue()) {
            case "gtf":
              this.gtfFormat = true;
              break;

            case "gff":
            case "gff3":
              this.gtfFormat = false;
              break;

            default:
              Modules.badParameterValue(context, p, "Unknown annotation file format");
              break;
          }

          break;

        default:
          throw new EoulsanException(
              "Unknown parameter for " + getName() + " step: " + p.getName());
      }
    }
  }