<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Spamo - Submission form</title>
    <link rel="shortcut icon" type="image/x-icon" href="../doc/images/memesuite_icon.ico">
    <link rel="icon" type="image/png" href="../doc/images/memesuite_icon.png">
    <link href="../doc/css/style.css" rel="stylesheet" type="text/css" />
    <link href="../css/component_motifs.css" rel="stylesheet" type="text/css">
    <link href="../css/component_sequences.css" rel="stylesheet" type="text/css">
    <link href="../css/component_bfile.css" rel="stylesheet" type="text/css">
    <script src="../doc/js/menu-path.js"></script>
    <script src="../doc/js/menu.js"></script>
    <script src="../doc/js/motif_logo.js"></script>
    <script src="../doc/js/utilities.js"></script>
    <script src="../js/site.js"></script>
    <script src="../js/alphabet_parser.js"></script>
    <script src="../js/fasta-debug.js"></script>
    <script src="../js/motif_parser.js"></script>
    <script src="../js/component_motifs.js"></script>
    <script src="../js/component_sequences.js"></script>
    <script src="../js/bg_parser.js"></script>
    <script src="../js/component_bfile.js"></script>
    <script src="../js/spamo.js"></script>
  </head>
  <body>

    <div class="pop_content" id="pop_sequences" >
      <p>Select a file of <a href="../doc/fasta-format.html">FASTA formatted</a>
      DNA sequences or paste in actual <a href="../doc/fasta-format.html"
      >FASTA formatted</a> DNA sequences to analyse motif spacings.</p>
      <p>For ChIP-seq peaks, the best approach is 500bp sequences centered
	on the peak summit (or on the peak center if the peak-caller does not
	report the peak summit.)</p>
      <p>The sequences you input should all be the same length.
        The sequences should be at least 400bp long, and 500bp is recommended.
        See the <a href="@SITE_URL@/doc/examples/example-datasets/Klf1.fna"
        >example DNA sequences</a> which were used to create the <a
        href="../doc/examples/spamo_example_output_files/spamo.html">sample output</a>
      to get an idea of input that works well for SpaMo.</p>
      <p>Sometimes it is helpful if you mask repeats in your DNA sequences
      by converting them to the letter 'N', but SpaMo will also automatically remove
      sequences that are too similar to each other.  You can repeat-mask
      your sequences by using the 
      <a href='http://www.repeatmasker.org'>repeat-masker program</a> or you can
      request repeat-masked sequences when you download genomic sequences using the
      <a href="http://genome.ucsc.edu">UCSC Genome Table Browser</a> or 
      <a href="https://main.g2.bx.psu.edu">Galaxy</a>.</p>
      <div class="pop_close">[ <a href="javascript:help_popup()">close</a> ]</div>
    </div>

    <div class="pop_content" id="pop_primary">
      <p>SpaMo expects a single DNA motif as the primary motif. 
      (If multiple motifs are input, then only the first motif will be used.) 
      The primary motif is typically one you expect to be in many of the input sequences
      (e.g., the DNA-binding motif of the ChIP-ed transcription factor if the sequences are
      ChIP-seq peak regions).</p>
      <div class="pop_close">[ <a href="javascript:help_popup()">close</a> ]</div>
    </div>

    <div class="pop_content" style="display:none" id="pop_secondaries">
      <p>Using the menus below, input motifs to analyze for spacing relative to the primary motif.  
        Use the first menu below to choose how you want to input the motifs, and
	the second menu to choose the particular motif database you require.</p>
      <div class="pop_close">[ <a href="javascript:help_popup()">close</a> ]</div>
    </div>

    <div class="pop_content" id="pop_background">
      <p>The background model normalizes for biased distribution of
      individual letters in your sequences.
      By default SpaMo will create a 0-order Markov sequence model from
      the letter frequencies in the primary input sequences.
      You may also choose to use a uniform background model or to use
      the background model specified by the motifs.</p>
      <p>Alternately you may select "Upload background" and input a file containing
      a <a href="../doc/bfile-format.html">background model</a>.</p>
      <p>The downloadable version of the MEME Suite contains a script named
      "fasta-get-markov" that you can use to create sequence model files in
      the correct format from a FASTA sequence file.</p>
      <div class="pop_close">[ <a href="javascript:help_popup()">close</a> ]</div>
    </div>

    <div class="pop_content" id="pop_dumpseqs">
      <p>SpaMo can create an additional text file containing one line for
      each significant primary-secondary motif spacing found in each input sequence. 
      The text file contains fields that from left to right contain:</p>
      <ol>
        <li>A portion of the sequence in lower case, with the motif 
        matches in upper case.</li>
        <li>The position (offset) of the secondary match within the sequence 
        portion.</li>
        <li>The fragment of the sequence that matched the primary 
        motif.</li>
        <li>The strand of the primary motif match.</li>
        <li>The fragment of the sequence that matched the secondary
        motif.</li>
        <li>The strand of the secondary motif match.</li>
        <li>Secondary site is on the same (s) or opposite (o) strand
        to the primary site.</li>
        <li>Secondary site is upstream (u) or downstream (d) of the 
        primary site.</li>
        <li>The gap between the primary and secondary site.</li>
        <li>The name of the sequence.</li>
      </ol>
      <div class="pop_close">[ <a href="javascript:help_popup()">close</a> ]</div>
    </div>
    <!--{help/}-->
    <div class="content_box">
      <!--{header}-->
      <p>
      <!--{title}-->SpaMo<!--{/title}--> - <!--{subtitle}-->Spaced Motif Analysis Tool<!--{/subtitle}--><br>
      <!--{logo}-->../doc/images/spamo_icon.png<!--{/logo}-->: <!--{alt}-->SpaMo Logo<!--{/alt}--><br>
      <!--{blurb}--><span class="blurb" data-id="spamo"></span><!--{/blurb}-->
      </p>
      <!--{/header}-->
      <form enctype="multipart/form-data" accept-charset="utf-8"
      method="POST" action="spamo" id="spamo_form">
        <fieldset>
          <legend>Data Submission Form</legend>
          <p class="meme">Discover enriched spacings between motifs in a set of sequences.</p> 
          
          <!--{sequences}-->
          <!--{prefix}-->sequences<!--{/prefix}-->
          <!--{title}-->Input the sequences<!--{/title}-->
          <!--{subtitle}-->Enter sequences in which you want to analyze motif spacings.<!--{/subtitle}-->
          <!--{default}-->FILE<!--{/default}-->
          <!--{register}-->register_component<!--{/register}-->
          <!--{/sequences}-->

          <!--{primary}-->
          <!--{prefix}-->primary<!--{/prefix}-->
          <!--{description}-->primary motif<!--{/description}-->
          <!--{title}-->Input the primary motif<!--{/title}-->
          <!--{subtitle}-->Upload or enter a motif to use as the primary.<!--{/subtitle}-->
          <!--{default}-->FILE<!--{/default}-->
          <!--{register}-->register_component<!--{/register}-->
          <!--{/primary}-->

          <!--{secondaries}-->
          <!--{prefix}-->secondaries<!--{/prefix}-->
          <!--{description}-->secondary motifs<!--{/description}-->
          <!--{title}-->Input the secondary motifs.<!--{/title}-->
          <!--{subtitle}-->Select a <a href="../db/motifs">motif database</a> or enter motifs to test for preferred spacings relative to the primary motif.<!--{/subtitle}-->
          <!--{default}-->DATABASE<!--{/default}-->
          <!--{enable_db/}-->
          <!--{register}-->register_component<!--{/register}-->
          <!--{/secondaries}-->

          <!--{job_details/}-->

          <!-- Advanced Options -->
          <div style="margin-top: 5px; margin-bottom: 5px; width: 80%">
	    <!--{advanced_options/}-->
	    <div>
	      <input type="checkbox" class="meme" name="dumpseqs" id="dumpseqs" value="1">
	      <label for="dumpseqs">Print significant primary-secondary motif matches to a file.</label>
	      <div class="help" data-topic="pop_dumpseqs"></div>

              <!--{bfile}-->
                <!--{prefix}-->background<!--{/prefix}-->
                <!--{enable_zero_order/}-->
                <!--{enable_uniform/}-->
                <!--{enable_meme/}-->
                <!--{enable_upload/}-->
                <!--{selected}-->zero<!--{/selected}-->
                <!--{register}-->register_component<!--{/register}-->
              <!--{/bfile}-->
	    </div>
	  </div>
         

          <!--{submit_reset/}-->
        </fieldset>
      </form>
      <!--{footer/}-->
    </div>
  </body>
</html>
