{% extends 'program_base.html' %}

{% block stylelink %}"{{ url_for('static', filename='css/depht_style.css') }}"{% endblock %}
{% block script %}"{{url_for('static', filename='js/arguments.js')}}"{% endblock %}

{% block heading %}
    <h2 class="page_heading">Run DEPhT</h2>
{% endblock %}

{% block form_content %}

  <form class="inner args_form" action="{{url_for('depht.depht_results')}}"
    method="post" enctype="multipart/form-data">

    <table>
      <tr>
        <td><label for="input_file">Input file</label></td>
        <td>
          <div class="help">
            <img src="{{url_for('static', filename='images/help_icon.png')}}"
              alt="help" class="help_icon">
            <span class="help_text">Genome file(s) to scan for prophages</span>
          </div>
        </td>
        <td></td>
        <td><input type="file" name="input_file" required multiple></td>

      </tr>
      </table>
      <br>
      <hr>
      <a href="javascript:void(0)" name="show_opt" id="show_opt" class="more"
        onclick="show_optional('depht_opt', id, 'hide_opt')">
      <br>
      <br>
        Show optional arguments
      </a>
      <span id="depht_opt" class="opt">
        <h4>Optional arguments</h4>
        <table class="optional_args">
          <tr>
            <td><label for="model">Local models to use</label></td>
            <td>
              <select class="model" name="model" id="model">
                {% for model in local_models %}
                    <option value="{{model}}">{{model}}</option>
                {% endfor %}
              </select>
            </td>
            <td>
              <div class="help"><img src="{{url_for('static', filename='images/help_icon.png')}}"
                alt="help" class="help_icon">
                <span class="help_text">
                  Choose from one of the local models available</span>
              </div>
            </td>
          </tr>

          <tr>
            <td><label for="mode">Runmode</label></td>
            <td>
              <select class="mode" name="mode" id="mode">
                <option value="normal">Normal</option>
                <option value="fast">Fast</option>
                <option value="sensitive">Sensitive</option>
              </select>
            </td>
            <td>
              <div class="help"><img src="{{url_for('static',
                filename='images/help_icon.png')}}" alt="help" class="help_icon">
                <span class="help_text">Runmode that favors speed or accuracy</span>
              </div>
            </td>
          </tr>

          <tr>
            <td><label for="att">att Sensitivity</label></td>
            <td>
              <input type="text" name="att" class="num_input" id="att" placeholder={{att}}
                value={{att}} min=0>
            </td>
            <td>
              <div class="help"><img src="{{url_for('static', filename='images/help_icon.png')}}"
                alt="help" class="help_icon">
                <span class="help_text">
                  Sensitivity parameter for att site detection</span>
              </div>
            </td>
          </tr>
          <tr>
            <td><label for="products">Minimum phage homologs for prophage</label></td>
            <td>
              <input type="text" name="products" class="num_input" id="products" placeholder="0" value=0 min=0>
            </td>
            <td>
              <div class="help"><img src="{{url_for('static', filename='images/help_icon.png')}}"
                alt="help" class="help_icon">
                <span class="help_text">
                  Minimum phage homologs for prophage</span>
              </div>
            </td>
          </tr>

          <tr>
            <td><label for="length">Minimum length for prophage</label></td>
            <td><input type="text" name="length" class="num_input" id="length" placeholder={{length}}
              value={{length}} min=0>
            </td>
            <td>
            <div class="help"><img src="{{url_for('static', filename='images/help_icon.png')}}"
              alt="help" class="help_icon">
              <span class="help_text">
                Minimum length to report a prophage</span>
            </div>
            </td>
          </tr>

          <tr>
            <td><label for="cores">CPU cores</label></td>
            <td>
              <select class="cores" id="cores", name="cores"></select>
            </td>
            <td>
              <div class="help"><img src="{{url_for('static', filename='images/help_icon.png')}}"
                alt="help" class="help_icon">
                <span class="help_text">
                  Number of CPU cores to use</span>
              </div>
            </td>
          </tr>
        </table>
        <br>
        <br>
        <a href="javascript:void(0)" name="hide_opt" id="hide_opt" class="more"
          onclick="show_optional('depht_opt','show_opt', id)">
          Hide optional arguments
        </a>
      </span>

      <br>
      <input type="checkbox" id="dump" name="dump" value={{True}}>
      <label for="dump">Dump all supporting data to output directory</label>
      <br>
      <br>
      <br>
      <input type="submit" value="Submit" id="submit_depht"
        onclick="this.value = 'Loading...'; this.style.border = '2px solid red'">
    <br>
    <br>

  </form>

  <p id="temp" style="color:white;"></p>
{% endblock %}
