diff options
author | zsloan | 2020-01-09 14:35:41 -0600 |
---|---|---|
committer | zsloan | 2020-01-09 14:35:41 -0600 |
commit | 69d1bdaf05a491148101e61bb3ec0d011ca5a90a (patch) | |
tree | 23b3dd46dfea60c114278e9ed312a9f39486b081 | |
parent | 8ce8fae0dc890ca1dad6d48b9ec2e61107c27ae2 (diff) | |
download | genenetwork2-69d1bdaf05a491148101e61bb3ec0d011ca5a90a.tar.gz |
Added R and python import code for trait page export
-rw-r--r-- | wqflask/wqflask/static/new/javascript/show_trait.js | 5 | ||||
-rw-r--r-- | wqflask/wqflask/templates/show_trait_edit_data.html | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js index f3f38541..7fb718cd 100644 --- a/wqflask/wqflask/static/new/javascript/show_trait.js +++ b/wqflask/wqflask/static/new/javascript/show_trait.js @@ -796,6 +796,11 @@ export_sample_table_data = function() { }; $('.export_format').change(function() { + if (this.value == "csv"){ + $('#export_code').css("display", "block") + } else{ + $('#export_code').css("display", "none") + } $('input[name=export_format]').val( this.value ); $('.export_format').val( this.value ); }); diff --git a/wqflask/wqflask/templates/show_trait_edit_data.html b/wqflask/wqflask/templates/show_trait_edit_data.html index c3052866..ddc58784 100644 --- a/wqflask/wqflask/templates/show_trait_edit_data.html +++ b/wqflask/wqflask/templates/show_trait_edit_data.html @@ -13,6 +13,18 @@ <input type="button" class="btn btn-success reset" value="Reset"> </div> </div> + <div id="export_code" style="width: 600px; display: none;"> + <pre style="padding-top: 0px; padding-bottom: 0px; height: 150px;"> + <code> +# read into R +trait <- read.csv("{{ this_trait.display_name}}.csv", header = TRUE, comment.char = "#") + +# read into python +import pandas as pd +trait = pd.read_csv("{{ this_trait.display_name}}.csv", header = 0, comment = "#") + </code> + </pre> + </div> {% set outer_loop = loop %} <div class="sample_group" style="width:{{ trait_table_width }};"> <div style="position: relative;"> |