<!DOCTYPE html>
<html lang="en">
<head>
  <title>SequenceServer: Custom BLAST Server</title>
  <meta name="author" content="Anurag Priyam" />
  <meta name="author" content="Ben J. Woodcroft" />
  <meta name="author" content="Yannick Wurm" />
  <meta name="author" content="Cedric Wurm" />
  <meta name="description" content="Custom BLAST server provided by SequenceServer (http://www.sequenceserver.com)"/>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
  <script type="text/javascript" src="<%= uri('/js/jquery.js') %>"></script>
  <script type="text/javascript" src="<%= uri('/js/jquery.enablePlaceholder.min.js') %>"></script>
  <script type="text/javascript" src="<%= uri('/js/jquery.activity.js') %>"></script>
  <script type="text/javascript" src="<%= uri('/js/search.js') %>"></script>

  <%# without a space after erb's closing tag, a / gets appended to css' path %>
  <link rel="stylesheet" media="screen" type="text/css" href="<%= uri('/css/bootstrap.min.css') %>" />
  <link rel="stylesheet" media="screen" type="text/css" href="<%= uri('/css/custom.css') %>" />
</head>

<body>
  <div class="container">
    <div class="page">
      <div class="page-header" id="banner">
        <h1>BLAST Sequence(s)</h1>
      </div>

      <form method="post" action="<%= uri('/#result') %>">
        <div class="row">
          <div class="span12">
            <div class="offset-left sequence">
              <div class="clearfix">
                <textarea name="sequence" id="sequence" rows="11" placeholder="Paste your sequence(s) here..." ></textarea>
              </div>
            </div>
          </div>

          <div class="span4">
            <div class="offset-right box blastmethods">
              <div class="clearfix">
                <fieldset>
                  <legend><h4>Blast methods</h4></legend>
                    <ul class="inputs-list">
                      <li>
                        <label title="Protein query; protein database.">
                          <input type="radio" name="method" value="blastp" id="blastp"/>
                          <span>blastp</span>
                        </label>
                      </li>
                      <li>
                        <label title="Protein query; six frame translated nucleotide database.">
                          <input type="radio" name="method" value="tblastn" id="tblastn"/>
                          <span>tblastn</span>
                        </label>
                      </li>
                      <li>
                        <label title="Nucleotide query; nucleotide database.">
                          <input type="radio" name="method" value="blastn" id="blastn"/>
                          <span>blastn</span>
                        </label>
                      </li>
                      <li>
                        <label title="Translated nucleotide query; protein database">
                          <input type="radio" name="method" value="blastx" id="blastx"/>
                          <span>blastx</span>
                        </label>
                      </li>
                      <li>
                        <label title="Six-frame translated nucleotide query; six-frame translated nucleotide database">
                          <input type="radio" name="method" value="tblastx" id="tblastx"/>
                          <span>tblastx</span>
                        </label>
                      </li>
                  </ul>
                </fieldset>
              </div>
            </div>
          </div>
        </div>

        <div class="row">
          <div class="span8">
            <div class="offset-left box databases nucleotide">
              <div class="clearfix">
                <fieldset>
                  <legend><h4>Nucleotide databases</h4></legend>
                  <ul class="inputs-list">
                    <% settings.databases['nucleotide'].each_with_index do |db, i| %>
                      <li>
                        <label>
                          <input type="checkbox" id="ndb<%=i%>" name="db[nucleotide][]" value="<%=i%>"/>
                          <span> <%= db.title or db.name %></span>
                        </label>
                      </li>
                    <% end %>
                  </ul>
                </fieldset>
              </div>
            </div>
          </div>

          <div class="span8">
            <div class="offset-right box databases protein">
              <div class="clearfix">
                <fieldset>
                  <legend><h4>Protein databases</h4></legend>
                  <ul class="inputs-list">
                    <% settings.databases['protein'].each_with_index do |db, i| %>
                      <li>
                        <label>
                          <input type="checkbox" id="pdb<%=i%>" name="db[protein][]" value="<%=i%>"/>
                          <span> <%= db.title or db.name %></span>
                        </label>
                      </li>
                    <% end %>
                  </ul>
                </fieldset>
              </div>
            </div>
          </div>
        </div>

        <div class="row">
          <div class="span12">
            <div class="offset-left box advanced">
              <div class="clearfix">
                <label class="span4" for="advanced"><h4 title="Click to show/hide advanced options.">Advanced Parameters:</h4></label>
                <input class="span8" type="text" name="advanced" id="advanced" title="View, and enter advanced parameters." placeholder="eg: -evalue 1.0e-5 -num_alignments 100"/>
              </div>
  <pre class="help">
  <%= ERB::Util.h %q|
  -evalue <Real>
    Expectation value (E) threshold for saving hits
    Default = `10'
  -word_size <Integer, >=2>
    Word size for wordfinder algorithm
  -gapopen <Integer>
    Cost to open a gap
  -gapextend <Integer>
    Cost to extend a gap
  -matrix <String>
    Scoring matrix name (normally BLOSUM62)
  -threshold <Real, >=0>
    Minimum word score such that the word is added to the BLAST lookup table
  -comp_based_stats <String>
    Use composition-based statistics for blastp / tblastn:
        D or d: default (equivalent to 2)
        0 or F or f: no composition-based statistics
        1: Composition-based statistics as in NAR 29:2994-3005, 2001
        2 or T or t : Composition-based score adjustment as in Bioinformatics
    21:902-911,
        2005, conditioned on sequence properties
        3: Composition-based score adjustment as in Bioinformatics 21:902-911,
        2005, unconditionally
    For programs other than tblastn, must either be absent or be D, F or 0
    Default = `2'
  -num_descriptions <Integer, >=0>
    Number of database sequences to show one-line descriptions for
    Default = `500'
  -num_alignments <Integer, >=0>
    Number of database sequences to show alignments for
    Default = `250'
  *** Query filtering options
  -seg <String>
    Filter query sequence with SEG (Format: 'yes', 'window locut hicut', or
    'no' to disable)
    Default = `no'
  -soft_masking <Boolean>
    Apply filtering locations as soft masks
    Default = `false'
  -lcase_masking
    Use lower case filtering in query and subject sequence(s)?
  *** Restrict search or results
  -gilist <String>
    Restrict search of database to list of GI's
      * Incompatible with:  negative_gilist, seqidlist, remote, subject,
    subject_loc
  -seqidlist <String>
    Restrict search of database to list of SeqId's
      * Incompatible with:  gilist, negative_gilist, remote, subject,
    subject_loc
  -negative_gilist <String>
    Restrict search of database to everything except the listed GIs
      * Incompatible with:  gilist, seqidlist, remote, subject, subject_loc
  -entrez_query <String>
    Restrict search with the given Entrez query
      * Requires:  remote
  -db_soft_mask <String>
    Filtering algorithm ID to apply to the BLAST database as soft masking
      * Incompatible with:  subject, subject_loc
  -culling_limit <Integer, >=0>
    If the query range of a hit is enveloped by that of at least this many
    higher-scoring hits, delete the hit
      * Incompatible with:  best_hit_overhang, best_hit_score_edge
  -best_hit_overhang <Real, (>0 and <0.5)>
    Best Hit algorithm overhang value (recommended value: 0.1)
      * Incompatible with:  culling_limit
  -best_hit_score_edge <Real, (>0 and <0.5)>
    Best Hit algorithm score edge value (recommended value: 0.1)
      * Incompatible with:  culling_limit
  -max_target_seqs <Integer, >=1>
    Maximum number of aligned sequences to keep | %>
  </pre>
          </div>
        </div>

          <div class="span4">
            <input type="submit" class="btn large primary" value="BLAST!"/>
          </div>
        </div>
      </form>

      <div id="result" class="offset-left offset-right">
        <%= @blast %>
      </div>

      <div id="underbar">
        <p>&copy; <a href='http://www.sequenceserver.com'>SequenceServer: BLAST search made easy!</a></p>
      </div>
    </div> <!-- /page -->
  </div> <!-- /container -->
</body>
</html>