about summary refs log tree commit diff
path: root/uploader/templates/genotypes
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/templates/genotypes')
-rw-r--r--uploader/templates/genotypes/add-genotypes-records-base.html39
-rw-r--r--uploader/templates/genotypes/add-genotypes-records-csv.html146
2 files changed, 185 insertions, 0 deletions
diff --git a/uploader/templates/genotypes/add-genotypes-records-base.html b/uploader/templates/genotypes/add-genotypes-records-base.html
new file mode 100644
index 0000000..bf3812f
--- /dev/null
+++ b/uploader/templates/genotypes/add-genotypes-records-base.html
@@ -0,0 +1,39 @@
+{%extends "genotypes/base.html"%}
+{%from "flash_messages.html" import flash_all_messages%}
+
+{%block title%}Genotypes{%endblock%}
+
+{%block pagetitle%}Genotypes{%endblock%}
+
+{%block contents%}
+
+<div class="row">
+  <form id="frm-add-genotypes-records"
+        method="POST"
+        enctype="multipart/form-data"
+        action="{{url_for(
+                'species.populations.genotypes.add_genotype_records',
+                species_id=species.SpeciesId, population_id=population.Id,
+                dataset_id=dataset.Id)}}"
+        data-resumable-target="{{url_for('files.resumable_upload_post')}}">
+    <legend>Add New Genotype Records</legend>
+
+    {%block frm_add_genotypes_records_elements%}{%endblock%}
+
+    <div class="form-group">
+      <input type="submit"
+             value="upload genotypes"
+             class="btn btn-primary" />
+    </div>
+  </form>
+</div>
+
+<div class="row">
+  <h2 class="heading" id="page-documentation">Help</h2>
+  {%block page_documentation%}{%endblock%}
+</div>
+{%endblock%}
+
+
+{%block javascript%}
+{%endblock%}
diff --git a/uploader/templates/genotypes/add-genotypes-records-csv.html b/uploader/templates/genotypes/add-genotypes-records-csv.html
new file mode 100644
index 0000000..58dbe81
--- /dev/null
+++ b/uploader/templates/genotypes/add-genotypes-records-csv.html
@@ -0,0 +1,146 @@
+{%extends "genotypes/add-genotypes-records-base.html"%}
+{%from "phenotypes/macro-display-preview-table.html" import display_preview_table%}
+{%from "macro-csv-fields.html" import display_csv_fields, display_csv_fields_documentation%}
+{%from "phenotypes/macro-display-resumable-elements.html" import display_resumable_elements%}
+
+{%block frm_add_genotypes_records_elements%}
+<div class="form-text help-block">
+  <p>You can add new genotype records here.</p>
+</div>
+
+{{display_csv_fields()}}
+
+<div class="form-group">
+  <div class="non-resumable-elements">
+    <label for="finput-genotypes-records-file" class="form-label">
+      genotypes records</label>
+    <input id="finput-genotypes-records-file"
+           name="genotypes-records-file"
+           class="form-control"
+           type="file"
+           data-preview-table="tbl-preview-geno-records"
+           required="required"  />
+    <span class="form-text text-muted">
+      Provide a file that contains only the genotypes records,
+      <a href="#docs-file-genotypes-records-csv"
+         title="Documentation of the genotypes records file format.">
+        the documentation for the expected format of the file</a>.</span>
+  </div>
+  {{display_resumable_elements(
+  "resumable-genotypes-records-file",
+  "Genotypes records",
+  '<p>Drag and drop the CSV file here, that contains the genotype records you
+    want to add.</p>
+
+  <p>Please see the
+    <a href="#docs-file-genotypes-records"
+       title="Documentation of the genotypes records data file format.">
+      "Genotypes records" documentation</a> section below for more
+    information on the expected format of the file provided here.</p>')}}
+  {{display_preview_table("tbl-preview-geno-records", "genotypes records")}}
+</div>
+
+<div class="">
+  <h4 class="subheading">Genotype Encoding</h4>
+  <div class="form-text help-block">
+    <p>The symbols in your genotype file need to be mapped to known values to
+      enable mapping.</p>
+  </div>
+
+  <div class="form-group">
+    <div class="row mb-3">
+      <label for="txt-geno-encoding-mat"
+             class="col-form-label col-sm-2">Maternal</label>
+      <div class="col-sm-10">
+        <div class="input-group">
+        <input type="text"
+               maxlength="3"
+               id="txt-geno-encoding-mat"
+               name="geno_encoding_mat"
+               class="form-control" />
+        <div class="input-group-append">
+          <span class="input-group-text">Value = -1</span>
+        </div>
+        </div>
+      </div>
+      <span class="form-text text-muted col-sm-12">
+        Enter the symbol in your file that represents the allele inherited from
+        the mother. This allele will be mapped to the value -1.</span>
+    </div>
+  </div>
+
+  <div class="form-group">
+    <div class="row mb-3">
+      <label for="txt-geno-encoding-pat"
+             class="col-form-label col-sm-2">Paternal</label>
+      <div class="col-sm-10">
+        <div class="input-group">
+          <input type="text"
+                 maxlength="3"
+                 id="txt-geno-encoding-pat"
+                 name="geno_encoding_pat"
+                 class="form-control" />
+          <div class="input-group-append">
+            <span class="input-group-text">Value = 1</span>
+          </div>
+        </div>
+      </div>
+      <span class="form-text text-muted">
+        Enter the symbol in your file that represents the allele inherited from
+        the father. This allele will be mapped to the value 1.</span>
+    </div>
+  </div>
+
+  <div class="form-group">
+    <div class="row mb-3">
+      <label for="txt-geno-encoding-het"
+             class="col-form-label col-sm-2">Heterozygous (value = 0)</label>
+      <div class="col-sm-10">
+        <div class="input-group">
+          <input type="text"
+                 maxlength="3"
+                 id="txt-geno-encoding-het"
+                 name="geno_encoding_het"
+                 class="form-control" />
+          <div class="input-group-append">
+            <span class="input-group-text">Value = 0</span>
+          </div>
+        </div>
+      </div>
+      <span class="form-text text-muted">
+        Enter the symbol in your file that represents the allele inherited from
+        both parents. This allele will be mapped to the value 0.</span>
+    </div>
+  </div>
+</div>
+{%endblock%}
+
+{%block page_documentation%}
+{{super()}}
+
+<h3 class="sub-heading">CSV file metadata</h3>
+{{display_csv_fields_documentation()}}
+{%endblock%}
+
+{%block javascript%}
+{{super()}}
+<script src="{{url_for('base.node_modules',
+             filename='resumablejs/resumable.js')}}"></script>
+<script src="/static/js/files.js"></script>
+
+<script type="text/javascript">
+  $(function(evt) {
+      
+      var preview_tables_to_elements_map = {
+          "#tbl-preview-geno-records": "#finput-genotypes-records-file",
+      };
+
+      makeResumableObject(
+          form_id="frm-add-genotypes-records",
+          file_input_id="finput-genotypes-records-file",
+          resumable_element_id="resumable-genotypes-records-file",
+          preview_table_id="tbl-preview-geno-records",
+          filetypes=["csv", "tsv", "txt", "geno"]);
+  });
+</script>
+{%endblock%}