Skip to content

Commit f143fb4

Browse files
committed
Merge branch 'master' of https://github.com/ImagingDataCommons/IDC-WebApp into idc-test-sp
2 parents f8ee2fd + e904810 commit f143fb4

File tree

8 files changed

+155
-24
lines changed

8 files changed

+155
-24
lines changed

static/css/style.css

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/js/cohorts/cohort-details.js

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,12 @@ require([
5757

5858
tippy('.manifest-size-warning',{
5959
content: 'Your cohort is too large to be downloaded in its entirety, and will be truncated at 65,000 records ' +
60-
'ordered by PatientID, StudyID, SeriesID, and InstanceID.',
60+
'ordered by PatientID, CollectionID, StudyInstanceUID, SeriesInstanceUID, SOPInstanceUID, SourceDOI, ' +
61+
'CRDCInstanceUUID, and GCSPath.',
6162
theme: 'light',
6263
placement: 'left',
63-
arrow: false
64+
arrow: false,
65+
maxWidth: 400
6466
});
6567

6668
var downloadToken = new Date().getTime();
@@ -77,6 +79,18 @@ require([
7779
download_manifest("json", $(this), e)
7880
});
7981

82+
$('.export-option input[type="radio"]').click(function(){
83+
update_export_option($(this).attr("value"));
84+
});
85+
86+
var update_export_option = function(export_option) {
87+
$('#bq-manifest').hide();
88+
$('#file-manifest').hide();
89+
$('#' + export_option).show();
90+
};
91+
92+
update_export_option("file-manifest");
93+
8094
var download_manifest = function(file_type, clicked_button, e) {
8195
$('#unallowed-chars-alert').hide();
8296
$('#name-too-long-alert-modal').hide();
@@ -144,13 +158,24 @@ require([
144158
}
145159
});
146160

161+
var include_header = $('#include-header-checkbox')[0].checked;
162+
147163
var url = BASE_URL + '/cohorts/download_manifest/' + cohort_id + '/';
148164
url += ("?file_type=" + file_type);
165+
url += ("&include_header=" + include_header);
149166
url += ("&file_name=" + name);
150167
url += ("&header_fields=" + JSON.stringify(checked_fields));
151168
url += ("&columns=" + JSON.stringify(checked_columns));
152169
url += ("&downloadToken=" + downloadToken);
153170

171+
var select_box_div = $('#file-part-select-box');
172+
var select_box = select_box_div.find('select');
173+
if (select_box_div.is(":visible"))
174+
{
175+
var selected_file_part = select_box.children("option:selected").val();
176+
url += ("&file_part=" + selected_file_part);
177+
}
178+
154179
location.href = url;
155180
};
156181

static/js/collections_list.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,68 @@ require(['jquery', 'datatables.net','jqueryui', 'bootstrap', 'base'],
3939
}
4040
});
4141

42+
$('#collections-table tbody').on('click', 'td.collection-explore', function () {
43+
console.log($(this).attr('data-collex-id'));
44+
45+
var tcia_id_map = {};
46+
tcia_id_map['10.7937/TCIA.2018.h7umfurq'] = ['lidc_idri'];
47+
48+
// Lung Phantom, LIDC-IDRI, QIN LUNG CT, RIDER Lung CT
49+
tcia_id_map['10.7937/K9/TCIA.2015.1BUVFJR7'] = ['lidc_idri'];
50+
// TCGA-BRCA, BREAST-DIAGNOSIS, ISPY1, Breast-MRI-NACT-Pilot
51+
tcia_id_map['10.7937/TCIA.2019.wgllssg1'] = ['tcga_brca', 'ispy1'];
52+
53+
tcia_id_map['10.7937/K9/TCIA.2014.FAB7YRPZ'] = ['tcga_gbm'];
54+
tcia_id_map['10.7937/TCIA.2018.ow6ce3ml'] = ['tcga_gbm', 'tcga_lgg'];
55+
56+
var groups = [];
57+
var filters = [];
58+
var values = [];
59+
60+
var collection_id = $(this).attr('data-collex-id');
61+
if (collection_id in tcia_id_map) {
62+
values = tcia_id_map[collection_id];
63+
}
64+
else {
65+
values.push(collection_id);
66+
}
67+
68+
filters.push(
69+
{
70+
'id': '120',
71+
'values': values,
72+
});
73+
groups.push({'filters': filters});
74+
var filterStr = JSON.stringify(groups);
75+
76+
let url = '/explore/?filters_for_load=' + filterStr;
77+
url = encodeURI(url);
78+
79+
window.location.href = url;
80+
});
81+
4282
$(document).ready(function () {
4383
$('.collex-panel').removeClass('hidden');
84+
85+
$('.collection-explore').each(function() {
86+
var collection_id = $(this).attr('data-collex-id');
87+
if (collection_id == "10.7937/K9/TCIA.2015.1BUVFJR7")
88+
{
89+
$(this).html('<a role="button">' +
90+
'LIDC-IDRI, </a>' +
91+
'<span class="gray-out-text"">*Lung Phantom, QIN LUNG CT, RIDER Lung CT</span>');
92+
}
93+
else if (collection_id == "10.7937/TCIA.2019.wgllssg1")
94+
{
95+
$(this).html('<a role="button">' +
96+
'TCGA-BRCA, ISPY1, </a>' +
97+
'<span class="gray-out-text"">*BREAST-DIAGNOSIS, Breast-MRI-NACT-Pilot</span>');
98+
}
99+
});
100+
101+
var table_bottom = $('#collections-table_wrapper').find('.bottom');
102+
table_bottom.html('<span class="gray-out-text">' +
103+
'* Gray text collections are part of the analysis, ' +
104+
'but not currently hosted by IDC.');
44105
});
45106
});

static/js/image_search.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1723,12 +1723,30 @@ require([
17231723
contentType: 'application/x-www-form-urlencoded',
17241724
success: function (data) {
17251725
var isFiltered = Boolean($('#search_def p').length>0);
1726-
if(is_cohort) {
1726+
if (is_cohort) {
17271727
if(data.total > 65000) {
17281728
$('.manifest-size-warning').show();
17291729
} else {
17301730
$('.manifest-size-warning').hide();
17311731
}
1732+
1733+
var select_box_div = $('#file-part-select-box');
1734+
var select_box = select_box_div.find('select');
1735+
if (data.file_parts_count > 1)
1736+
{
1737+
select_box_div.show();
1738+
for (let i = 0; i < data.file_parts_count; ++i)
1739+
{
1740+
select_box.append($('<option/>', {
1741+
value: i,
1742+
text : "File Part " + (i + 1)
1743+
}));
1744+
}
1745+
}
1746+
else
1747+
{
1748+
select_box_div.hide();
1749+
}
17321750
} else {
17331751
if (isFiltered && data.total > 0){
17341752
$('#save-cohort-btn').prop('disabled','');
@@ -2945,6 +2963,7 @@ require([
29452963
// Do not disable checkboxes for export manifest dialog
29462964
$('.field-checkbox').removeAttr('disabled');
29472965
$('.column-checkbox').removeAttr('disabled');
2966+
$('#include-header-checkbox').removeAttr('disabled');
29482967

29492968
$('div.ui-slider').siblings('button').prop('disabled', 'disabled');
29502969
$('input#hide-zeros').prop("disabled", "");
@@ -2977,7 +2996,6 @@ require([
29772996
}
29782997

29792998
$(document).ready(function () {
2980-
29812999
// $('#proj_table').DataTable();
29823000
// window.filterObj.collection_id = window.tcgaColls;
29833001
window.selItems = new Object();

templates/cohorts/cohort_details.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ <h3 class="pull-left" role="heading" aria-level="1">Cohort Name: {{ cohort.name
4646
<button id="export-manifest" class="btn btn-special pull-right" data-toggle="modal"
4747
data-target="#export-manifest-modal"> Export Cohort Manifest
4848
</button>
49-
<!--
50-
<a id="download-manifest" class="btn btn-default pull-right" title="Download this cohort's manifest." href="{% url 'cohort_manifest' cohort.id %}">
51-
Download Cohort Manifest
52-
</a>
53-
-->
5449
</div>
5550
</div>
5651
</div>
@@ -68,8 +63,8 @@ <h3 class="pull-left" role="heading" aria-level="1">Cohort Name: {{ cohort.name
6863
</script>
6964

7065
{% with is_cohort=True %}
71-
{% include "idc/explore_data_core.html" %}
7266
{% include "cohorts/export-manifest-modal.html" %}
67+
{% include "idc/explore_data_core.html" %}
7368
{% endwith %}
7469

7570
<!-- Download In Progress Modal -->

templates/cohorts/export-manifest-modal.html

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -112,20 +112,43 @@ <h4 class="modal-title" id="exportManifestModal">Export Cohort Manifest</h4>
112112
<span class="value">GCS URL </span>
113113
</label></li>
114114
</div>
115-
</div>
116-
</div>
115+
<br>
116+
117+
<!-- Export Option -->
118+
<div class="export-option">
119+
<span class="value"><input type="radio" name="colorRadio" value="file-manifest" checked> Files</span>
120+
<span style="margin-left:10px" class="value"><input type="radio" name="colorRadio" value="bq-manifest"> BigQuery</span>
121+
</div>
122+
<br>
117123

118-
<div class="modal-footer">
119-
{% csrf_token %}
120-
<a id="download-csv" class="btn btn-primary" title="Download this cohort's manifest in CSV format.">
121-
Download CSV
122-
</a>
123-
<a id="download-tsv" class="btn btn-primary " title="Download this cohort's manifest in TSV format.">
124-
Download TSV
125-
</a>
126-
<a id="download-json" class="btn btn-primary " title="Download this cohort's manifest in JSON format.">
127-
Download JSON
128-
</a>
124+
<div id="bq-manifest">
125+
<a id="get-bq-table" class="btn btn-primary" title="Get BQ Table of this manifest.">
126+
Get BQ Table
127+
</a>
128+
</div>
129+
<div id="file-manifest">
130+
<div id="file-part-select-box">
131+
<select class="form-control">
132+
</select>
133+
<br>
134+
</div>
135+
136+
<span><input id="include-header-checkbox" type="checkbox" checked> Include header fields (CSV and TSV only)</span>
137+
<br>
138+
<br>
139+
140+
{% csrf_token %}
141+
<a id="download-csv" class="btn btn-primary" title="Download this cohort's manifest in CSV format.">
142+
Download CSV
143+
</a>
144+
<a id="download-tsv" class="btn btn-primary " title="Download this cohort's manifest in TSV format.">
145+
Download TSV
146+
</a>
147+
<a id="download-json" class="btn btn-primary " title="Download this cohort's manifest in JSON format.">
148+
Download JSON
149+
</a>
150+
</div>
151+
</div>
129152
</div>
130153
</form>
131154
</div>

templates/collections/collections_list.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ <h3 class="pull-left">Collections</h3>
3131
<th class="subject-col">Subject Count</th>
3232
<th class="locations-col">Locations</th>
3333
<th class="supporting-data-col">Supporting Data</th>
34+
3435
</thead>
3536
<colgroup>
3637
<col style="width: 3%">
@@ -41,17 +42,20 @@ <h3 class="pull-left">Collections</h3>
4142
<col style="width: 8%">
4243
<col style="width: 9%">
4344
<col style="width: 9%">
45+
4446
</colgroup>
4547
<tbody>
4648
{% for collection in active_collections %}
4749
<tr>
4850
<td class="details-control" data-doi="{{ collection.doi }}" data-collex-id="{{ collection.collection_id }}" title="Click to display collection description."><i class="fa fa-plus-circle show-button"> </i><i class="fa fa-minus-circle hide-button"> </i></td>
49-
<td>
51+
<td class="collection-explore" data-collex-id="{{ collection.collection_id }}">
52+
<a role="button" >
5053
{% if collection.get_collection_type == 'Analysis' %}
5154
{{ collection.collections }}
5255
{% else %}
5356
{{ collection.tcia_collection_id }}
5457
{% endif %}
58+
</a>
5559
</td>
5660
<td>{{ collection.get_collection_type }}</td>
5761
<td>{{ collection.cancer_type }}</td>

templates/idc/landing.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122
</div>
123123
</div>
124124
{% include 'share/site_footer.html' %}
125+
125126
</div>
126127
{% endblock %}
127128

0 commit comments

Comments
 (0)