Skip to content

Commit

Permalink
Merge pull request #444 from epigen-UCSD/snApp
Browse files Browse the repository at this point in the history
Sn app
  • Loading branch information
brandonGonzalez01 authored May 4, 2020
2 parents ef49bb1 + 58e1463 commit 4c61be7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
9 changes: 3 additions & 6 deletions singlecell_app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def AllSingleCellData(request):

seqs_queryset = SeqInfo.objects.filter(libraryinfo__experiment_type__in=SINGLE_CELL_EXPS).select_related('libraryinfo','libraryinfo__sampleinfo','libraryinfo__sampleinfo__group').order_by(
'-date_submitted_for_sequencing').values('id', 'seq_id', 'libraryinfo__experiment_type', 'read_type',
'libraryinfo__sampleinfo__species', 'date_submitted_for_sequencing','libraryinfo__sampleinfo__group')
'libraryinfo__sampleinfo__species', 'date_submitted_for_sequencing','libraryinfo__sampleinfo__group','libraryinfo__sampleinfo__sample_id')

data = list(seqs_queryset)
build_seq_list(data)
Expand All @@ -93,7 +93,7 @@ def UserSingleCellData(request):

seqs_queryset = SeqInfo.objects.filter(libraryinfo__experiment_type__in=SINGLE_CELL_EXPS, team_member_initails=request.user).select_related('libraryinfo','libraryinfo__sampleinfo__group', 'libraryinfo__sampleinfo').order_by(
'-date_submitted_for_sequencing').values('id', 'seq_id', 'libraryinfo__experiment_type', 'read_type',
'libraryinfo__sampleinfo__species', 'date_submitted_for_sequencing','libraryinfo__sampleinfo__group')
'libraryinfo__sampleinfo__species', 'date_submitted_for_sequencing','libraryinfo__sampleinfo__group','libraryinfo__sampleinfo__sample_id')

data = list(seqs_queryset)
build_seq_list(data)
Expand Down Expand Up @@ -792,7 +792,7 @@ def generate_link(seq, expt_type):
# check if symbolic link is present
if(seq not in (basenames)):
# Do symbolic linking
parent_dir = settings.TENX_DIR if expt_type == "10x_ATAC" else settings.SCRNA_DIR
parent_dir = settings.TENX_DIR if expt_type == "10xATAC" else settings.SCRNA_DIR
output_dir = 'outs'
to_link_dir = os.path.join(parent_dir, seq, output_dir)

Expand Down Expand Up @@ -827,9 +827,7 @@ def insert_link(filename, seq, expt_type):
#magic numbers, where we will insert link in web_summary.html
TENXATAC_LINE = 10
SCRNA_LINE = 1430
print('inserting link for ')
line_to_insert_at = TENXATAC_LINE if expt_type == '10xATAC' else SCRNA_LINE

newdata = "" # will hold the old html + an inserted link at specified line
link = generate_link(seq, expt_type) #generate a link to the output folder
if(link == -1):
Expand Down Expand Up @@ -873,7 +871,6 @@ def view_websummary(request, seq_id):
print('reading: ',path)
file = open(path)
data = file.read()
print('link in data? :',LINK_CLASS_NAME not in data)
if(LINK_CLASS_NAME not in data):
#print('in tenxoutput2() for singlecell, adding link to file')
file.close()
Expand Down
34 changes: 18 additions & 16 deletions static/js/epigen.js
Original file line number Diff line number Diff line change
Expand Up @@ -1553,7 +1553,7 @@ $(document).ready(function () {
var singlecellurl = $('#datatable-all-sc').attr("data-href");
$('#datatable-all-sc').DataTable({
//dom: 'lBfrtip',
"order": [[3, "desc"], [0, "asc"]],
"order": [[4, "desc"], [0, "asc"]],
"aLengthMenu": [[20, 50, 75, -1], [20, 50, 75, "All"]],
"iDisplayLength": 20,
"processing": true,
Expand All @@ -1564,6 +1564,7 @@ $(document).ready(function () {
},
"columns": [
{ data: "seq_id" },
{ data: "libraryinfo__sampleinfo__sample_id" },
{ data: "libraryinfo__experiment_type" },
{ data: "species" },
{ data: "last_modified" },
Expand All @@ -1584,7 +1585,7 @@ $(document).ready(function () {
},
// 10x pipeline check
{
"targets": 5,
"targets": 6,
"render": function (data, type, row) {
var status = data;
var seq = row['seq_id'];
Expand All @@ -1603,7 +1604,7 @@ $(document).ready(function () {
},
{
//cooladmin status
"targets": 6,
"targets": 7,
"render": function (data, type, row) {
var status = data;
var seq_id = row['seq_id'];
Expand Down Expand Up @@ -1632,7 +1633,7 @@ $(document).ready(function () {
},
},
{
"targets": 7,
"targets": 8,
"render": function (data, type, row) {
var seq_id = row['seq_id']
if (row['libraryinfo__experiment_type'] !== "10xATAC" || row['10x_status'] === "Yes") {
Expand All @@ -1647,7 +1648,7 @@ $(document).ready(function () {
//user sequences
var singlecellurl_user = $('#datatable-user-sc').attr("data-href");
$('#datatable-user-sc').DataTable({
"order": [[3, "desc"], [0, "asc"]],
"order": [[4, "desc"], [0, "asc"]],
//dom: 'lBfrtip',
"aLengthMenu": [[20, 50, 75, -1], [20, 50, 75, "All"]],
"iDisplayLength": 20,
Expand All @@ -1659,6 +1660,7 @@ $(document).ready(function () {
},
"columns": [
{ data: "seq_id" },
{ data: "libraryinfo__sampleinfo__sample_id" },
{ data: "libraryinfo__experiment_type" },
{ data: "species" },
{ data: "last_modified" },
Expand All @@ -1679,7 +1681,7 @@ $(document).ready(function () {
},
// 10x pipeline check
{
"targets": 5,
"targets": 6,
"render": function (data, type, row) {
var status = data;
var seq = row['seq_id'];
Expand All @@ -1698,7 +1700,7 @@ $(document).ready(function () {
},
{
//cooladmin status
"targets": 6,
"targets": 7,
"render": function (data, type, row) {
var status = data;
var seq_id = row['seq_id'];
Expand Down Expand Up @@ -1727,7 +1729,7 @@ $(document).ready(function () {
},
},
{//cooladmin edit button- links to edit page
"targets": 7,
"targets": 8,
"render": function (data, type, row) {
var seq_id = row['seq_id']
if (row['libraryinfo__experiment_type'] !== "10xATAC" || row['10x_status'] === "Yes") {
Expand All @@ -1749,7 +1751,7 @@ $(document).ready(function () {
//user sequences
var singlecellurl_user = $('#datatable-collab-sc').attr("data-href");
$('#datatable-collab-sc').DataTable({
"order": [[3, "desc"], [0, "asc"]],
"order": [[4, "desc"], [0, "asc"]],
//dom: 'lBfrtip',
"aLengthMenu": [[20, 50, 75, -1], [20, 50, 75, "All"]],
"iDisplayLength": 20,
Expand All @@ -1771,13 +1773,13 @@ $(document).ready(function () {
],
"deferRender": true,
"columnDefs": [
{
"targets": 0,
"render": function (data, type, row) {
var itemID = row["id"];
return '<a href="/metadata/seq/' + itemID + '">' + data + '</a>';
}
},
// {
// "targets": 0,
// "render": function (data, type, row) {
// var itemID = row["id"];
// return '<a href="/metadata/seq/' + itemID + '">' + data + '</a>';
// }
// },
// 10x pipeline check
{
"targets": 6,
Expand Down
1 change: 1 addition & 0 deletions templates/singlecell_app/myseqs.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<thead>
<tr>
<th scope="col">Sequence</th>
<th scope="col">Sample Info</th>
<th scope="col">Experiment Type</th>
<th scope="col">Species</th>
<th scope="col">Last Modified</th>
Expand Down

0 comments on commit 4c61be7

Please sign in to comment.