-
Notifications
You must be signed in to change notification settings - Fork 30
/
index.html
1022 lines (934 loc) · 42.3 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>
<head>
<title>Ribbon</title>
<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="">
<meta name="author" content="">
<link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16">
<!-- CSS: -->
<link href='https://fonts.googleapis.com/css?family=Lato:300,900' rel='stylesheet' type='text/css'>
<!-- This still uses an old bootstrap version that doesn't play well with bundlers -->
<!-- Updates may require migrating a lot of html code, so we'll leave it like this for now. -->
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="node_modules/jquery-ui-dist/jquery-ui.min.css" rel="stylesheet">
<!-- My d3-livesearch plugin -->
<link href="css/d3-livesearch.css" rel="stylesheet">
<link href="css/d3-superTable.css" rel="stylesheet">
<!-- My own styles -->
<link href="css/custom.css" rel="stylesheet">
<link href="css/splitthreader.css" rel="stylesheet">
</head>
<body role="document">
<!-- Navigation bar -->
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<ul class="nav navbar-nav" id="navbar">
<li><a href="/">Ribbon</a></li>
<li class="dropdown" id="user_data_navbar_item" style="visibility: hidden">
<a href="" class="dropdown-toggle" data-toggle="dropdown">My Ribbon data <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu" id="user_data_list">
<!-- Populated by add_user_links_to_navbar() in vis.js -->
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right" style="margin-right: 10px;">
<li class="navbar-text small">
<small>
This is a beta of Ribbon 2.0
(<a style="padding:0; display:inline; color:#fff" href="https://github.com/MariaNattestad/Ribbon/blob/main/docs/release_notes_v2.md" target="_blank">learn more</a>).
You can go <a style="padding:0; display:inline; color:#fff" href="https://v1.genomeribbon.com" target="_blank">back to v1</a>.
</small>
</li>
</ul>
</div>
<!-- Main tabs -->
<ul class="nav nav-tabs" style="margin:10px;">
<li class="active"><a id="go_to_examples_mode" data-toggle="tab" href="#examples_panel">Examples</a></li>
<li id="ribbon_tab"><a id="go_to_ribbon_mode" data-toggle="tab" href="#ribbon-app-container">Ribbon</a></li>
<li id="splitthreader_tab"><a id="go_to_splitthreader_mode" data-toggle="tab" href="#splitthreader-app-container">SplitThreader</a></li>
<li><a id="go_to_about_mode" data-toggle="tab" href="#start_panel">About</a></li>
</ul>
<div class="tab-content">
<div id="examples_panel" class="tab-pane active">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
Examples
</h4>
</div>
<div class="panel-body">
<div id="session_messages"></div>
<h3>Example sessions</h3>
<div id="example_sessions"></div>
<strong>JSON specification for the selected session:</strong>
<p>
A session can be used through URL too, for example:
</p>
<p>
<a href="https://v2.genomeribbon.com/?session=https://42basepairs.com/download/s3/giab-data/ribbon-json/ribbon-hg008-cov-bedpe.json&locus=chr1:23272628#splitthreader" target="_blank">
https://v2.genomeribbon.com/?session=https://42basepairs.com/download/s3/giab-data/ribbon-json/ribbon-hg008-cov-bedpe.json&locus=chr1:23272628#splitthreader
</a>
</p>
<textarea id="json_session_input" style="width: 100%; height: 300px;"></textarea>
<button id="submit_json_session">Submit</button>
<h4>Ribbon-specific examples</h4>
<ul>
<li><a href="?perma=_ribbon/ilmn_deletion_a549" target="_blank">Illumina deletion in A549 cell line (600KB)</a></li>
<li><a href="?perma=_ribbon/grch38_vs_hg19" target="_blank">hg19 against GRCh38 (2 MB)</a></li>
<li><a href="?perma=_ribbon/pacb_skbr3_tra" target="_blank">PacBio SKBR3 TRA chr16 to chr19 (5MB)</a></li>
<li><a href="?perma=_ribbon/pacb_skbr3_gene_fusion" target="_blank">PacBio SKBR3 CYTH1-EIF3H gene fusion (11MB)</a></li>
<li><a href="?perma=_ribbon/grch38_vs_gorilla" target="_blank">Gorilla against GRCh38 (12MB)</a></li>
</ul>
These use the older permalink structure, giving a specific snapshot of an analysis, but they may not be connected to the original files necessary to navigate to new loci.
</div>
</div>
</div>
<div id="start_panel" class="tab-pane">
<h4>Getting started</h4>
<p>Ribbon is especially useful for viewing complex alignments, like long-read sequencing around large structural variants,
alignments/variants that span more than one chromosome, or assembly/assembly alignments.</p>
<p>Start by loading a BAM file and navigating to a position. You can also load a VCF or BED file with variants or regions of interest.</p>
<p>Ribbon can be used for long reads, short reads, paired-end reads, and assembly/genome alignments. Instructions for each data format are available by clicking on "instructions" in each tab on the right.</p>
<h3>SplitThreader</h3>
SplitThreader is now available within Ribbon!
Just click "SplitThreader" in the top navigation bar, and you can load your own coverage and structural variant files to visualize them.
There are also some examples to get you started.
<h3>Paper and code</h3>
<p><strong>Please cite the Ribbon paper in Bioinformatics:</strong></p>
<p>Ribbon: intuitive visualization for complex genomic variation: <a href="https://doi.org/10.1093/bioinformatics/btaa680" target="_blank">https://doi.org/10.1093/bioinformatics/btaa680</a></p>
<p>Also see the preprint on the BioRxiv for <a href="http://biorxiv.org/content/early/2016/10/20/082123" target="_blank">Ribbon.</a></p>
<p>And the preprint for <a href="https://www.biorxiv.org/content/10.1101/087981v1.full" target="_blank">SplitThreader</a>.</p>
<p>The code is open-source at <a href="https://github.com/MariaNattestad/ribbon" target="_blank">https://github.com/MariaNattestad/Ribbon</a></p>
<p><strong>Local installation:</strong></p>
<p>You can install Ribbon locally from Github by following the instructions here: <a href="https://github.com/MariaNattestad/ribbon" target="_blank">https://github.com/MariaNattestad/Ribbon</a></p>
</div>
<div id="ribbon-app-container" class="tab-pane">
<div id="left_panel">
<div id="left_ribbon_examples">
<p><strong>Examples:</strong></p>
<ul>
<li><a href="?perma=_ribbon/ilmn_deletion_a549" target="_blank">Illumina deletion in A549 cell line (600KB)</a></li>
<li><a href="?perma=_ribbon/grch38_vs_hg19" target="_blank">hg19 against GRCh38 (2 MB)</a></li>
<li><a href="?perma=_ribbon/pacb_skbr3_tra" target="_blank">PacBio SKBR3 TRA chr16 to chr19 (5MB)</a></li>
<li><a href="?perma=_ribbon/pacb_skbr3_gene_fusion" target="_blank">PacBio SKBR3 CYTH1-EIF3H gene fusion (11MB)</a></li>
<li><a href="?perma=_ribbon/grch38_vs_gorilla" target="_blank">Gorilla against GRCh38 (12MB)</a></li>
</ul>
</div>
<div id="svg2_panel"></div>
<div id="svg1_panel"></div>
</div>
<div id="right_panel" style="display: flex; flex-direction: column; height: 80%;">
<div>
<div id="region_box">
<p>Navigate to a position:</p>
<input type="text" id="locus_input" placeholder="chr1:123456789">
<button id="region_go">Go</button>
</div>
<div id='user_message_ribbon'></div>
</div>
<div id='right-panel-under-alert' style="overflow: scroll; flex: 1;">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">Ribbon Settings</h4>
</div>
<div class="panel-body">
<!-- Tabs: -->
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#tab_input_alignments">Input alignments</a></li>
<li><a data-toggle="tab" href="#tab_data_description">Information</a></li>
<li><a data-toggle="tab" href="#tab_region_settings">Multi-read settings</a></li>
<li><a data-toggle="tab" href="#tab_settings">Single-read settings</a></li>
<li><a data-toggle="tab" href="#tab_bedpe_table_panel">Large variants</a></li>
<li><a data-toggle="tab" href="#tab_variant_input_panel">Small variants</a></li>
<li><a data-toggle="tab" href="#tab_feature_input_panel">Features</a></li>
<li><a data-toggle="tab" href="#tab_automation">Automation</a></li>
</ul>
<div class="tab-content">
<div id="tab_input_alignments" class="tab-pane fade in active">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#url_bam">BAM from URL (recommended)</a></li>
<li><a data-toggle="tab" href="#bam">Local BAM</a></li>
<li><a data-toggle="tab" href="#coords">MUMmer coordinates</a></li>
</ul>
<div class="tab-content">
<!-- Bam input -->
<div id="url_bam" class="tab-pane active">
<input type="text" id="bam_url_input" placeholder="https://" style="width: 100%">
<input type="submit" id="submit_bam_url" value="Load bam file from a URL">
<p>Make sure the bam file exists and that it has a corresponding index (.bai or .csi) file with an identical filename except for the addition of the .bai or .csi suffix.
</p>
<p>You can also load multiple bams, comma-separated.</p>
<strong>Here are some sample BAMs to play with:</strong>
<div id="bam_presets"></div>
</div>
<div id="bam" class="tab-pane">
<p>Select bam and corresponding index (bai/csi)</p>
<input type="file" name="files[]" id="bam_file" multiple />
</div>
<!-- Coords input -->
<div id="coords" class="tab-pane">
<p>To use a .delta file from aligning assemblies/genomes with MUMmer's nucmer, run MUMmer's <pre>show-coords -lTH</pre> on it to get coordinates to load here.</p>
<input type="file" id="coords_file" />
<h4>Instructions</h4>
The coordinates must be the same as MUMmer's show-coords -lTH. This means 11 tab-separated columns without a header: <ol><li>Ref start</li><li>Ref end</li><li>Query start</li><li>Query end</li><li>Ref alignment length</li><li>Query alignment length</li><li>Percent Identity</li><li>Total reference length</li><li>Total query length</li><li>Reference name(chromosome)</li><li>Query_name</li></ol>
</div>
</div>
</div>
<div id="tab_data_description" class="tab-pane fade">
<p>Information about the data and settings</p>
<div id="user_notes">
<label>Notes</label>
<textarea class="form-control" id="notes" placeholder="Add notes here (not saved)"></textarea>
</div>
<div>
<label>Alignment file(s)</label>
<div id="text_alignment_file_output"></div>
</div>
<div class="hide_when_no_variants">
<label>Variant file</label>
<div id="text_variant_file_output"></div>
</div>
<div>
<label>Selected region</label>
<div id="text_region_output">(No region selected)</div>
</div>
<div class="when_bam_file_only">
<label>Bam file queried</label>
<div id="bam_fetch_info">(No bam file queried)</div>
</div>
<hr>
<div class="input-group">
<input type="text" class="form-control" id="permalink_name" placeholder="Type permalink name...">
<span class="input-group-btn">
<button class="btn btn-secondary" id="generate_permalink_button" type="button">Share permalink</button>
</span>
</div>
<hr>
<button id="screenshot_top">Download top view as png</button>
<button id="screenshot_bottom">Download bottom view as png</button>
</div>
<div id="tab_region_settings" class="tab-pane fade">
<h3>Settings for the reference</h3>
<table class="settings_table">
<col width="45%">
<col width="20%">
<col width="30%">
<tr><th colspan="3">Filter reference chromosomes</th></tr>
<tr>
<td>Zoom to chromosome</td>
<td><p id="chrom_highlighted">all</p></td>
<td>
<div id="chrom_livesearch"></div>
<button class="btn btn-secondary" type="button" id="show_all_refs">Show all</button></span>
</td>
</tr>
<tr>
<td>Minimum number of alignments:</td>
<td><p id="min_aligns_for_ref_interval_label">1</p></td>
<td> <div class="slider" id="min_aligns_for_ref_interval_slider"></div> </td>
</tr>
<tr>
<td>Maximum chromosome length:</td>
<td><input class="snug" type="number" id="max_ref_length_input"></td>
<!-- <td><span id="max_ref_length_input"></span> </td> -->
<td> <div class="slider" id="max_ref_length_slider"></div> </td>
</tr>
<tr><th colspan="3">Reference settings</th></tr>
<tr>
<td>Color scheme:</td>
<td colspan="2">
<select class="form-control" id="ribbon_color_scheme_dropdown">
</select>
</td>
</tr>
<tr>
<td>Collapse reference sequences within distance:</td>
<td><input id="margin_to_merge_ref_intervals" type="number" value="10000"></td>
</tr>
<tr>
<td>Draw black border on selected region</td>
<td><input id="draw_focus_rectangle" type="checkbox" checked></td>
</tr>
</table>
<h3>Settings for read alignments</h3>
<table class="settings_table">
<col width="45%">
<col width="20%">
<col width="30%">
<tr><th colspan="3">Filter reads</th></tr>
<tr><td>Number of alignments:</td>
<td> <span id="num_aligns_range_label"></span> </td>
<td> <div class="slider" id="num_aligns_range_slider"></div> </td>
</tr>
<tr>
<td>Minimum read length:</td>
<td><input class="snug" type="number" id="min_read_length_input"></input> </td>
<td> <div class="slider" id="min_read_length_slider"></div> </td>
</tr>
<tr>
<td id="region_min_mq_title" >Minimum mapping quality: </td>
<td><span id="region_mq_label">0</span></td>
<td><div class="slider" id="region_mq_slider"></div></td>
</tr>
<tr><th colspan="3">Read settings</th></tr>
<tr>
<td>Sort reads vertically:</td>
<td colspan="2">
<select class="form-control" id="read_sorting_dropdown">
</select>
</td>
</tr>
<tr>
<td>Orient reads by:</td>
<td colspan="2">
<select class="form-control" id="read_orientation_dropdown">
</select>
</td>
</tr>
<tr>
<td>Color reads by:</td>
<td colspan="2">
<select class="form-control" id="color_alignments_by">
</select>
</tr>
<tr><th colspan="3">Fetching from a bam file</th></tr>
<tr>
<td colspan="2">Margin around a locus where reads will be pulled from a bam file:</td>
<td><input type="number" style="width: 80%" id="bam_fetch_margin" value="100"> bp</td>
</tr>
<tr><td colspan="3">
Alignments that overlap this locus or within those number of basepairs of the locus will be loaded when a region is navigated to.
Use this parameter carefully as importing too much data can crash your web browser due to memory overload.
This takes effect when a new locus is navigated to.
</td></tr>
</table>
<div id="feature_filter_settings_div">
<h3>Filter features by type</h3>
<table id="feature_type_table"></table>
</div>
<table class="settings_table">
<col width="30%">
<col width="50%">
<col width="20%">
<tr><th colspan="3" class="hide_for_coords">Indels</th></tr>
<tr>
<td class="hide_for_coords">Show indels as:</td>
<td colspan="2">
<select class="form-control" id="show_indels_as_dropdown">
</select>
</td>
</tr>
<tr><th class="when_features_only" colspan="3">Features</th></tr>
<tr>
<td class="when_features_only">Show features as:</td>
<td colspan="2">
<select class="form-control" id="show_features_as_dropdown">
</select>
</td>
</tr>
<tr><th colspan="3" class="when_variants_only">Variants</th></tr>
<tr class="when_variants_only">
<td colspan="2">Show only the chosen variant when others are in view</td>
<td><input id="show_only_selected_variants" type="checkbox"></td>
</tr>
</table>
</div>
<div id="tab_settings" class="tab-pane fade">
<p>Settings for the single-read (bottom) view</p>
<div id="ribbon_vs_dotplot_container">
<label class="radio-inline">
<input class="ribbon_vs_dotplot" id="select_ribbon" type="radio" name="ribbon_vs_dotplot" value="ribbon">Ribbon plot
</label>
<label class="radio-inline">
<input class="ribbon_vs_dotplot" id="select_dotplot" type="radio" name="ribbon_vs_dotplot" value="dotplot">Dot plot
</label>
</div>
<table class="settings_table">
<col width="50%">
<col width="20%">
<col width="30%">
<tr>
<th colspan="3">Selected read</th>
</tr>
<tr>
<td style="width:100%" colspan="3"><div id="text_read_output"></div></td>
</tr>
<tr>
<td>Search reads:</td>
<td colspan="2">
<div id="readname_livesearch"></div>
</td>
</tr>
</table>
<table class="settings_table">
<col width="50%">
<col width="20%">
<col width="30%">
<tr>
<td>Match reference from region view </td>
<td><input id="ref_match_region_view" type="checkbox" checked></td>
</tr>
<tr>
<td>Highlight selected read</td>
<td><input id="highlight_selected_read" type="checkbox" checked></td>
</tr>
<tr>
<td class="hide_for_coords">Minimum indel size to split: </td>
<td class="hide_for_coords"><span id="indel_size_label">inf</span></td>
<td><div class="slider" id="indel_size_slider"></div></td>
</tr>
<tr class="ribbon_settings">
<td>Alignment outlines on ribbon plot: </td>
<td><input id="outline_checkbox" type="checkbox" checked/></td>
</tr>
<!-- <tr class="dotplot_settings"><th colspan="3">Dot plot settings</th></tr> -->
<tr class="dotplot_settings">
<td>Colors on dotplot: </td>
<td><input id="colors_checkbox" type="checkbox" checked/></td>
</tr>
<!-- <tr class="ribbon_settings"><th colspan="3">Ribbon plot settings</th></tr> -->
</table>
<h3>Filter alignments</h3>
<table class="settings_table">
<col width="50%">
<col width="20%">
<col width="30%">
<tr>
<td id="min_mq_title">Minimum mapping quality: </td>
<td><span id="mq_label">0</span></td>
<td><div class="slider" id="mq_slider"></div></td>
</tr>
<tr>
<td>Minimum alignment length: </td>
<td><span id="align_length_label">inf</span></td>
<td><div class="slider" id="align_length_slider"></div></td>
</tr>
</table>
</div>
<div id="tab_variant_input_panel" class="tab-pane fade">
<div>
<p>Upload a .vcf</p>
<input type="file" id="variant_file" />
</div>
<div id="variant_table_box" style="display: none;">
<p> Showing only the first 1000 variants. Sort by clicking column names. Filter by typing =chr20, >2000, etc. for each column. For bam files, click on a row in the table to fetch reads around that feature. </p>
<div id="ribbon_variant_table_landing" class="scrollable_table_landing">
<!-- superTable creates a table here out of _Variants -->
</div>
</div>
<div>
Upload a vcf file of variants to look at.
<p> Requirements: columns: </p><ol><li>chromosome (reference) </li><li> position (reference)</li><li>ID (optional)</li></ol>
The 8th column may contain optional information including STRAND (+/-), TYPE or SVTYPE, and END (the end position where the 2nd column is the start). All optional fields can be used for filtering or showing tooltips with information, but only the first 2 columns are required for basic functionality.
</div>
</div>
<div id="tab_feature_input_panel" class="tab-pane fade">
<div>
<p>Upload a bed file with genes, repeats, or any other types of elements you want to annotate</p>
<input type="file" id="ribbon_feature_bed_file" />
</div>
<div id="feature_table_box" style="display: none">
<p>Showing only the first 1000 features. Sort by clicking column names. Filter by typing queries into text input boxes, e.g. =17, >200.</p>
<div id="feature_table_landing" class="scrollable_table_landing">
<!-- superTable creates a table here out of _Features -->
</div>
</div>
</div>
<div id="tab_bedpe_table_panel" class="tab-pane fade">
<p>Please load large variants through SplitThreader, then they will appear here.</p>
<p>Large variants are those that split reads into multiple alignments, e.g. translocations and other variants between positions more than around 1kb apart.
These are shown as connections. The smaller variants can be loaded under the "Small variants" tab.
</p>
<div id="bedpe_table_box">
<p> Showing only the first 1000 variants. Sort by clicking column names, and filter by typing into the text boxes for each column. For instance, type >20 or =chr2. Separate multiple filters in a single column using spaces. For bam files, click on a row in the table to fetch reads around that feature. </p>
<div id="bedpe_table_landing" class="scrollable_table_landing">
<!-- superTable creates a table here out of _Bedpe -->
</div>
</div>
</div>
<div id="tab_automation" class="tab-pane fade">
<h3>Automate Ribbon</h3>
<p>
Make Ribbon automatically go to each variant in a bedpe file and take pictures of the multi-read view and a selection of reads. Instructions: Load a bedpe file and a bam file first, set all the settings below and in the other tabs to include any data, filters, or other settings that you want applied on all loci during automation. Then click Run below.
</p>
<table>
<tr>
<td>Prefix for image files</td>
<td><input type="text" id="automation_file_prefix" value="Auto-Ribbon"></td>
</tr>
<tr>
<td>Number of reads to take pictures of (randomly selected)</td>
<td><input type="number" id="automation_max_reads_to_screenshot" value="5"></td>
</tr>
<tr>
<td>Print variant coordinates onto multi-read view</td>
<td><input type="checkbox" id="add_coordinates_to_figures"></td>
</tr>
<tr>
<td>Download a file with info and coordinates for each variant alongside the images</td>
<td><input type="checkbox" id="automation_download_info"></td>
</tr>
<tr>
<td>Only select reads with alignments that start or end near the bedpe variant</td>
<td><input type="checkbox" id="automation_pick_split_reads" checked></td>
</tr>
<tr>
<td>Margin for selecting reads as being "near" the variant of interest (bp). Check box above for this to take effect.</td>
<td><input type="number" id="automation_margin_for_split" value="1000"></td>
</tr>
<tr>
<td>If a region is too large for the browser to load, automatically subsample</td>
<td><input type="checkbox" id="automation_subsample" checked></td>
</tr>
<tr>
<td></td>
<td><button class="btn btn-secondary" id="run_automation_button" type="button">Run!</button></td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="splitthreader-app-container" class="tab-pane">
<div id="main_body_container">
<ul class="nav nav-tabs">
<li id="nav_tab_splitthreader_setup" class="nav_tab_splitthreader active in"><a data-toggle="tab" href="#setup_tab">Setup</a></li>
<li id="nav_tab_splitthreader_viz"><a data-toggle="tab" href="#visualizer_tab">Visualizer</a></li>
<li id="nav_tab_splitthreader_analysis" class="nav_tab_splitthreader"><a data-toggle="tab" href="#variant_analysis_tab">Variant analysis</a></li>
<li id="nav_tab_splitthreader_fusions" class="nav_tab_splitthreader"><a data-toggle="tab" href="#gene_fusions_tab">Gene fusions</a></li>
<li id="nav_tab_splitthreader_graph" class="nav_tab_splitthreader"><a data-toggle="tab" href="#feature_search_tab">Graph search</a></li>
</ul>
<div class="tab-content">
<div id="setup_tab" class="tab_splitthreader tab-pane fade in active">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
Upload a coverage file
<span id="splitthreader_status_coverage_loaded" class="label label-success hidden">Done</span>
</h4>
</div>
<div class="panel-body">
<p>Upload a bed file of coverage</p>
<input type="file" id="input_coverage_file" />
<p>
<label>Instructions: </label>
We recommend using mosdepth to generate a bed file of coverage. The bed file should have the first three columns as chromosome, start, and end, and the fourth column as the coverage.
<pre>
mosdepth -n --fast-mode --by 10000 output_file_prefix read_alignments.bam
</pre>
</p>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
Upload structural variants
<span id="splitthreader_status_variant_loaded" class="label label-success hidden">Done</span>
</h4>
</div>
<div class="panel-body">
Note: SplitThreader is only useful for large rearrangement variants, so only variants over 1kb in size and interchromosomal variants will be used.
There are two formats supported for variants: VCF and BEDPE.
<h3>VCF</h3>
<div class="alert alert-warning" role="alert">
VCF loading is in beta. Currently only BND variants will be used in SplitThreader, and some VCFs from different variant callers may not work.
If you have a VCF available publicly that doesn't work, please file a <a href="https://github.com/MariaNattestad/Ribbon/issues">Github issue</a> with a link to the VCF, and we'll see if we can support it.
</div>
.vcf or .vcf.gz are both fine.
<p>Upload a VCF of structural variants</p>
<input type="file" id="splitthreader_vcf_file" />
<!-- Input by URL: -->
<p>Or, load a VCF from a URL</p>
<input type="text" id="splitthreader_vcf_url" placeholder="https://" style="width: 300px;" />
<input type="submit" id="splitthreader_vcf_url_button" />
<hr>
<h3>Bedpe</h3>
<p>Upload a bedpe file of structural variants</p>
<input type="file" id="splitthreader_bedpe_file" />
<div>
<label>Instructions: </label>
Some variant callers produce bedpe files, so you can load that instead of a VCF.
The bedpe file should have the following columns (comma or tab separated both work).
<p>Here's an example:</p>
<pre>
chrom1,start1,stop1,chrom2,start2,stop2,variant_name,score,strand1,strand2,variant_type,split
1,168186489,168186572,1,182274072,182274331,540,-1,+,+,INV,15
1,152555137,152555830,1,152587256,152588236,671,-1,+,-,DEL,34
</pre>
</div>
</div>
</div>
</div>
<!-- Variant settings -->
<div id="visualizer_tab" class="tab-pane fade">
<div id="svg_landing"></div>
<div id="right_panel_splitthreader">
<div class="panel-group ">
<div id="user_message_splitthreader"></div>
<div id="variant_details_box" class="well" style="overflow: scroll;">
<span id="variant_detail_text">Click on a variant to show detail</span>
<div id="variant_detail_landing"></div>
<button id="jump_to_variant_in_ribbon" style="visibility: hidden" class="btn btn-info">
Jump to variant in Ribbon
</button>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" class="active" href="#settings_panel">Tools</a>
</h4>
</div>
<div class="panel-collapse collapse in" id="settings_panel">
<div class="panel-body">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#gene_settings">Genes</a></li>
<li><a data-toggle="tab" href="#variant_settings">Variants</a></li>
<li><a data-toggle="tab" href="#explore_tab">Explore</a></li>
<li><a data-toggle="tab" href="#settings_splitthreader">Settings</a></li>
</ul>
<div class="tab-content">
<!-- Gene settings -->
<div id="gene_settings" class="tab-pane fade in active">
<label for="splitthreader_color_scheme_dropdown">Annotation:</label>
<select class="form-control" id="annotation_dropdown">
</select>
<div id="show_genes_box">
<label>Label genes:</label>
<div id="gene_livesearch"></div>
<label>Genes labeled:</label> (click to show/hide)
<div>
<ul id="genes_labeled" class="gene_list"></ul>
</div>
</div>
<div id="gene_type_table_box">
<table id="gene_type_table"></table>
</div>
<div class="checkbox">
<label><input id="hide_local_gene_names" type="checkbox">Hide gene names for types selected in table above</label>
</div>
</div>
<!-- Variants -->
<div id="variant_settings" class="tab-pane fade">
<label>Filter variants:</label>
<table id="variant_type_table"></table>
</div>
<!-- Settings -->
<div id="settings_splitthreader" class="tab-pane fade">
<table class="settings_table">
<col width="50%">
<col width="50%">
<tr>
<td>Divide coverage by:</td>
<td><input id="coverage_divisor" type="number" value="1"></td>
</tr>
<tr class="only_when_features">
<td>Show features</td>
<td><input id="show_features" type="checkbox" checked></td>
</tr>
<tr>
<td><label for="splitthreader_color_scheme_dropdown">Color scheme:</label></td>
<td><select class="form-control" id="splitthreader_color_scheme_dropdown"></select></td>
</tr>
<tr>
<td>Publication style plot</td>
<td><input id="publication_style_plot_checkbox" type="checkbox" ></td>
</tr>
<tr>
<td>
<button id="take_screenshot">Download screenshot</button>
</td>
</tr>
<tr><td colspan="2"><hr><label>Filter variants:</label></td></tr>
<tr>
<td>Minimum variant size: </td>
<td><input id="min_variant_size" class="filter_input" type="number"></td>
</tr>
<tr>
<td>Minimum split reads:</td>
<td><input id="min_split_reads" class="filter_input" type="number"></td>
</tr>
<tr>
<td>Minimum discordant pairs:</td>
<td><input id="min_discordant_pairs" class="filter_input" type="number"></td>
</tr>
<tr>
<td>Minimum miscellaneous read evidence:</td>
<td><input id="min_other_read_evidence" class="filter_input" type="number"></td>
</tr>
<tr>
<td>
<button id="submit_filters">Submit</button>
</td>
</tr>
</table>
</div>
<!-- Explore -->
<div id="explore_tab" class="tab-pane fade">
<p><label>Send to UCSC genome browser</label></p>
<p>Database: <span id="ucsc_database">hg19 </span></p>
<p><a id="ucsc_go_top" target="_blank" >Top: <span id="top_position"></span></a></p>
<p><a id="ucsc_go_bottom" target="_blank" >Bottom: <span id="bottom_position"></span></a></p>
<p>(change database in Genes tab under annotation)</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div> <!-- end of right panel -->
</div> <!-- end of visualizer tab -->
<div id="variant_analysis_tab" class="tab_splitthreader tab-pane fade">
<div class="row">
<div class="col-md-5">
<svg id="histogram_landing"></svg>
</div>
<div class="col-md-2">
<div id="statistics_landing">
<p><label>Mean coverage: </label><span id="mean_copynumber"></span></p>
<p><label>Total number of variants: </label><span class="number_of_variants"></span></p>
<p><label>Number of interchromosomal variants: </label><span id="num_interchromosomal"></span></p>
<p><label>Number of variants after filtering in table below: </label> <span class="filtered_number_of_variants"></span></p>
</div>
</div>
<div class="col-md-5">
<div id="variant_category_tables_landing">
<!-- <table id="variant_category_table"></table> -->
</div>
<div id="variant_category_matrix_settings">
<table class="settings_table">
<col width="70%">
<col width="30%">
<tr><td colspan="2"><hr><label>Categorization parameters</label></td></tr>
<tr>
<td>Distance threshold for CNV matching and nearby variant count: </td>
<td><input id="margin_for_nearby" class="categorization_parameter_input" type="number" value="100000"></td>
</tr>
<tr>
<td>Distance threshold for reciprocal pair of variants: </td>
<td><input id="margin_for_reciprocal" class="categorization_parameter_input" type="number" value="10000"></td>
</tr>
<tr>
<td>
<button id="submit_category_parameters">Submit</button>
</td>
</tr>
</table>
</div>
</div>
</div> <!-- end of row -->
<p>Showing up to 1000 variants out of <span class="filtered_number_of_variants"></span>. Unfiltered, there are <span class="number_of_variants"></span> variants</p>
<p>Filter in text boxes by =,>, or <, and click column names to sort. Click on a row in the table to see that variant in the visualizer</p>
<div class="scrollable_table_landing" id="splitthreader_variant_table_landing"></div>
<div id="table_export_buttons">
<a class="btn btn-info" id="export_variant_table_to_csv">Export table as csv</a>
</div>
</div> <!-- end variant analysis tab -->
<!-- Gene fusions -->
<div id="gene_fusions_tab" class="tab_splitthreader tab-pane fade">
<div class="alert alert-info" role="alert">
Enter gene names by hand or upload a list, and SplitThreader will use its rearrangement graph to search for genomic connections between each pair of genes.
</div>
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
Enter gene names
</h4>
</div>
<div class="panel-body">
<div id="gene_fusion_input">
<div class="gene_search_box">
Gene 1
<div id="fusion_gene1_livesearch"></div>
</div>
<div class="gene_search_box">
Gene 2
<div id="fusion_gene2_livesearch"></div>
</div>
<div class="row">
<div class="gene_search_box">
Selected: <span id="gene1">(none)</span>
</div>
<div class="gene_search_box">
Selected: <span id="gene2">(none)</span>
</div>
<button id="submit_fusion">Submit</button>
</div>
</div>
<label>Instructions:</label>
<p>
Start typing a gene name into the input box and click on the gene you want (or use the arrow genes to walk up and down the list and press enter on the gene you want). Select two genes and then click the Submit button to search the rearrangement graph for a connection between the two genes.
</p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
Upload a list
</h4>
</div>
<div class="panel-body">
<p>Upload a list of gene fusions</p>
<input type="file" id="gene_fusion_file" />
<hr>
<label>Instructions:</label>
<p>
The file should have a pair of genes on each line separated by tabs, commas, or spaces, with the gene names in the first two columns matching the annotation.
</p>
</div>
</div>
</div>
</div> <!-- end of row -->
<div id="show_when_fusions_submitted">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
Shortest paths found:
</h4>
</div>
<div class="panel-body">
<div class="scrollable_table_landing" id="gene_fusion_table_landing"></div>
<label>Instructions:</label>
<p>
Click on a row in the table to jump to each gene fusion in the visualizer.
"distance" is the number of basepairs in the path between the two genes. "num_variants" indicates the number of variants this path threads through in the graph. "path_chromosomes" shows all the chromosomes found along the path.
If the genes have a direct connection that intersects both genes, the distance will be 0, num_variants will be 1, and path_chromosomes will be only the chromosomes the genes themselves reside on.
</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
Parameters
</h4>
</div>
<div class="panel-body">
<table class="settings_table">
<col width="70%">
<col width="30%">
<tr>
<td>Max bp distance to search:</td>
<td><input id="max_fusion_distance" type="number" value=1000000></td>
</tr>
</table>
</div>
</div>
</div> <!-- end of gene fusions tab -->
<div id="feature_search_tab" class="tab_splitthreader tab-pane fade">
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
From
</h4>
</div>
<div class="panel-body">
<label class="radio-inline">
<input type="radio" name="search_from" value="genes">Genes
</label>
<label class="radio-inline">
<input type="radio" name="search_from" value="features">Bed file
</label>
<p>Number of starting points: <span id="search_from_item_count"></span></p>
<div class="scrollable_table_landing" id="search_from_table_landing">
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
To
</h4>
</div>
<div class="panel-body">
<label class="radio-inline">
<input type="radio" name="search_to" value="genes">Genes
</label>
<label class="radio-inline">
<input type="radio" name="search_to" value="features">Bed file
</label>
<p>Number of target end-points: <span id="search_to_item_count"></span></p>
<div class="scrollable_table_landing" id="search_to_table_landing">
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
Calculate distances across the graph
</h4>
</div>
<div class="panel-body">
<button id="graph_search_button">Calculate</button>
<hr>
<label>Instructions:</label>
<p>
Use the tables in the "From" and "To" panels above to filter down to the intervals you want to search between. Then click "Calculate" to get a result for each interval in "From", finding its closest interval among all the possible intervals in the "To" table.
</p>
<div class="show_after_graph_search">
<p>
Click on one of the results in the table to show the path in the visualizer.
</p>
<p>
Found results for <span id="froms_matched_count">X</span> out of <span id="total_froms_count">N</span> total intervals in the "From" table. Showing a subset, but filter and sort works on the whole set (as with all tables in SplitThreader).
</p>
<!-- Export options -->
<label>Export gene fusions</label>
<p>
<a class="btn btn-info" id="export_search_results_to_csv">Export table as csv</a>
</p>
<!-- end of export options -->
</div>
<div class="scrollable_table_landing" id="feature_search_table_landing"></div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
Upload a bed file
</h4>
</div>
<div class="panel-body">
<p>Upload a bed file of features</p>
<input type="file" id="splitthreader_feature_bed_file" />
<p>
<label>Instructions: </label>
Upload a bed file containing features to calculate distances between any sets of features and genes.
</p>