<commit_before><h1>Peptidome Analysis</h1>
<p>The peptidome analysis uses the tryptic peptide information in the Unipept database. By indexing the INSDC cross-references in the Uniprot database, a mapping could be made between the tryptic peptides and the completed refseq genomes. The complete set of tryptic peptides corresponding with a genome is what we call the peptidome.</p>

<div id="buttons-pancore"></div>

<ul id="tabs" class="nav nav-tabs">
  <li class="<%= @tab == "peptidefinder" ? "active" : ""%>"><a href="#pancore_graph_wrapper" id="unique-peptide-finder-tab" data-toggle="tab">Unique Peptide Finder</a></li>
  <li class="<%= @tab == "peptidomeclustering" ? "active" : ""%>"><a href="#sim_matrix_wrapper" id="peptidome-clustering-tab" data-toggle="tab">Peptidome Clustering</a></li>
</ul>

<div class="tab-help" id="tab-help">
  <div id="unique-peptide-finder-help">
    <p>Find unique peptides for a species of your choice, based on the data of the completed refseq genomes. These peptides can be downloaded and used for targeted proteomics experiments.</p>
    <p>When you add a genome to the set, the union and intersection of the peptides of that genome and the ones already added are calculated. The size of the union (pan peptidome) is represented by blue dots and the size of the intersection (core peptidome) by orange dots. Additionally, a more restrictive version of the core peptidome is calculated (green dots) by only including peptides that are unique for the selected genomes. These unique peptides have the same Lowest Common Ancestor (LCA) as the LCA of the selected genomes.</p>
    <div class="row features">
      <div class="col-xs-4">
        <p class="text-center help-icon"><span class="glyphicon glyphicon-plus-sign"></span></p>
        <h3>1. Add genomes</h3>
        <p>You can add genomes by selecting a species from the drop-down list and clicking the 'Add species' button, or by dragging individual genomes from the tree on the left to the table on the right.</p>
      </div>
      <div class="col-xs-4">
        <p class="text-center help-icon"><span class="glyphicon glyphicon-random"></span></p>
        <h3>2. Reorder</h3>
        <p>You can easily reorder the genomes by dragging them to the desired position on the graph or table. Alternatively, you can use one of the automatic sort options.</p>
      </div>
      <div class="col-xs-4">
        <p class="text-center help-icon"><span class="glyphicon glyphicon-download"></span></p>
        <h3>3. Download unique peptides</h3>
        <p>You can download a list of peptides present in all of the selected genomes but nowhere outside of this taxonomic group, by clicking on the rightmost datapoint in de graph. Next, use the 'Download peptides' button and select 'Unique peptides'.</p>
      </div>
    </div>
  </div>
  <div id="peptidome-clustering-help">
    <p>Find similarities between a selection of genomes and view the results in a similarity matrix or a phylogenetic tree.</p>
    <div class="row features">
      <div class="col-xs-4">
        <p class="text-center help-icon"><span class="glyphicon glyphicon-plus-sign"></span></p>
        <h3>1. Add genomes</h3>
        <p>You can add genomes by selecting a species from the drop-down list and clicking the 'Add species' button, or by dragging individual genomes from the tree on the left to the table on the right.</p>
      </div>
      <div class="col-xs-4">
        <p class="text-center help-icon"><span class="glyphicon glyphicon-th"></span></p>
        <h3>2. Cluster</h3>
        <p>You can easily cluster the genomes by clicking the blurred phylogenetic tree next to the similarity matrix.</p>
      </div>
      <div class="col-xs-4">
        <p class="text-center help-icon"><span class="glyphicon glyphicon-download"></span></p>
        <h3>3. Download results</h3>
        <p>You can download the similarity data by clicking the 'Download data' button in the top-right corner. The similarities between the genomes are offered as a Microsoft Excel-compatible CSV file, the phylogenetic tree in the newick format.</p>
      </div>
    </div>
  </div>
</div>

<div class="tab-content">
  <div class="tab-pane fade <%= @tab == "peptidefinder" ? "in active" : ""%>" id="pancore_graph_wrapper">
    <div id="pancore_graph">
      <div id="popovers"></div>
    </div>
  </div>
  <div class="tab-pane fade <%= @tab == "peptidomeclustering" ? "in active" : ""%>" id="sim_matrix_wrapper">
    <div id="sim_matrix"></div>
  </div>
</div>
<hr>
<div class="split">
  <div class="split-left">
    <ul id="genome-tabs" class="nav nav-tabs">
      <li class="active"><a href="#refseq-genomes" id="refseq-genomes-tab" data-toggle="tab">RefSeq genomes</a></li>
      <li><a href="#my-genomes" id="my-genomes-tab" data-toggle="tab">My genomes <span class="badge">0</span></a></li>
    </ul>

    <div class="tab-content" id="genome-tabs">
      <div class="tab-pane fade in active" id="refseq-genomes">
        <p class="intro">
          To add all genomes from a species, select one from the drop-down and click the load button.
        </p>
        <%= form_tag(:pancore_analyze, :method => "get", :class => "form-inline") do %>
            <div class="form-group"><%= select_tag(:species_id, options_for_select(@species, params[:species_id]), :class => "form-control") %></div>
            <div class="form-group"><%= button_tag(raw("Add species <span class='glyphicon glyphicon-chevron-right'></span>"), :type => "button", :class => "btn btn-primary", :id => "add_species_peptidome", :"data-loading-text" => "Loading...") %></div>
        <% end %>

        <p class="intro">
          <br>
           To add individual genomes, drag a node from the tree to the table on the right.
        </p>
        <div id="treeView" class="treeView pancore">
          <div class="input-group" id="treeSearchDiv">
          <%= search_field_tag(:treeSearch, "", :placeholder => "type to filter the tree by name or bioproject id", :class => "form-control") %><span class="input-group-addon"><span class="glyphicon glyphicon-search"></span></span>
          </div>
        </div>
      </div>
      <div class="tab-pane fade" id="my-genomes">
        <div class="alert alert-danger hide" id="own-genome-error">
              <strong>Oh snap!</strong> Sorry, your browser doesn't seem to support the File API. Everything should work find in Firefox or Google Chrome.
            </div>
        <div id="ownGenomes" class="hide">
          <table class="table table-condensed" id="my-genomes-table">
            <thead>
              <tr>
                <th class="handle">
                  <button type="button" id='addOwnGenomeButton' class='btn btn-primary btn-xs' data-toggle="button"><span class='glyphicon glyphicon-plus'></span></button>
                </th>
                <th class="name">My genomes <span id="my-genomes-help" class='glyphicon glyphicon-info-sign' title='You can easily add non-RefSeq genomes yourself! Just select a FASTA-file containing one or more proteins for processing and it will be stored in your browser. After adding them to My genomes, you can simply drag them to the table on the right as you would with other genomes.'></span></th>
                <th class="status"></th>
                <th class="action"><a id="remove-my-genomes" class="btn btn-xs btn-danger" title="remove all my genomes"><span class="glyphicon glyphicon-trash"></span></a></th>
              </tr>
            </thead>
            <tbody>
            </tbody>
          </table>
          <div id="owngenomes-popover-head" class="hide">Add your own genome</div>
          <div id="owngenomes-popover-content" class="hide">
            <form><commit_msg>tweak refseq genomes help and layout<commit_after><h1>Peptidome Analysis</h1>
<p>The peptidome analysis uses the tryptic peptide information in the Unipept database. By indexing the INSDC cross-references in the Uniprot database, a mapping could be made between the tryptic peptides and the completed refseq genomes. The complete set of tryptic peptides corresponding with a genome is what we call the peptidome.</p>

<div id="buttons-pancore"></div>

<ul id="tabs" class="nav nav-tabs">
  <li class="<%= @tab == "peptidefinder" ? "active" : ""%>"><a href="#pancore_graph_wrapper" id="unique-peptide-finder-tab" data-toggle="tab">Unique Peptide Finder</a></li>
  <li class="<%= @tab == "peptidomeclustering" ? "active" : ""%>"><a href="#sim_matrix_wrapper" id="peptidome-clustering-tab" data-toggle="tab">Peptidome Clustering</a></li>
</ul>

<div class="tab-help" id="tab-help">
  <div id="unique-peptide-finder-help">
    <p>Find unique peptides for a species of your choice, based on the data of the completed refseq genomes. These peptides can be downloaded and used for targeted proteomics experiments.</p>
    <p>When you add a genome to the set, the union and intersection of the peptides of that genome and the ones already added are calculated. The size of the union (pan peptidome) is represented by blue dots and the size of the intersection (core peptidome) by orange dots. Additionally, a more restrictive version of the core peptidome is calculated (green dots) by only including peptides that are unique for the selected genomes. These unique peptides have the same Lowest Common Ancestor (LCA) as the LCA of the selected genomes.</p>
    <div class="row features">
      <div class="col-xs-4">
        <p class="text-center help-icon"><span class="glyphicon glyphicon-plus-sign"></span></p>
        <h3>1. Add genomes</h3>
        <p>You can add genomes by selecting a species from the drop-down list and clicking the 'Add species' button, or by dragging individual genomes from the tree on the left to the table on the right.</p>
      </div>
      <div class="col-xs-4">
        <p class="text-center help-icon"><span class="glyphicon glyphicon-random"></span></p>
        <h3>2. Reorder</h3>
        <p>You can easily reorder the genomes by dragging them to the desired position on the graph or table. Alternatively, you can use one of the automatic sort options.</p>
      </div>
      <div class="col-xs-4">
        <p class="text-center help-icon"><span class="glyphicon glyphicon-download"></span></p>
        <h3>3. Download unique peptides</h3>
        <p>You can download a list of peptides present in all of the selected genomes but nowhere outside of this taxonomic group, by clicking on the rightmost datapoint in de graph. Next, use the 'Download peptides' button and select 'Unique peptides'.</p>
      </div>
    </div>
  </div>
  <div id="peptidome-clustering-help">
    <p>Find similarities between a selection of genomes and view the results in a similarity matrix or a phylogenetic tree.</p>
    <div class="row features">
      <div class="col-xs-4">
        <p class="text-center help-icon"><span class="glyphicon glyphicon-plus-sign"></span></p>
        <h3>1. Add genomes</h3>
        <p>You can add genomes by selecting a species from the drop-down list and clicking the 'Add species' button, or by dragging individual genomes from the tree on the left to the table on the right.</p>
      </div>
      <div class="col-xs-4">
        <p class="text-center help-icon"><span class="glyphicon glyphicon-th"></span></p>
        <h3>2. Cluster</h3>
        <p>You can easily cluster the genomes by clicking the blurred phylogenetic tree next to the similarity matrix.</p>
      </div>
      <div class="col-xs-4">
        <p class="text-center help-icon"><span class="glyphicon glyphicon-download"></span></p>
        <h3>3. Download results</h3>
        <p>You can download the similarity data by clicking the 'Download data' button in the top-right corner. The similarities between the genomes are offered as a Microsoft Excel-compatible CSV file, the phylogenetic tree in the newick format.</p>
      </div>
    </div>
  </div>
</div>

<div class="tab-content">
  <div class="tab-pane fade <%= @tab == "peptidefinder" ? "in active" : ""%>" id="pancore_graph_wrapper">
    <div id="pancore_graph">
      <div id="popovers"></div>
    </div>
  </div>
  <div class="tab-pane fade <%= @tab == "peptidomeclustering" ? "in active" : ""%>" id="sim_matrix_wrapper">
    <div id="sim_matrix"></div>
  </div>
</div>
<hr>
<div class="split">
  <div class="split-left">
    <ul id="genome-tabs" class="nav nav-tabs">
      <li class="active"><a href="#refseq-genomes" id="refseq-genomes-tab" data-toggle="tab">RefSeq genomes</a></li>
      <li><a href="#my-genomes" id="my-genomes-tab" data-toggle="tab">My genomes <span class="badge">0</span></a></li>
    </ul>

    <div class="tab-content" id="genome-tabs">
      <div class="tab-pane fade in active" id="refseq-genomes">
        <p class="intro">
          <span class="glyphicon glyphicon-info-sign"></span> Select a species and click 'Add species' to add all genomes from a single species.
        </p>
        <%= form_tag(:pancore_analyze, :method => "get", :class => "form-inline") do %>
            <div class="form-group"><%= select_tag(:species_id, options_for_select(@species, params[:species_id]), :class => "form-control") %></div>
            <div class="form-group"><%= button_tag(raw("Add species <span class='glyphicon glyphicon-chevron-right'></span>"), :type => "button", :class => "btn btn-primary", :id => "add_species_peptidome", :"data-loading-text" => "Loading...") %></div>
        <% end %>

        <hr>
        <p class="intro">
          <span class="glyphicon glyphicon-info-sign"></span>
          Drag a tree node to the table to add them to the visualisation.
        </p>
        <div id="treeView" class="treeView pancore">
          <div class="input-group" id="treeSearchDiv">
          <%= search_field_tag(:treeSearch, "", :placeholder => "type to filter the tree by name or bioproject id", :class => "form-control") %><span class="input-group-addon"><span class="glyphicon glyphicon-search"></span></span>
          </div>
        </div>
      </div>
      <div class="tab-pane fade" id="my-genomes">
        <div class="alert alert-danger hide" id="own-genome-error">
              <strong>Oh snap!</strong> Sorry, your browser doesn't seem to support the File API. Everything should work find in Firefox or Google Chrome.
            </div>
        <div id="ownGenomes" class="hide">
          <table class="table table-condensed" id="my-genomes-table">
            <thead>
              <tr>
                <th class="handle">
                  <button type="button" id='addOwnGenomeButton' class='btn btn-primary btn-xs' data-toggle="button"><span class='glyphicon glyphicon-plus'></span></button>
                </th>
                <th class="name">My genomes <span id="my-genomes-help" class='glyphicon glyphicon-info-sign' title='You can easily add non-RefSeq genomes yourself! Just select a FASTA-file containing one or more proteins for processing and it will be stored in your browser. After adding them to My genomes, you can simply drag them to the table on the right as you would with other genomes.'></span></th>
                <th class="status"></th>
                <th class="action"><a id="remove-my-genomes" class="btn btn-xs btn-danger" title="remove all my genomes"><span class="glyphicon glyphicon-trash"></span></a></th>
              </tr>
            </thead>
            <tbody>
            </tbody>
          </table>
          <div id="owngenomes-popover-head" class="hide">Add your own genome</div>
          <div id="owngenomes-popover-content" class="hide">
            <form>
{'fraction_non_alphanumeric': 0.14151610621745, 'fraction_numerical': 0.003471998971259564, 'mean_word_length': 3.3002488249930884, 'pattern_counts': {'":': 0, '<': 379, '<?xml version=': 0, '>': 397, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5703581', 'n_tokens_mistral': 4843, 'n_tokens_neox': 4500, 'n_words': 1583}