-
Notifications
You must be signed in to change notification settings - Fork 29
/
index.html
1118 lines (1035 loc) · 87.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en" ng-app="sraExplorerApp">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="An experimental interface for exploring the Sequence Read Archive">
<meta name="author" content="Phil Ewels">
<title>SRA Explorer</title>
<!-- Framework CSS -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css">
<!-- SRA-explorer styles -->
<style type="text/css">
/* Core structural setup */
body {
padding-top: 50px;
}
/* Styles for little clear button on search fields */
.form-control-clear, .form-control-clear:hover, .form-control-clear:focus, .form-control-clear:active {
pointer-events: auto;
text-decoration: none;
cursor: pointer;
color: #999;
z-index: 4;
}
.form-control-clear:hover, .form-control-clear:focus, .form-control-clear:active {
color: #666;
}
/* Make button links have proper styling */
a[ng-click]{
cursor: pointer;
}
/* Page Header */
.jumbotron {
margin-top: 30px;
}
.jumbotron h1 {
margin-top: 0;
}
.jumbotron h1 a {
color: #333;
text-decoration: none;
}
/* Saved datasets */
#savedDatasets pre {
overflow-x: auto;
}
#savedDatasets pre code {
font-size: 10px;
white-space: pre;
}
/* Seqera Platform stuff */
#fullSeqeraPlatform_table_wrapper {
overflow: auto;
width: 100%;
max-height: 300px;
}
#seqera-icon {
height: 1.6rem;
width: 1.6rem;
margin: 0 0.3rem -0.3rem 0;
filter: saturate(0) brightness(0);
opacity: 0.3;
transform: 300ms;
}
.active #seqera-icon {
filter: saturate(1) brightness(1);
opacity: 1;
}
</style>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body ng-controller="searchCtrl">
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<a class="navbar-brand" href="#" ng-click="returnToHomeButton()">SRA-Explorer</a>
<a href="#" class="btn navbar-btn" style="float:right;" ng-class="savedResults.length == 0 ? 'disabled btn-default' : 'btn-primary'" ng-click="checkoutButton()"><span class="glyphicon glyphicon-shopping-cart"></span> <span ng-bind="savedResults.length"></span> saved datasets</a>
</div>
</div>
<div class="container">
<div class="jumbotron">
<h1><a href="#" ng-click="returnToHomeButton()">SRA Explorer</a></h1>
<p>This tool aims to make datasets within the Sequence Read Archive more accessible.</p>
<form class="form-horizontal" role="search">
<div class="form-group form-group-lg">
<label class="col-sm-2 control-label" for="searchText">Search for:</label>
<div class="col-sm-10">
<div class="input-group">
<div class="has-feedback has-clear">
<input ng-model="searchText" id="searchText" type="text" class="form-control" placeholder="Enter accession number" required>
<a class="glyphicon glyphicon-remove-sign form-control-feedback form-control-clear" ng-click="searchText = ''" ng-show="searchText.length"></a>
</div>
<div class="input-group-btn">
<button ng_click="search()" class="btn btn-default btn-lg" type="submit"><span class="glyphicon glyphicon-search"></span></button>
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="maxResults">Max Results</label>
<div class="col-sm-2">
<input type="number" max="500" class="form-control" id="maxResults" ng-model="maxResults" value="100" required>
</div>
<label class="col-sm-2 control-label" for="retstart">Start At Record</label>
<div class="col-sm-2">
<input type="number" class="form-control" id="retstart" ng-model="retstart" value="0" required>
</div>
</div>
<span id="helpBlock" class="help-block">
Need inspiration? Try
<code ng-click="searchText='GSE30567'; search()" style="cursor:pointer;">GSE30567</code>,
<code ng-click="searchText='SRP043510'; search()" style="cursor:pointer;">SRP043510</code>,
<code ng-click="searchText='PRJEB8073'; search()" style="cursor:pointer;">PRJEB8073</code>,
<code ng-click="searchText='ERP009109'; search()" style="cursor:pointer;">ERP009109</code> or
<code ng-click="searchText='human liver miRNA'; search()" style="cursor:pointer;">human liver miRNA</code>.
</span>
</form>
</div>
<div class="alert alert-info" ng-show="savedResults.length > 0 && results.length == 0 && !showSaved">
You have {{ savedResults.length }} datasets in your collection.
<a href="#" ng-click="checkoutButton()">View saved datasets</a>.
</div>
<p ng-show="loadingSpinner" class="text-center"><span class="glyphicon glyphicon-refresh fa-spin"></span> Loading..</p>
<div ng-show="results.length > 0">
<hr>
<div class="alert alert-info">
Select relevant datasets and click <em>add to collection</em>.
When you're finished, view all saved datasets with the button in the top right of the
page, where you can copy the SRA URLs.
</div>
<p>Showing <span ng-bind="filteredResults.length" class="badge"></span> results.</p>
<button class="pull-right btn btn-primary" ng-class="{disabled: selectedItems == 0}" ng-click="saveDatasets()">Add <span ng-bind="selectedItems">0</span> to collection</button>
<form class="form-inline" role="search">
<div class="form-group">
<label for="filterText">Filter results:</label>
<div class="input-group">
<div class="form-group has-feedback has-clear">
<input ng-model="filterText" id="filterText" type="text" class="form-control" placeholder="Enter search term">
<a class="glyphicon glyphicon-remove-sign form-control-feedback form-control-clear" ng-click="filterText = ''" ng-show="filterText.length"></a>
</div>
<div class="input-group-btn">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">All Fields <span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right">
<li class="active"><a href="#">All Fields</a></li>
<li><a href="#">Title</a></li>
<li><a href="#">Accession</a></li>
<li><a href="#">Instrument</a></li>
</ul>
</div>
</div>
</div>
</form>
<hr>
<div class="table-responsive"><table class="table table-striped table-hover">
<thead>
<tr>
<th><input type="checkbox" ng-model="selectAll" ng-click="checkAll()"></th>
<th><a ng-click="sortType = 'title'; sortReverse = !sortReverse">
Title
<span ng-show="sortType == 'title' && !sortReverse" class="fa fa-caret-down"></span>
<span ng-show="sortType == 'title' && sortReverse" class="fa fa-caret-up"></span>
</a></th>
<th><a ng-click="sortType = 'accession'; sortReverse = !sortReverse">
Accession
<span ng-show="sortType == 'accession' && !sortReverse" class="fa fa-caret-down"></span>
<span ng-show="sortType == 'accession' && sortReverse" class="fa fa-caret-up"></span>
</a></th>
<th><a ng-click="sortType = 'platform'; sortReverse = !sortReverse">
Instrument
<span ng-show="sortType == 'platform' && !sortReverse" class="fa fa-caret-down"></span>
<span ng-show="sortType == 'platform' && sortReverse" class="fa fa-caret-up"></span>
</a></th>
<th><a ng-click="sortType = 'total_bases'; sortReverse = !sortReverse">
Total Bases (Mb)
<span ng-show="sortType == 'total_bases' && !sortReverse" class="fa fa-caret-down"></span>
<span ng-show="sortType == 'total_bases' && sortReverse" class="fa fa-caret-up"></span>
</a></th>
<th><a ng-click="sortType = 'createdate'; sortReverse = !sortReverse">
Date Created
<span ng-show="sortType == 'createdate' && !sortReverse" class="fa fa-caret-down"></span>
<span ng-show="sortType == 'createdate' && sortReverse" class="fa fa-caret-up"></span>
</a></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="x in results | orderBy:sortType:sortReverse | filter:filterText as filteredResults" ng-click="rowClicked(x)" ng-class="{ success: x.selected }">
<td><input type="checkbox" ng-checked="x.selected" ng-click="toggleRow($event, x)"></td>
<td>{{ x.title }}</td>
<td><a href="https://www.ncbi.nlm.nih.gov/sra/?term={{ x.accession }}" target="_blank">{{ x.accession }}</a></td>
<td>{{ x.platform }}</td>
<td>{{ x.total_bases }}</td>
<td>{{ x.createdate | date:'dd MMM yyyy' }}</td>
</tr>
</tbody>
</table></div>
</div>
<!-- Saved datasets -->
<div id="savedDatasets" ng-show="showSaved" class="animate-show">
<h2>
<span ng-bind="savedResults.length"></span> Saved Datasets
<button ng-show="savedResults.length > 0" ng-click="returnSaved()" class="btn btn-default" style="float:right;">Remove all from collection and send to search results</button>
</h2>
<div>
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li class="active"><a href="#fastq_tabcontent" aria-controls="fastq_tabcontent" role="tab" data-toggle="tab">FastQ Downloads</a></li>
<li><a href="#sra_tabcontent" aria-controls="sra_tabcontent" role="tab" data-toggle="tab">SRA Downloads</a></li>
<li><a href="#full_metadata_tabcontent" aria-controls="full_metadata_tabcontent" role="tab" data-toggle="tab">Full Metadata</a></li>
<li><a href="#seqera_platform_tabcontent" aria-controls="seqera_platform_tabcontent" role="tab" data-toggle="tab">
<svg id="seqera-icon" width="250" height="250" viewBox="0 0 250 250" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_934_9493)">
<path d="M212.237 129.43L212.587 129.57L212.937 129.71L213.267 129.87L213.597 130.049L213.917 130.229L214.238 130.429L214.538 130.659L214.828 130.879L215.098 131.129L215.378 131.379L215.638 131.659L215.878 131.929L216.118 132.229L216.328 132.529L216.538 132.849L216.719 133.159L216.889 133.499L217.049 133.829L217.189 134.169L217.329 134.519L217.429 134.879L217.529 135.229L217.599 135.609L217.669 135.969L217.709 136.349L217.729 136.709L217.739 137.079L217.729 137.459L217.709 137.829L217.669 138.199L217.599 138.569L217.529 138.929L217.429 139.299L217.329 139.649L217.189 140.009L217.049 140.349L216.889 140.679L216.719 141.009L216.538 141.329L216.328 141.649L216.118 141.949L215.878 142.229L215.638 142.518L215.378 142.778L215.098 143.048L214.828 143.298L214.538 143.518L214.238 143.728L213.917 143.948L213.597 144.128L213.267 144.308L212.937 144.458L212.587 144.608L212.237 144.728L211.887 144.848L211.527 144.928L211.167 145.018L210.786 145.068L210.426 145.108L210.046 145.148H209.986L210.366 145.138L211.046 145.108L211.727 145.068L212.407 145.008L213.077 144.918L213.757 144.818L214.428 144.708L215.098 144.568L215.758 144.418L216.428 144.248L217.089 144.058L217.739 143.848L218.379 143.628L219.019 143.388L219.65 143.128L220.28 142.858L220.9 142.568L221.51 142.259L222.11 141.939L222.701 141.599L223.281 141.239L223.861 140.879L224.421 140.499L224.981 140.089L225.522 139.669L226.052 139.249L226.572 138.799L227.082 138.339L227.572 137.879L228.063 137.389L228.533 136.899L228.983 136.389L229.423 135.869L229.853 135.339L230.273 134.789L230.674 134.239L231.054 133.679L231.434 133.099L231.784 132.519L232.124 131.919L232.454 131.319L232.754 130.719L233.044 130.099L233.314 129.47L233.575 128.84L233.815 128.2L234.045 127.55L234.245 126.9L234.435 126.24L234.605 125.58L234.755 124.92L234.895 124.24L235.015 123.57L235.115 122.9L235.185 122.22L235.255 121.54L235.305 120.85L235.325 120.17L235.335 119.49L235.325 118.81L235.305 118.12L235.255 117.441L235.185 116.761L235.115 116.091L235.015 115.411L234.895 114.731L234.755 114.071L234.605 113.401L234.475 112.891H210.156L209.676 112.901H152.155L211.817 129.31L212.237 129.43Z" fill="#160F26"/>
<path d="M249.96 135.379L249.91 134.519L249.85 133.669L249.77 132.809L249.67 131.959L249.56 131.12L249.42 130.27L249.26 129.43L249.1 128.59L248.91 127.76L248.7 126.93L248.479 126.1L248.229 125.28L247.969 124.47L247.699 123.65L247.399 122.85L247.089 122.06L246.759 121.26L246.419 120.48L246.059 119.7L245.688 118.931L245.288 118.181L244.878 117.421L244.448 116.681L244.008 115.941L243.558 115.221L243.078 114.501L242.597 113.801L242.097 113.111L241.927 112.891H234.474L234.604 113.401L234.755 114.071L234.895 114.731L235.015 115.411L235.115 116.091L235.185 116.761L235.255 117.441L235.305 118.121L235.325 118.811L235.335 119.49L235.325 120.17L235.305 120.85L235.255 121.54L235.185 122.22L235.115 122.9L235.015 123.57L234.895 124.24L234.755 124.92L234.604 125.58L234.434 126.24L234.244 126.9L234.044 127.55L233.814 128.2L233.574 128.84L233.314 129.47L233.044 130.1L232.754 130.72L232.454 131.32L232.124 131.919L231.783 132.519L231.433 133.099L231.053 133.679L230.673 134.239L230.273 134.789L229.853 135.339L229.423 135.869L228.982 136.389L228.532 136.899L228.062 137.389L227.572 137.879L227.082 138.339L226.572 138.799L226.051 139.249L225.521 139.669L224.981 140.089L224.421 140.499L223.861 140.879L223.28 141.239L222.7 141.599L222.11 141.939L221.51 142.259L220.9 142.569L220.279 142.859L219.649 143.129L219.019 143.389L218.379 143.629L217.738 143.849L217.088 144.059L216.428 144.248L215.758 144.418L215.097 144.568L214.427 144.708L213.757 144.818L213.077 144.918L212.406 145.008L211.726 145.068L211.046 145.108L210.366 145.138L209.675 145.148H0V177.406H209.675L210.536 177.396L211.386 177.376L212.246 177.326L213.097 177.256L213.947 177.176L214.797 177.086L215.648 176.956L216.488 176.826L217.328 176.676L218.169 176.496L219.009 176.306L219.829 176.106L220.659 175.876L221.49 175.636L222.3 175.386L223.11 175.096L223.911 174.806L224.711 174.496L225.501 174.176L226.281 173.836L227.062 173.466L227.832 173.086L228.592 172.696L229.343 172.286L230.083 171.866L230.823 171.416L231.533 170.966L232.254 170.496L232.964 170.006L233.654 169.506L234.334 168.987L235.005 168.457L235.675 167.907L236.325 167.347L236.955 166.787L237.576 166.197L238.186 165.597L238.786 164.987L239.366 164.357L239.946 163.727L240.507 163.077L241.047 162.417L241.577 161.747L242.097 161.057L242.597 160.367L243.078 159.667L243.558 158.947L244.008 158.227L244.448 157.487L244.878 156.747L245.288 155.998L245.688 155.238L246.059 154.468L246.419 153.698L246.759 152.908L247.089 152.118L247.399 151.328L247.699 150.518L247.969 149.708L248.229 148.898L248.479 148.068L248.7 147.248L248.91 146.418L249.1 145.578L249.26 144.748L249.42 143.909L249.56 143.059L249.67 142.209L249.77 141.359L249.85 140.509L249.91 139.649L249.96 138.799L249.99 137.949L250 137.089L249.99 136.229L249.96 135.379Z" fill="#FA6863"/>
<path d="M37.7624 120.54L37.4123 120.41L37.0621 120.27L36.732 120.11L36.3919 119.93L36.0818 119.74L35.7617 119.54L35.4616 119.321L35.1714 119.091L34.8913 118.841L34.6212 118.591L34.3612 118.321L34.1211 118.041L33.881 117.741L33.6709 117.441L33.4608 117.131L33.2808 116.821L33.1107 116.481L32.9406 116.141L32.8106 115.811L32.6705 115.461L32.5705 115.091L32.4705 114.741L32.3904 114.371L32.3304 114.011L32.2904 113.631L32.2704 113.271L32.2604 112.891L32.2704 112.521L32.2904 112.141L32.3304 111.781L32.3904 111.411L32.4705 111.041L32.5705 110.681L32.6705 110.331L32.8106 109.971L32.9406 109.631L33.1107 109.291L33.2808 108.971L33.4608 108.641L33.6709 108.331L33.881 108.031L34.1211 107.741L34.3612 107.461L34.6212 107.191L34.8913 106.932L35.1714 106.682L35.4616 106.462L35.7617 106.242L36.0818 106.032L36.3919 105.842L36.732 105.672L37.0621 105.522L37.4123 105.372L37.7624 105.242L38.1125 105.132L38.4726 105.042L38.8328 104.962L39.2129 104.912L39.573 104.872L39.9432 104.832H40.0132H39.6331L38.9528 104.862L38.2726 104.912L37.5923 104.972L36.9221 105.052L36.2418 105.152L35.5616 105.272L34.9013 105.402L34.2311 105.562L33.5709 105.732L32.9106 105.922L32.2604 106.132L31.6202 106.352L30.9699 106.582L30.3497 106.842L29.7195 107.121L29.0993 107.411L28.489 107.721L27.8788 108.041L27.2986 108.371L26.7184 108.731L26.1382 109.101L25.568 109.481L25.0178 109.891L24.4676 110.301L23.9474 110.731L23.4272 111.171L22.917 111.631L22.4269 112.101L21.9367 112.581L21.4665 113.081L21.0163 113.581L20.5662 114.101L20.146 114.641L19.7159 115.181L19.3257 115.731L18.9356 116.301L18.5655 116.871L18.2153 117.461L17.8752 118.051L17.5451 118.661L17.245 119.261L16.9549 119.88L16.6848 120.51L16.4247 121.14L16.1846 121.78L15.9545 122.43L15.7545 123.08L15.5644 123.74L15.3943 124.39L15.2443 125.06L15.1042 125.73L14.9842 126.41L14.8841 127.08L14.8141 127.76L14.7441 128.43L14.6941 129.12L14.6741 129.8L14.6641 130.48L14.6741 131.17L14.6941 131.85L14.7441 132.529L14.8141 133.209L14.8841 133.889L14.9842 134.569L15.1042 135.239L15.2443 135.909L15.3943 136.569L15.5244 137.089H39.8431L40.3233 137.079H97.844L38.1825 120.67L37.7624 120.54Z" fill="#160F26"/>
<path d="M0.0400144 114.601L0.0800288 115.461L0.150054 116.311L0.230083 117.161L0.330119 118.01L0.440158 118.86L0.580209 119.7L0.730263 120.55L0.900324 121.39L1.09039 122.22L1.30047 123.05L1.52055 123.88L1.77064 124.7L2.03073 125.51L2.30083 126.32L2.60094 127.13L2.91105 127.92L3.24117 128.72L3.58129 129.5L3.94142 130.279L4.31155 131.039L4.7117 131.799L5.12184 132.559L5.552 133.299L5.99216 134.029L6.44232 134.749L6.91249 135.469L7.40267 136.179L7.90285 136.869L8.07291 137.089H15.5256L15.3955 136.569L15.2455 135.909L15.1054 135.239L14.9854 134.569L14.8854 133.889L14.8153 133.209L14.7453 132.529L14.6953 131.849L14.6753 131.169L14.6653 130.479L14.6753 129.8L14.6953 129.12L14.7453 128.43L14.8153 127.76L14.8854 127.08L14.9854 126.41L15.1054 125.73L15.2455 125.06L15.3955 124.39L15.5656 123.74L15.7557 123.08L15.9557 122.43L16.1858 121.78L16.4259 121.14L16.686 120.51L16.9561 119.88L17.2462 119.26L17.5463 118.66L17.8764 118.05L18.2166 117.461L18.5667 116.871L18.9368 116.301L19.327 115.731L19.7171 115.181L20.1473 114.641L20.5674 114.101L21.0176 113.581L21.4677 113.081L21.9379 112.581L22.4281 112.101L22.9183 111.631L23.4284 111.171L23.9486 110.731L24.4688 110.301L25.019 109.891L25.5692 109.481L26.1394 109.101L26.7196 108.731L27.2998 108.371L27.88 108.041L28.4903 107.721L29.1005 107.411L29.7207 107.121L30.3509 106.841L30.9711 106.581L31.6214 106.351L32.2616 106.131L32.9118 105.921L33.5721 105.731L34.2323 105.561L34.9026 105.401L35.5628 105.271L36.243 105.151L36.9233 105.051L37.5935 104.972L38.2738 104.912L38.954 104.862L39.6343 104.832L40.3245 104.822H250V72.5741H40.3245L39.4642 72.5841L38.6139 72.6041L37.7536 72.6541L36.9033 72.7141L36.043 72.7941L35.2027 72.8941L34.3524 73.0141L33.5121 73.1441L32.6718 73.304L31.8215 73.474L30.9912 73.664L30.1609 73.874L29.3406 74.094L28.5103 74.344L27.7 74.5939L26.8897 74.8739L26.0894 75.1639L25.2891 75.4839L24.4988 75.8038L23.7185 76.1438L22.9383 76.5138L22.168 76.8938L21.4077 77.2737L20.6574 77.6937L19.9172 78.1137L19.1769 78.5536L18.4566 79.0136L17.7364 79.4835L17.0361 79.9735L16.3459 80.4735L15.6556 80.9834L14.9954 81.5134L14.3252 82.0633L13.6749 82.6233L13.0447 83.1932L12.4245 83.7832L11.8143 84.3731L11.214 84.9931L10.6238 85.623L10.0536 86.253L9.49342 86.903L8.95322 87.5629L8.42303 88.2328L7.90285 88.9128L7.40267 89.6127L6.91249 90.3127L6.44232 91.0226L5.99216 91.7526L5.552 92.4925L5.12184 93.2324L4.7117 93.9724L4.31155 94.7323L3.94142 95.5123L3.58129 96.2822L3.24117 97.0721L2.91105 97.8521L2.60094 98.652L2.30083 99.4519L2.03073 100.262L1.77064 101.082L1.52055 101.902L1.30047 102.732L1.09039 103.562L0.900324 104.402L0.730263 105.231L0.580209 106.071L0.440158 106.921L0.330119 107.771L0.230083 108.621L0.150054 109.471L0.0800288 110.321L0.0400144 111.171L0 112.031V112.891V113.751L0.0400144 114.601Z" fill="#F18046"/>
<path d="M37.7624 47.9758L37.4123 47.8358L37.0621 47.6858L36.722 47.5359L36.4019 47.3559L36.0718 47.1759L35.7617 46.9759L35.4616 46.7459L35.1614 46.5259L34.8813 46.276L34.6112 46.026L34.3612 45.746L34.1211 45.476L33.881 45.176L33.6609 44.8761L33.4608 44.5561L33.2708 44.2361L33.1007 43.9061L32.9306 43.5762L32.8006 43.2362L32.6705 42.8762L32.5605 42.5263L32.4705 42.1763L32.3904 41.7963L32.3304 41.4363L32.2804 41.0564L32.2704 40.6864L32.2604 40.3064L32.2704 39.9365L32.2804 39.5765L32.3304 39.2065L32.3904 38.8366L32.4705 38.4766L32.5605 38.1066L32.6705 37.7466L32.8006 37.3967L32.9306 37.0567L33.1007 36.7267L33.2708 36.3868L33.4608 36.0768L33.6609 35.7568L33.881 35.4568L34.1211 35.1768L34.3612 34.8869L34.6112 34.6069L34.8813 34.3569L35.1614 34.1069L35.4616 33.887L35.7617 33.677L36.0718 33.457L36.4019 33.277L36.722 33.097L37.0621 32.937L37.4123 32.797L37.7624 32.677L38.1125 32.5571L38.4726 32.4571L38.8428 32.3871L39.2029 32.3271L39.573 32.2871L39.9532 32.2571H40.0732H39.6331L38.9528 32.2871L38.2726 32.3371L37.5923 32.3971L36.9221 32.4871L36.2418 32.5871L35.5616 32.697L34.9013 32.837L34.2311 32.987L33.5709 33.157L32.9106 33.347L32.2604 33.557L31.6202 33.777L30.9699 34.0169L30.3497 34.2669L29.7195 34.5469L29.0993 34.8369L28.489 35.1469L27.8788 35.4668L27.2986 35.7968L26.7084 36.1568L26.1382 36.5267L25.568 36.9067L25.0178 37.3167L24.4676 37.7266L23.9374 38.1566L23.4272 38.6066L22.917 39.0565L22.4169 39.5265L21.9367 40.0065L21.4665 40.5064L21.0163 41.0164L20.5662 41.5363L20.146 42.0663L19.7159 42.6163L19.3257 43.1662L18.9356 43.7262L18.5655 44.2961L18.2153 44.8861L17.8752 45.476L17.5451 46.086L17.245 46.6859L16.9549 47.3059L16.6848 47.9358L16.4247 48.5658L16.1846 49.2057L15.9545 49.8557L15.7545 50.5056L15.5644 51.1656L15.3943 51.8255L15.2343 52.4855L15.1042 53.1554L14.9842 53.8354L14.8841 54.5053L14.8041 55.1852L14.7441 55.8552L14.6941 56.5451L14.6741 57.2351L14.6641 57.915L14.6741 58.595L14.6941 59.2849L14.7441 59.9649L14.8041 60.6448L14.8841 61.3148L14.9842 61.9947L15.1042 62.6746L15.2343 63.3346L15.3943 64.0045L15.5644 64.6645L15.7545 65.3144L15.9545 65.9744L16.1846 66.6143L16.4247 67.2543L16.6848 67.8842L16.9549 68.5142L17.245 69.1341L17.5451 69.7441L17.7452 70.0941L17.7652 70.084L18.6055 69.6541L19.4458 69.2441L20.2961 68.8442L21.1564 68.4742L22.0167 68.0942L22.897 67.7542L23.7673 67.4343L24.6577 67.1043L25.548 66.8243L26.4483 66.5443L27.3486 66.2844L28.249 66.0344L29.1593 65.8044L30.0796 65.6044L30.9999 65.4244L31.9103 65.2444L32.8406 65.0945L33.7709 64.9545L34.7013 64.8345L35.6416 64.7345L36.572 64.6545L37.5123 64.5845L38.4326 64.5445L39.393 64.5245L40.3233 64.5045H97.844L38.1725 48.0958L37.7624 47.9758Z" fill="#160F26"/>
<path d="M209.676 217.743H210.366L211.046 217.703L211.727 217.663L212.407 217.603L213.087 217.513L213.767 217.413L214.438 217.303L215.108 217.163L215.768 217.013L216.438 216.843L217.089 216.653L217.739 216.443L218.389 216.223L219.029 215.983L219.65 215.723L220.28 215.453L220.9 215.163L221.51 214.853L222.12 214.533L222.711 214.193L223.291 213.833L223.861 213.463L224.431 213.083L224.991 212.683L225.532 212.263L226.062 211.843L226.582 211.393L227.082 210.933L227.582 210.473L228.063 209.983L228.533 209.493L228.993 208.984L229.433 208.464L229.863 207.934L230.283 207.384L230.674 206.834L231.064 206.274L231.434 205.694L231.784 205.114L232.124 204.514L232.454 203.914L232.764 203.304L233.054 202.694L233.314 202.064L233.585 201.424L233.815 200.794L234.045 200.144L234.255 199.494L234.435 198.834L234.615 198.174L234.765 197.514L234.895 196.835L235.015 196.165L235.115 195.495L235.195 194.805L235.265 194.135L235.305 193.445L235.335 192.765V192.085V191.405L235.305 190.715L235.265 190.035L235.195 189.355L235.115 188.685L235.015 188.005L234.895 187.325L234.765 186.665L234.615 185.995L234.435 185.335L234.255 184.685L234.045 184.026L233.815 183.376L233.585 182.746L233.314 182.116L233.054 181.486L232.764 180.866L232.454 180.256L232.254 179.886L232.234 179.896L231.394 180.326L230.553 180.736L229.703 181.136L228.843 181.516L227.973 181.876L227.102 182.226L226.232 182.546L225.342 182.866L224.441 183.166L223.551 183.436L222.661 183.696L221.74 183.946L220.84 184.166L219.92 184.376L218.999 184.565L218.079 184.735L217.159 184.885L216.228 185.025L215.298 185.145L214.368 185.245L213.427 185.325L212.487 185.385L211.547 185.435L210.616 185.465L209.676 185.475H152.155L211.817 201.884L212.237 202.014L212.587 202.144L212.937 202.284L213.267 202.444L213.597 202.624L213.917 202.814L214.238 203.014L214.538 203.234L214.828 203.464L215.098 203.714L215.378 203.964L215.638 204.234L215.878 204.514L216.118 204.814L216.328 205.114L216.538 205.424L216.719 205.734L216.889 206.074L217.049 206.414L217.189 206.744L217.329 207.094L217.429 207.464L217.529 207.814L217.599 208.184L217.669 208.544L217.709 208.924L217.729 209.284L217.739 209.663L217.729 210.033L217.709 210.413L217.669 210.773L217.599 211.143L217.529 211.513L217.429 211.873L217.329 212.223L217.189 212.583L217.049 212.923L216.889 213.263L216.719 213.583L216.538 213.913L216.328 214.223L216.118 214.523L215.878 214.813L215.638 215.093L215.378 215.363L215.098 215.623L214.828 215.873L214.538 216.093L214.238 216.313L213.917 216.523L213.597 216.713L213.267 216.883L212.937 217.033L212.587 217.183L212.237 217.313L211.887 217.423L211.527 217.513L211.167 217.593L210.786 217.643L210.426 217.683L210.046 217.723L209.676 217.733" fill="#160F26"/>
<path d="M249.96 207.963L249.92 207.113L249.86 206.264L249.77 205.404L249.68 204.554L249.56 203.714L249.42 202.864L249.27 202.024L249.1 201.184L248.91 200.344L248.7 199.524L248.479 198.694L248.239 197.864L247.979 197.064L247.699 196.244L247.399 195.444L247.099 194.654L246.769 193.855L246.419 193.075L246.069 192.295L245.688 191.525L245.288 190.775L244.888 190.015L244.458 189.275L244.008 188.535L243.558 187.815L243.088 187.095L242.597 186.395L242.097 185.705L241.577 185.015L241.057 184.355L240.507 183.685L239.946 183.045L239.376 182.405L238.786 181.785L238.196 181.166L237.576 180.576L236.955 179.986L236.325 179.416L235.675 178.856L235.015 178.306L234.975 178.276L234.034 178.846L233.204 179.316L232.344 179.786L232.234 179.846L232.454 180.256L232.764 180.866L233.054 181.486L233.314 182.115L233.584 182.745L233.814 183.375L234.044 184.025L234.254 184.685L234.434 185.335L234.614 185.995L234.765 186.665L234.895 187.325L235.015 188.005L235.115 188.685L235.195 189.355L235.265 190.035L235.305 190.715L235.335 191.405V192.085V192.765L235.305 193.445L235.265 194.134L235.195 194.804L235.115 195.494L235.015 196.164L234.895 196.834L234.765 197.514L234.614 198.174L234.434 198.834L234.254 199.494L234.044 200.144L233.814 200.794L233.584 201.424L233.314 202.064L233.054 202.694L232.764 203.304L232.454 203.914L232.124 204.514L231.783 205.114L231.433 205.694L231.063 206.274L230.673 206.833L230.283 207.383L229.863 207.933L229.433 208.463L228.992 208.983L228.532 209.493L228.062 209.983L227.582 210.473L227.082 210.933L226.582 211.393L226.061 211.843L225.531 212.263L224.991 212.683L224.431 213.083L223.861 213.463L223.29 213.833L222.71 214.193L222.12 214.533L221.51 214.853L220.9 215.163L220.279 215.453L219.649 215.723L219.029 215.983L218.389 216.223L217.738 216.443L217.088 216.653L216.438 216.843L215.768 217.013L215.107 217.163L214.437 217.303L213.767 217.413L213.087 217.513L212.406 217.603L211.726 217.663L211.046 217.703L210.366 217.743H209.675H0V250H209.675L210.536 249.99L211.386 249.97L212.246 249.92L213.097 249.85L213.957 249.78L214.807 249.68L215.658 249.55L216.498 249.42L217.338 249.27L218.179 249.09L219.009 248.9L219.839 248.7L220.659 248.48L221.49 248.23L222.3 247.98L223.11 247.69L223.921 247.4L224.721 247.09L225.511 246.77L226.291 246.43L227.072 246.06L227.832 245.68L228.602 245.29L229.343 244.88L230.093 244.46L230.823 244.02L231.543 243.551L232.264 243.091L232.964 242.601L233.654 242.091L234.344 241.581L235.015 241.051L235.675 240.501L236.325 239.941L236.955 239.381L237.576 238.791L238.196 238.191L238.786 237.581L239.376 236.951L239.946 236.321L240.507 235.671L241.057 235.011L241.577 234.341L242.097 233.661L242.597 232.961L243.088 232.261L243.558 231.542L244.008 230.822L244.458 230.082L244.888 229.342L245.288 228.592L245.688 227.832L246.069 227.062L246.419 226.292L246.769 225.502L247.099 224.712L247.399 223.922L247.699 223.112L247.979 222.302L248.239 221.482L248.479 220.662L248.7 219.842L248.91 219.003L249.1 218.173L249.27 217.343L249.42 216.493L249.56 215.653L249.68 214.803L249.77 213.953L249.86 213.103L249.92 212.243L249.96 211.393L250 210.543V209.683V208.823L249.96 207.963Z" fill="#3D95FD"/>
<path d="M0.0400144 42.0266L0.0800288 42.8866L0.14005 43.7365L0.230083 44.5964L0.330119 45.4464L0.440158 46.2863L0.580209 47.1362L0.730263 47.9762L0.900324 48.8161L1.09039 49.646L1.30047 50.476L1.52055 51.2959L1.76063 52.1258L2.03073 52.9358L2.30083 53.7457L2.60094 54.5556L2.90104 55.3456L3.23116 56.1455L3.58129 56.9254L3.94142 57.7054L4.31155 58.4653L4.7117 59.2253L5.12184 59.9852L5.542 60.7251L5.99216 61.4651L6.44232 62.175L6.91249 62.895L7.40267 63.6049L7.90285 64.2949L8.42303 64.9848L8.95322 65.6448L9.49342 66.3147L10.0536 66.9546L10.6238 67.5946L11.214 68.2145L11.8143 68.8245L12.4245 69.4244L13.0447 70.0144L13.6749 70.5843L14.3252 71.1443L14.9954 71.6843L15.0254 71.7143L15.9657 71.1543L16.796 70.6843L17.6564 70.2044L17.7764 70.1544L17.5463 69.7444L17.2462 69.1345L16.9561 68.5145L16.686 67.8846L16.4259 67.2546L16.1858 66.6147L15.9557 65.9747L15.7557 65.3148L15.5656 64.6648L15.3955 64.0049L15.2355 63.3349L15.1054 62.675L14.9854 61.995L14.8854 61.3151L14.8053 60.6452L14.7453 59.9652L14.6953 59.2853L14.6753 58.5953L14.6653 57.9154L14.6753 57.2354L14.6953 56.5455L14.7453 55.8555L14.8053 55.1856L14.8854 54.5056L14.9854 53.8357L15.1054 53.1557L15.2355 52.4858L15.3955 51.8259L15.5656 51.1659L15.7557 50.506L15.9557 49.856L16.1858 49.2061L16.4259 48.5661L16.686 47.9362L16.9561 47.3062L17.2462 46.6863L17.5463 46.0863L17.8764 45.4764L18.2166 44.8864L18.5667 44.2965L18.9368 43.7265L19.327 43.1665L19.7171 42.6166L20.1473 42.0666L20.5674 41.5367L21.0176 41.0167L21.4677 40.5068L21.9379 40.0068L22.4181 39.5268L22.9183 39.0569L23.4284 38.6069L23.9386 38.1569L24.4688 37.727L25.019 37.317L25.5692 36.907L26.1394 36.5271L26.7096 36.1571L27.2998 35.7971L27.88 35.4672L28.4903 35.1472L29.1005 34.8372L29.7207 34.5472L30.3509 34.2673L30.9711 34.0173L31.6214 33.7773L32.2616 33.5573L32.9118 33.3473L33.5721 33.1573L34.2323 32.9874L34.9026 32.8374L35.5628 32.6974L36.243 32.5874L36.9233 32.4874L37.5935 32.3974L38.2738 32.3374L38.954 32.2874L39.6343 32.2574H40.3245H250V0H40.3245H39.4642L38.6139 0.0299976L37.7536 0.0799936L36.9033 0.149988L36.043 0.219982L35.1927 0.319974L34.3524 0.449964L33.5021 0.569954L32.6618 0.729942L31.8215 0.899928L30.9912 1.09991L30.1609 1.2999L29.3406 1.51988L28.5103 1.76986L27.7 2.01984L26.8897 2.29982L26.0894 2.58979L25.2791 2.90977L24.4988 3.22974L23.7185 3.56971L22.9383 3.93968L22.168 4.30966L21.4077 4.70962L20.6574 5.11959L19.9172 5.53956L19.1769 5.97952L18.4566 6.43948L17.7364 6.90945L17.0361 7.39941L16.3459 7.89937L15.6556 8.41933L14.9954 8.94928L14.3252 9.49924L13.6749 10.0492L13.0447 10.6192L12.4245 11.2091L11.8143 11.8091L11.214 12.419L10.6238 13.039L10.0536 13.6789L9.49342 14.3289L8.95322 14.9888L8.42303 15.6587L7.90285 16.3387L7.40267 17.0386L6.91249 17.7386L6.44232 18.4485L5.99216 19.1785L5.542 19.9084L5.12184 20.6583L4.7117 21.4083L4.31155 22.1582L3.94142 22.9382L3.58129 23.7081L3.23116 24.498L2.90104 25.288L2.60094 26.0779L2.30083 26.8778L2.03073 27.6978L1.76063 28.5077L1.52055 29.3277L1.30047 30.1576L1.09039 30.9875L0.900324 31.8275L0.730263 32.6574L0.580209 33.4973L0.440158 34.3473L0.330119 35.1972L0.230083 36.0471L0.14005 36.897L0.0800288 37.757L0.0400144 38.6069L0 39.4568V40.3168V41.1767L0.0400144 42.0266Z" fill="#0DC09D"/>
</g>
<defs>
<clipPath id="clip0_934_9493">
<rect width="250" height="250" />
</clipPath>
</defs>
</svg>
Seqera Platform
</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane fade in active" id="fastq_tabcontent">
<div ng-show="savedResults.length > 0" class="panel-group" id="fastqAccordion" role="tablist" aria-multiselectable="true">
<p><br>To download FastQ files directly, sra-explorer queries the <a href="https://www.ebi.ac.uk/ena" target="_blank" rel="nofollow">ENA</a> for each SRA run accession number.</p>
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#fastqAccordion" href="#fastqURLs">Raw FastQ Download URLs</a>
</h4>
</div>
<div id="fastqURLs" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
<p>The following is a list of links to download the selected SRA runs as FastQ from the ENA.</p>
<p>
<button class="btn btn-sm btn-default btn-copy" data-clipboard-target="#fastqURLs_content"><span class="glyphicon glyphicon-copy"></span> Copy</button>
<button class="btn btn-sm btn-default btn-download" ng-click="download_contents('#fastqURLs_content', 'sra_explorer_fastq_urls.txt')"><span class="glyphicon glyphicon-download-alt"></span> Download</button>
</p>
<p ng-show="savedResultsENAaccessions.length < savedResults.length" class="text-center"><span class="glyphicon glyphicon-refresh fa-spin"></span> Loading <span class="badge"><span ng-bind="savedResultsENAaccessions.length"></span> / <span ng-bind="savedResults.length"></span></span>..</p>
<pre ng-show="savedResultsENAfastq.length > 0" id="fastqURLs_content"><code ng-repeat="x in savedResultsENAfastq">{{ x.fastq_url }}{{ nlChr }}</code></pre>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#fastqAccordion" href="#fastqURLs_bashCURL">Bash script for downloading FastQ files</a>
</h4>
</div>
<div id="fastqURLs_bashCURL" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
<p>This list of bash <code>curl</code> commands to download each SRA run FastQ file from the ENA, and save with a nicer filename, with the cleaned dataset title appended.</p>
<p>
<button class="btn btn-sm btn-default btn-copy" data-clipboard-target="#fastqURLs_bashCURL_content"><span class="glyphicon glyphicon-copy"></span> Copy</button>
<button class="btn btn-sm btn-default btn-download" ng-click="download_contents('#fastqURLs_bashCURL_content', 'sra_explorer_fastq_download.sh')"><span class="glyphicon glyphicon-download-alt"></span> Download</button>
</p>
<p ng-show="savedResultsENAaccessions.length < savedResults.length" class="text-center"><span class="glyphicon glyphicon-refresh fa-spin"></span> Loading <span class="badge"><span ng-bind="savedResultsENAaccessions.length"></span> / <span ng-bind="savedResults.length"></span></span>..</p>
<pre ng-show="savedResultsENAfastq.length > 0" id="fastqURLs_bashCURL_content"><code>#!/usr/bin/env bash</code><code ng-repeat="x in savedResultsENAfastq">{{ nlChr }}curl -L {{ x.fastq_url }} -o {{ x.fastq_niceFilename }}</code></pre>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#fastqAccordion" href="#fastqURLs_aspera">Aspera commands for downloading FastQ files</a>
</h4>
</div>
<div id="fastqURLs_aspera" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
<p>This list of bash <code>ascp</code> commands to download each FastQ file from the ENA using the <a href="https://downloads.asperasoft.com/en/downloads/8?list" target="_blank" rel="nofollow">Aspera download tool</a>.</p>
<form class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">ascp openssh key path</label>
<div class="col-sm-10">
<div class="input-group">
<input type="text" class="form-control" id="ascp_openssh_location" ng-model="ascp_openssh_location">
<span class="input-group-btn">
<button class="btn btn-default" type="button" ng-click="set_ascp_openssh_location('linux')"><i class="fa fa-linux" aria-hidden="true"></i> Linux</button>
<button class="btn btn-default" type="button" ng-click="set_ascp_openssh_location('osx')"><i class="fa fa-apple" aria-hidden="true"></i> OSX</button>
</span>
</div>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">Rename files?</label>
<div class="col-sm-10">
<label class="radio-inline">
<input type="radio" ng-model="ascp_append_mv" ng-value="true"> Append <code>mv</code> command to rename downloaded files
</label>
<label class="radio-inline">
<input type="radio" ng-model="ascp_append_mv" ng-value="false"> Don't rename files
</label>
</div>
</div>
</form>
<p>
<button class="btn btn-sm btn-default btn-copy" data-clipboard-target="#fastqURLs_aspera_content"><span class="glyphicon glyphicon-copy"></span> Copy</button>
<button class="btn btn-sm btn-default btn-download" ng-click="download_contents('#fastqURLs_aspera_content', 'sra_explorer_fastq_aspera_download.sh')"><span class="glyphicon glyphicon-download-alt"></span> Download</button>
</p>
<p ng-show="savedResultsENAaccessions.length < savedResults.length" class="text-center"><span class="glyphicon glyphicon-refresh fa-spin"></span> Loading <span class="badge"><span ng-bind="savedResultsENAaccessions.length"></span> / <span ng-bind="savedResults.length"></span></span>..</p>
<pre ng-show="savedResultsENAfastq.length > 0" id="fastqURLs_aspera_content"><code>#!/usr/bin/env bash</code><code ng-repeat="x in savedResultsENAfastq">{{ nlChr }}ascp -QT -l 300m -P33001 -i {{ ascp_openssh_location }} {{ x.fastq_asperaurl }} .<span ng-show="ascp_append_mv"> && mv {{ x.fastq_filename }} {{ x.fastq_niceFilename }}</span></code></pre>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#fastqAccordion" href="#fastqURLs_bcbio">bcbio project file for FastQ downloads</a>
</h4>
</div>
<div id="fastqURLs_bcbio" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
<p>This list of URLs is followed by a nicer filename. This is suitable for use with <a href="https://bcbio-nextgen.readthedocs.io/en/latest/" target="_blank">bcbio-nextgen</a> analysis pipelines.</p>
<p>
<button class="btn btn-sm btn-default btn-copy" data-clipboard-target="#fastqURLs_bcbio_content"><span class="glyphicon glyphicon-copy"></span> Copy</button>
<button class="btn btn-sm btn-default btn-download" ng-click="download_contents('#fastqURLs_bcbio_content', 'sra_explorer_bcbio.txt')"><span class="glyphicon glyphicon-download-alt"></span> Download</button>
</p>
<p ng-show="savedResultsENAaccessions.length < savedResults.length" class="text-center"><span class="glyphicon glyphicon-refresh fa-spin"></span> Loading <span class="badge"><span ng-bind="savedResultsENAaccessions.length"></span> / <span ng-bind="savedResults.length"></span></span>..</p>
<pre ng-show="savedResultsENAfastq.length > 0" id="fastqURLs_bcbio_content"><code>samplename,description</code><code ng-repeat="x in savedResultsENAfastq">{{ nlChr }}{{ x.fastq_url }},{{ x.fastq_niceFilename }}</code></pre>
</div>
</div>
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane fade" id="sra_tabcontent">
<div ng-show="savedResults.length > 0" class="panel-group" id="sraAccordion" role="tablist" aria-multiselectable="true">
<p><br>These download links are automatically generated based on the URL schema of the NCBI SRA.</p>
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#sraAccordion" href="#ftpURLs">Raw SRA Download URLs</a>
</h4>
</div>
<div id="ftpURLs" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
<p>The following is a list of links to download the selected SRA files.</p>
<p>
<button class="btn btn-sm btn-default btn-copy" data-clipboard-target="#ftpURLs_content"><span class="glyphicon glyphicon-copy"></span> Copy</button>
<button class="btn btn-sm btn-default btn-download" ng-click="download_contents('#ftpURLs_content', 'sra_explorer_sra_urls.txt')"><span class="glyphicon glyphicon-download-alt"></span> Download</button>
</p>
<pre id="ftpURLs_content"><code ng-repeat="x in savedResults">{{ x.sra_url }}{{ nlChr }}</code></pre>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#sraAccordion" href="#ftpURLs_bashCURL">
Bash script for downloading SRA files (nice filenames)
</a>
</h4>
</div>
<div id="ftpURLs_bashCURL" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
<p>This list of bash <code>curl</code> commands to download each SRA file and save with a nicer filename, with the cleaned dataset title appended.</p>
<p>
<button class="btn btn-sm btn-default btn-copy" data-clipboard-target="#ftpURLs_bashCURL_content"><span class="glyphicon glyphicon-copy"></span> Copy</button>
<button class="btn btn-sm btn-default btn-download" ng-click="download_contents('#ftpURLs_bashCURL_content', 'sra_explorer_sra_download.sh')"><span class="glyphicon glyphicon-download-alt"></span> Download</button>
</p>
<pre id="ftpURLs_bashCURL_content"><code>#!/usr/bin/env bash</code><code ng-repeat="x in savedResults">{{ nlChr }}curl -L {{ x.sra_url }} -o {{ x.sra_niceFilename }}</code></pre>
</div>
</div>
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane fade" id="full_metadata_tabcontent">
<div ng-show="savedResults.length > 0" class="panel-group" id="fullMetaAccordion" role="tablist" aria-multiselectable="true">
<p><br>These files contain the metadata used by SRA-Explorer for downstream use. Note that each SRA record is repeated for every ENA FastQ entry.</p>
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#fullMetaAccordion" href="#fullTSV">TSV</a>
</h4>
</div>
<div id="fullTSV" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
<p>The following is a TSV (tab separated values) file with all metadata fields for the selected samples.</p>
<p>
<button class="btn btn-sm btn-default btn-copy" data-clipboard-target="#fullTSV_content"><span class="glyphicon glyphicon-copy"></span> Copy</button>
<button class="btn btn-sm btn-default btn-download" ng-click="download_contents('#fullTSV_content', 'sra_explorer_metadata.tsv')"><span class="glyphicon glyphicon-download-alt"></span> Download</button>
</p>
<p ng-show="savedResultsENAaccessions.length < savedResults.length" class="text-center"><span class="glyphicon glyphicon-refresh fa-spin"></span> Loading <span class="badge"><span ng-bind="savedResultsENAaccessions.length"></span> / <span ng-bind="savedResults.length"></span></span>..</p>
<pre ng-show="savedResultsENAfastq.length > 0" id="fullTSV_content"><code>Accession{{ tabChr }}Title{{ tabChr }}Platform{{ tabChr }}Total bases{{ tabChr }}Create date{{ tabChr }}SRA URL{{ tabChr }}SRA filename{{ tabChr }}SRA nice filename{{ tabChr }}FastQ URL{{ tabChr }}FastQ Aspera URL{{ tabChr }}FastQ filename{{ tabChr }}FastQ nice filename</code><code ng-repeat="x in savedResultsENAfastq">{{ nlChr }}{{ x.accession }}{{ tabChr }}{{ x.title }}{{ tabChr }}{{ x.platform }}{{ tabChr }}{{ x.total_bases }}{{ tabChr }}{{ x.createdate }}{{ tabChr }}{{ x.sra_url }}{{ tabChr }}{{ x.accession }}.sra{{ tabChr }}{{ x.sra_niceFilename }}{{ tabChr }}{{ x.fastq_url }}{{ tabChr }}{{ x.fastq_asperaurl }}{{ tabChr }}{{ x.fastq_filename }}{{ tabChr }}{{ x.fastq_niceFilename }}</code></pre>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#fullMetaAccordion" href="#fullJSON">JSON</a>
</h4>
</div>
<div id="fullJSON" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
<p>The following is a JSON file with all metadata fields for the selected samples.</p>
<p>
<button class="btn btn-sm btn-default btn-copy" data-clipboard-target="#fullJSON_content"><span class="glyphicon glyphicon-copy"></span> Copy</button>
<button class="btn btn-sm btn-default btn-download" ng-click="download_contents('#fullJSON_content', 'sra_explorer_metadata.json')"><span class="glyphicon glyphicon-download-alt"></span> Download</button>
</p>
<p ng-show="savedResultsENAaccessions.length < savedResults.length" class="text-center"><span class="glyphicon glyphicon-refresh fa-spin"></span> Loading <span class="badge"><span ng-bind="savedResultsENAaccessions.length"></span> / <span ng-bind="savedResults.length"></span></span>..</p>
<pre ng-show="savedResultsENAfastq.length > 0" id="fullJSON_content"><code>{{ savedResultsENAfastq | json }}</code></pre>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#fullMetaAccordion" href="#fullYAML">YAML</a>
</h4>
</div>
<div id="fullYAML" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
<p>The following is a YAML file with all metadata fields for the selected samples.</p>
<p>
<button class="btn btn-sm btn-default btn-copy" data-clipboard-target="#fullYAML_content"><span class="glyphicon glyphicon-copy"></span> Copy</button>
<button class="btn btn-sm btn-default btn-download" ng-click="download_contents('#fullYAML_content', 'sra_explorer_metadata.yaml')"><span class="glyphicon glyphicon-download-alt"></span> Download</button>
</p>
<p ng-show="savedResultsENAaccessions.length < savedResults.length" class="text-center"><span class="glyphicon glyphicon-refresh fa-spin"></span> Loading <span class="badge"><span ng-bind="savedResultsENAaccessions.length"></span> / <span ng-bind="savedResults.length"></span></span>..</p>
<pre ng-show="savedResultsENAfastq.length > 0" id="fullYAML_content"><code>{{ savedResultsENAfastqYAML }}</code></pre>
</div>
</div>
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane fade" id="seqera_platform_tabcontent">
<p><br><a href="https://nextflow.io/" target="_blank">Nextflow</a> and the
<a href="https://seqera.io/platform/" target="_blank">Seqera Platform</a>
enable scalable and reproducible scientific workflows.
Many Nextflow pipelines use a sample sheet <code>.csv</code> file to handle input metadata.
This can be supplied within Seqera Platform as a <a href="https://docs.seqera.io/platform/latest/data/datasets" target="_blank">Dataset</a>.
SRA-Explorer allows metadata from public sequencing data to be saved as a Dataset in Seqera Platform.
</p>
<p>Note that SRA records are repeated for every ENA FastQ entry.</p>
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a role="button" href="#seqera_platform">Seqera Platform</a>
</h4>
</div>
<div id="seqera_platform">
<div class="panel-body">
<p>Send all metadata to Seqera Platform as a saved Dataset, which you can use as an input when launching pipelines.</p>
<form id="seqera_platform_form" class="form-horizontal">
<div class="form-group">
<div class="col-sm-9" ng-show="!seqeraplatform.credentials_valid">
<div class="alert alert-info" style="padding: 6px 12px;">
Please connect your Seqera Platform account to proceed.
</div>
</div>
<div class="col-sm-2" ng-show="seqeraplatform.credentials_valid">
<label class="sr-only" for="sp_organisation">Organisation</label>
<select class="form-control" ng-model="seqeraplatform.selected_org" ng-change="update_seqera_org()"> id="sp_organisation">
<option ng-repeat="(orgId, orgName) in seqeraplatform.orgs" value="{{ orgId }}">{{ orgName }}</option>
</select>
</div>
<div class="col-sm-2" ng-show="seqeraplatform.credentials_valid">
<label class="sr-only" for="sp_workspace_id">Workspace</label>
<select class="form-control" ng-model="seqeraplatform.workspace_id" id="sp_workspace_id">
<option ng-repeat="(wsId, wsName) in seqeraplatform.workspaces[seqeraplatform.selected_org]" value="{{ wsId }}">{{ wsName }}</option>
</select>
</div>
<div class="col-sm-2" ng-show="seqeraplatform.credentials_valid">
<label class="sr-only" for="sp_name">Dataset name</label>
<input type="text" class="form-control" ng-model="seqeraplatform.name" id="sp_name" placeholder="Dataset name">
</div>
<div class="col-sm-3" ng-show="seqeraplatform.credentials_valid">
<label class="sr-only" for="sp_description">Dataset description</label>
<input type="text" class="form-control" ng-model="seqeraplatform.description" id="sp_description" placeholder="Dataset description">
</div>
<div class="col-sm-3 text-right">
<button type="submit" class="btn btn-default" data-toggle="modal" data-target="#seqeraPlatformConnectionModal">
<span class="glyphicon glyphicon-log-in"></span> Connect
</button>
<button type="submit" class="btn btn-primary" disabled ng-click="save_seqeraplatform(seqeraplatform)" ng-disabled="!seqeraplatform.credentials_valid || seqeraplatform.workspace_id == ''">
<span class="glyphicon glyphicon-send"></span> Add Dataset
</button>
</div>
</div>
</form>
<div ng-show="seqeraplatform.messages.length > 0" class="alert" ng-class="{'alert-success': !seqeraplatform.hasError, 'alert-danger': seqeraplatform.hasError }">
<p ng-repeat="x in seqeraplatform.messages"><ng-bind-html ng-bind-html="x"></ng-bind-html></p>
</div>
<p ng-show="savedResultsENAaccessions.length < savedResults.length" class="text-center"><span class="glyphicon glyphicon-refresh fa-spin"></span> Loading <span class="badge"><span ng-bind="savedResultsENAaccessions.length"></span> / <span ng-bind="savedResults.length"></span></span>..</p>
<div id="fullSeqeraPlatform_table_wrapper">
<table ng-show="savedResultsENAfastq.length > 0" id="fullSeqeraPlatform_content" class="table table-bordered table-hover table-condensed small">
<thead>
<tr>
<th>Accession</th>
<th>Title</th>
<th>Platform</th>
<th>Total bases</th>
<th>Create date</th>
<th>SRA URL</th>
<th>SRA filename</th>
<th>SRA nice filename</th>
<th>FastQ URL</th>
<th>FastQ Aspera URL</th>
<th>FastQ filename</th>
<th>FastQ nice filename</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="x in savedResultsENAfastq">
<td>{{ x.accession }}</td>
<td>{{ x.title }}</td>
<td>{{ x.platform }}</td>
<td>{{ x.total_bases }}</td>
<td>{{ x.createdate }}</td>
<td>{{ x.sra_url }}</td>
<td>{{ x.accession }}.sra</td>
<td>{{ x.sra_niceFilename }}</td>
<td>{{ x.fastq_url }}</td>
<td>{{ x.fastq_asperaurl }}</td>
<td>{{ x.fastq_filename }}</td>
<td>{{ x.fastq_niceFilename }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p ng-show="summaryURL">Query URL = <code ng-bind="summaryURL"></code></p>
</div><!-- /.container -->
<hr>
<div class="container footer text-muted">
<p>
SRA-Explorer was written by <a href="http://phil.ewels.co.uk">Phil Ewels</a>.
Source code is available under a GNU GPLv3 licence at <a href="https://github.com/ewels/sra-explorer">https://github.com/ewels/sra-explorer</a>.
</p>
<p>
Here a lot? It might be worth taking a look at <a href="https://github.com/ewels/sra-explorer#alternatives">some alternative tools</a>..
</p>
</div>
<!-- Modal -->
<div class="modal fade" id="seqeraPlatformConnectionModal" tabindex="-1" role="dialog" aria-labelledby="seqeraPlatformConnectionModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="seqeraPlatformConnectionModalLabel">Seqera Platform Connection</h4>
</div>
<div class="modal-body">
<p>To connect to the Seqera Platform, please enter your credentials:</p>
<div class="form-group">
<label for="sp_frontend_url">Seqera Platform URL</label>
<input type="text" class="form-control" ng-model="seqeraplatform.frontend_url" id="sp_frontend_url" placeholder="Platform URL" value="https://cloud.seqera.io/">
<p class="help-block small">If using Seqera Cloud, leave as <code>https://cloud.seqera.io/</code>. If using a custom Seqera Enterprise installation, enter your base Seqera Platform URL.</p>
</div>
<div class="form-group">
<label for="sp_api_base">API Base URL</label>
<input type="text" class="form-control" ng-model="seqeraplatform.api_base" id="sp_api_base" placeholder="API Base URL" value="https://api.cloud.seqera.io/">
<p class="help-block small">If using Seqera Cloud, leave as <code>https://api.cloud.seqera.io/</code>. If using a custom Seqera Enterprise installation, enter your base API route.</p>
</div>
<div class="form-group">
<label for="sp_access_token">Access Token</label>
<input type="password" class="form-control" ng-model="seqeraplatform.access_token" id="sp_access_token" placeholder="Access Token">
<p class="help-block small">Create an Access Token at <a href="https://cloud.seqera.io/tokens" target="_blank">https://cloud.seqera.io/tokens</a> (or in your enterprise installation).</p>
</div>
<p class="small">
You may save these details in a browser cookie, so that you do not need to enter them every time.
This is stored on your device only. <strong>Do not use this feature on a shared computer.</strong>
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" ng-click="save_seqera_credentials(seqeraplatform, false)">Close and use this time</button>
<button type="button" class="btn btn-primary" ng-click="save_seqera_credentials(seqeraplatform, true)">Save in browser cookie</button>
</div>
</div>
</div>
</div>
<!-- Core JavaScript -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular-sanitize.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.5.10/clipboard.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-yaml/3.12.2/js-yaml.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.8/FileSaver.js"></script>
<!-- SRA-Explorer Code -->
<script type="text/javascript">
var app = angular.module("sraExplorerApp", ['ngSanitize']);
app.controller("searchCtrl", function($scope, $http) {
$scope.searchText = "";
$scope.maxResults = 100;
$scope.retstart = 0;
$scope.summaryURL = 0;
$scope.loadingSpinner = 0;
$scope.sortType = '';
$scope.results = [];
$scope.savedResults = [];
$scope.savedResultsENAaccessions = [];
$scope.savedResultsENAfastq = [];
$scope.savedResultsENAfastqYAML = '';
$scope.showSaved = false;
$scope.tabChr = "\t";
$scope.nlChr = "\n";
$scope.ascp_openssh_location = '$HOME/.aspera/connect/etc/asperaweb_id_dsa.openssh';
$scope.ascp_append_mv = true;
$scope.seqeraplatform = {
'frontend_url': 'https://cloud.seqera.io/',
'api_base': 'https://api.cloud.seqera.io/',
'access_token': '',
'user_id': '',
'workspace_id': '',
'name': '',
'description': '',
'credentials_valid': false,
'orgs': {},
'workspaces': {},
'selected_org': '',
'messages': [],
'hasError': false
};
// Load saved Seqera Platform connection details from cookie (not localstorage)
if (document.cookie.indexOf('seqeraPlatformFrontendURL') > -1) {
var frontend_url = document.cookie.split('; ').find(row => row.startsWith('seqeraPlatformFrontendURL=')).split('=')[1];
if(frontend_url && frontend_url != ''){
$scope.seqeraplatform.frontend_url = frontend_url;
}
}
if (document.cookie.indexOf('seqeraPlatformAPIBase') > -1) {
var api_base = document.cookie.split('; ').find(row => row.startsWith('seqeraPlatformAPIBase=')).split('=')[1];
if(api_base && api_base != ''){
$scope.seqeraplatform.api_base = api_base;
}
}
if (document.cookie.indexOf('seqeraPlatformAccessToken') > -1) {
var access_token = document.cookie.split('; ').find(row => row.startsWith('seqeraPlatformAccessToken=')).split('=')[1];
if(access_token && access_token != ''){
$scope.seqeraplatform.access_token = access_token;
}
console.log("Loaded Seqera Platform credentials from cookie");
}
$scope.seqeraplatform.credentials_valid = are_seqera_platform_credentials_valid();
$scope.search = function() { searchSRA($scope.searchText); };
/* Search Function */
function searchSRA (string) {
$scope.showSaved = false;
$scope.loadingSpinner = 1;
$scope.results = [];
var searchURL = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=sra&usehistory=y&retmode=json&term='+string;
$http.get(searchURL).success(function(s_response) {
if(s_response.esearchresult.querytranslation){
$scope.searchText = s_response.esearchresult.querytranslation;
}
var webenv = s_response.esearchresult.webenv;
var querykey = s_response.esearchresult.querykey;
var retmax = $scope.maxResults;
var retstart = $scope.retstart;
var resultsURL = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=sra&retmode=json&query_key='+querykey+'&WebEnv='+webenv+'&retstart='+retstart+'&retmax='+retmax;
$scope.summaryURL = resultsURL;
$http.get(resultsURL).success(function(response) {
$scope.loadingSpinner = 0;
// Parse the stupid embedded XML
angular.forEach(response.result, function(value, key) {
// Exp XML
expXMLraw = '<document>'+value.expxml+'</document>';
parser = new DOMParser();
expXML = parser.parseFromString(expXMLraw,"text/xml");
expJSON = xmlToJson(expXML);
if(expJSON.document.Summary){
exp = expJSON.document.Summary;
value.expxml = exp;
}
// Runs
runsXMLraw = '<document>'+value.runs+'</document>';
parser = new DOMParser();
runsXML = parser.parseFromString(runsXMLraw,"text/xml");
runsJSON = xmlToJson(runsXML);
if(runsJSON.document.Run){
value.runs = runsJSON.document.Run;
// If only one SRR, make it an array
if(!Array.isArray(value.runs)){
value.runs = [value.runs];
}
// Loop through each run result
for(var i = 0; i < value.runs.length; i++){
// Add results to scope
try {
var sra_cleanTitle = value.expxml.Title.text.replace(/[^a-z0-9\._\-]/gi, '_').replace(/_+/g, '_');
$scope.results.push({
'title': value.expxml.Title.text,
'accession': value.runs[i].attributes.acc,
'platform': value.expxml.Platform.attributes.instrument_model,
'total_bases': Math.round(value.runs[i].attributes.total_bases / 100000),
'createdate': Date.parse(value.createdate),
'cleanTitle': sra_cleanTitle,
'sra_url': "ftp://ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByRun/sra/"+value.runs[i].attributes.acc.substring(0,3)+"/"+value.runs[i].attributes.acc.substring(0,6)+"/"+value.runs[i].attributes.acc+"/"+value.runs[i].attributes.acc+".sra",
'sra_niceFilename': value.runs[i].attributes.acc+'_'+sra_cleanTitle+'.sra'
});
} catch(e){
console.log(e);
console.log({key: value});
}
};
}
});
// console.log(response.result);
});
});
}
// Toggle row selection checkboxes
$scope.toggleRow = function($event, obj) {
$event.stopPropagation();
obj.selected = !obj.selected;
}
$scope.rowClicked = function(obj) {
obj.selected = !obj.selected;
};
$scope.checkAll = function () {
angular.forEach($scope.filteredResults, function (item) {
item.selected = $scope.selectAll;
});
};
$scope.$watch('filteredResults', function(items){
var selectedItems = 0;
angular.forEach(items, function(item){
selectedItems += item.selected ? 1 : 0;
});
$scope.selectedItems = selectedItems;
}, true);
// Save datasets
$scope.saveDatasets = function() {
angular.forEach($scope.filteredResults, function(item){
if(item.selected){
var alreadyAdded = false;
for (i=0; i<$scope.savedResults.length; i++){
if (item['accession'] == $scope.savedResults[i]['accession']){
alreadyAdded = true;
}
}
if(!alreadyAdded){
$scope.savedResults.push( angular.copy(item) );
}
}
});
};
// Show saved datasets
$scope.checkoutButton = function(){
// Clear search results and show saved
$scope.results = [];
$scope.summaryURL = 0;
$scope.loadingSpinner = 0;
$scope.showSaved = true;
$scope.fetchFastqENA();
}
// Show saved datasets
$scope.returnToHomeButton = function(){
// Clear search results and hide results again
$scope.showSaved = false;
$scope.results = [];
$scope.searchText = '';
}
// Send saved datasets back to table
$scope.returnSaved = function() {
// Clear search results and show saved
$scope.results = angular.copy( $scope.savedResults );
$scope.savedResults = [];
$scope.showSaved = false;
}
// Send saved datasets back to table
$scope.fetchFastqENA = function() {
if($scope.savedResultsENAaccessions.length < $scope.savedResults.length){
angular.forEach($scope.savedResults, function(value, key) {
if($scope.savedResultsENAaccessions.indexOf(value['accession']) === -1){
var ENAsearchURL = 'https://www.ebi.ac.uk/ena/portal/api/filereport?result=read_run&fields=fastq_ftp&format=JSON&accession='+value['accession'];
$http.get(ENAsearchURL).success(function(s_response) {
for (var i = 0; i < s_response.length; i++) {
var ftpFastQ = s_response[i]["fastq_ftp"];
if (ftpFastQ != undefined) {
// Paired-end FastQ files are given as a single result, need to split by ; character
var ftpFastQ_urls = ftpFastQ.split(';');
for(var j = 0; j < ftpFastQ_urls.length; j++){
// Save the accession now that we have some download filenames, so we know that this worked
if($scope.savedResultsENAaccessions.indexOf(value['accession']) === -1){
$scope.savedResultsENAaccessions.push(value['accession']);
}
var fname = ftpFastQ_urls[j].substring(ftpFastQ_urls[j].lastIndexOf('/')+1);
$scope.savedResultsENAfastq.push({
// Original SRA data
'title': value['title'],
'accession': value['accession'],
'cleanTitle': value['cleanTitle'],
'platform': value['platform'],
'total_bases': value['total_bases'],
'createdate': value['createdate'],
'sra_url': value['sra_url'],
'sra_niceFilename': value['sra_niceFilename'],
// New FastQ fields
'fastq_url': 'ftp://'+ftpFastQ_urls[j],
'fastq_asperaurl': ftpFastQ_urls[j].replace('ftp.sra.ebi.ac.uk/', '[email protected]:').replace('ftp.ebi.ac.uk/', '[email protected]:'),
'fastq_filename': fname,
'fastq_niceFilename': value['accession']+'_'+value['cleanTitle']+fname.replace(value['accession'], '')
});
$scope.savedResultsENAfastqYAML = jsyaml.safeDump($scope.savedResultsENAfastq);
}
}
}
});
}
});
}
}
// Customise the ascp openssh location with buttons
$scope.set_ascp_openssh_location = function(loc){
if(loc == 'linux'){
$scope.ascp_openssh_location = '$HOME/.aspera/connect/etc/asperaweb_id_dsa.openssh';
}
if(loc == 'osx'){
$scope.ascp_openssh_location = '$HOME/Applications/Aspera\\ Connect.app/Contents/Resources/asperaweb_id_dsa.openssh';
}
}
// Download contents as a file
$scope.download_contents = function(target, filename){
var content = $(target).text();
var blob = new Blob([content], { type: "text/plain;charset=utf-8" });
saveAs(blob, filename);
}
// Save Seqera Platform API details to a cookie
$scope.save_seqera_credentials = function(sp, save_cookie) {
if(save_cookie){
console.log("Saving Seqera Platform API details to cookie");
// Expire in 1 month
var d = new Date();
d.setTime(d.getTime() + (30*24*60*60*1000));
var expires = "; expires="+d.toUTCString();
// Save cookies
document.cookie = "seqeraPlatformFrontendURL="+sp.frontend_url+expires;
document.cookie = "seqeraPlatformAPIBase="+sp.api_base+expires;
document.cookie = "seqeraPlatformAccessToken="+sp.access_token+expires;
}
// Set valid state
$scope.seqeraplatform.credentials_valid = are_seqera_platform_credentials_valid();
// Hide the modal
if($scope.seqeraplatform.credentials_valid){
$('#seqeraPlatformConnectionModal').modal('hide');
} else {
alert("Credentials seem invalid");
}
}
function are_seqera_platform_credentials_valid(){
// Check if we have valid credentials and fetch orgs / workspaces
if($scope.seqeraplatform.frontend_url && $scope.seqeraplatform.frontend_url != '' && $scope.seqeraplatform.api_base && $scope.seqeraplatform.api_base != '' && $scope.seqeraplatform.access_token && $scope.seqeraplatform.access_token != ''){
get_seqera_orgs_workspaces();
return true;
}
return false;
}
function has_workspace_permissions(roles){
let valid_roles = ['owner','admin','maintain','launch'];
for (var i = 0; i < valid_roles.length; i++) {
if(roles.indexOf(valid_roles[i]) > -1){
return true;
}
}
return false;
}
function get_seqera_orgs_workspaces(){
$scope.seqeraplatform.user_id = '';
$scope.seqeraplatform.orgs = {};
$scope.seqeraplatform.workspaces = {};
$scope.seqeraplatform.selected_org = '';
$scope.seqeraplatform.workspace_id = '';
// Get the User ID from Seqera API /user-info endpoint
var api_url_get_user = $scope.seqeraplatform.api_base.replace(/\/+$/, '')+'/user-info';
var headers = {
"Content-Type": "application/json",
"Authorization": "Bearer "+$scope.seqeraplatform.access_token
};
$http({
url: api_url_get_user,
headers: headers,
method: "GET"
}).then(function successCallback(sp_response) {
console.log("Got user:", sp_response);
$scope.seqeraplatform.user_id = sp_response.data.user.id;
// Now get orgs and workspaces
var api_url_get_orgs_workspaces = $scope.seqeraplatform.api_base.replace(/\/+$/, '')+'/user/'+$scope.seqeraplatform.user_id+'/workspaces';
$http({
url: api_url_get_orgs_workspaces,
headers: headers,
method: "GET"
}).then(function successCallback(sp_response) {
console.log('Got workspaces', sp_response);
angular.forEach(sp_response.data.orgsAndWorkspaces, function(ws, key) {
if(ws.workspaceId && has_workspace_permissions(ws.roles)){
$scope.seqeraplatform.orgs[ws.orgId] = ws.orgName;
if($scope.seqeraplatform.selected_org == ''){
$scope.seqeraplatform.selected_org = ws.orgId.toString();
$scope.seqeraplatform.workspace_id = ws.workspaceId.toString();
}
if(!(ws.orgId in $scope.seqeraplatform.workspaces)){
$scope.seqeraplatform.workspaces[ws.orgId] = {};
}
$scope.seqeraplatform.workspaces[ws.orgId][ws.workspaceId] = ws.workspaceName;
}
});
}, function errorCallback(sp_response) {
console.log("Error fetching Seqera Platform workspaces", sp_response);
$scope.seqeraplatform.messages.push('Error fetching Seqera Platform workspaces');
$scope.seqeraplatform.hasError = true;
$scope.seqeraplatform.credentials_valid = false;
});
}, function errorCallback(sp_response) {
console.log("Error fetching Seqera Platform orgs", sp_response);
$scope.seqeraplatform.messages.push('Error fetching Seqera Platform organizations');
$scope.seqeraplatform.hasError = true;
$scope.seqeraplatform.credentials_valid = false;
});