forked from faryabiLab/too-many-cells
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
1563 lines (1388 loc) · 59.1 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
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>too-many-cells</title>
<meta name="generator" content="Org mode" />
<meta name="author" content="Gregory W. Schwartz" />
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
font-size: medium;
font-weight: bold;
margin-top:0; }
.todo { font-family: monospace; color: red; }
.done { font-family: monospace; color: green; }
.priority { font-family: monospace; color: orange; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
pre {
border: 1px solid #ccc;
box-shadow: 3px 3px 3px #eee;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}
pre.src {
position: relative;
overflow: visible;
padding-top: 1.2em;
}
pre.src:before {
display: none;
position: absolute;
background-color: white;
top: -10px;
right: 10px;
padding: 3px;
border: 1px solid black;
}
pre.src:hover:before { display: inline;}
/* Languages per Org manual */
pre.src-asymptote:before { content: 'Asymptote'; }
pre.src-awk:before { content: 'Awk'; }
pre.src-C:before { content: 'C'; }
/* pre.src-C++ doesn't work in CSS */
pre.src-clojure:before { content: 'Clojure'; }
pre.src-css:before { content: 'CSS'; }
pre.src-D:before { content: 'D'; }
pre.src-ditaa:before { content: 'ditaa'; }
pre.src-dot:before { content: 'Graphviz'; }
pre.src-calc:before { content: 'Emacs Calc'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-fortran:before { content: 'Fortran'; }
pre.src-gnuplot:before { content: 'gnuplot'; }
pre.src-haskell:before { content: 'Haskell'; }
pre.src-hledger:before { content: 'hledger'; }
pre.src-java:before { content: 'Java'; }
pre.src-js:before { content: 'Javascript'; }
pre.src-latex:before { content: 'LaTeX'; }
pre.src-ledger:before { content: 'Ledger'; }
pre.src-lisp:before { content: 'Lisp'; }
pre.src-lilypond:before { content: 'Lilypond'; }
pre.src-lua:before { content: 'Lua'; }
pre.src-matlab:before { content: 'MATLAB'; }
pre.src-mscgen:before { content: 'Mscgen'; }
pre.src-ocaml:before { content: 'Objective Caml'; }
pre.src-octave:before { content: 'Octave'; }
pre.src-org:before { content: 'Org mode'; }
pre.src-oz:before { content: 'OZ'; }
pre.src-plantuml:before { content: 'Plantuml'; }
pre.src-processing:before { content: 'Processing.js'; }
pre.src-python:before { content: 'Python'; }
pre.src-R:before { content: 'R'; }
pre.src-ruby:before { content: 'Ruby'; }
pre.src-sass:before { content: 'Sass'; }
pre.src-scheme:before { content: 'Scheme'; }
pre.src-screen:before { content: 'Gnu Screen'; }
pre.src-sed:before { content: 'Sed'; }
pre.src-sh:before { content: 'shell'; }
pre.src-sql:before { content: 'SQL'; }
pre.src-sqlite:before { content: 'SQLite'; }
/* additional languages in org.el's org-babel-load-languages alist */
pre.src-forth:before { content: 'Forth'; }
pre.src-io:before { content: 'IO'; }
pre.src-J:before { content: 'J'; }
pre.src-makefile:before { content: 'Makefile'; }
pre.src-maxima:before { content: 'Maxima'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-picolisp:before { content: 'Pico Lisp'; }
pre.src-scala:before { content: 'Scala'; }
pre.src-shell:before { content: 'Shell Script'; }
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
/* additional language identifiers per "defun org-babel-execute"
in ob-*.el */
pre.src-cpp:before { content: 'C++'; }
pre.src-abc:before { content: 'ABC'; }
pre.src-coq:before { content: 'Coq'; }
pre.src-groovy:before { content: 'Groovy'; }
/* additional language identifiers from org-babel-shell-names in
ob-shell.el: ob-shell is the only babel language using a lambda to put
the execution function name together. */
pre.src-bash:before { content: 'bash'; }
pre.src-csh:before { content: 'csh'; }
pre.src-ash:before { content: 'ash'; }
pre.src-dash:before { content: 'dash'; }
pre.src-ksh:before { content: 'ksh'; }
pre.src-mksh:before { content: 'mksh'; }
pre.src-posh:before { content: 'posh'; }
/* Additional Emacs modes also supported by the LaTeX listings package */
pre.src-ada:before { content: 'Ada'; }
pre.src-asm:before { content: 'Assembler'; }
pre.src-caml:before { content: 'Caml'; }
pre.src-delphi:before { content: 'Delphi'; }
pre.src-html:before { content: 'HTML'; }
pre.src-idl:before { content: 'IDL'; }
pre.src-mercury:before { content: 'Mercury'; }
pre.src-metapost:before { content: 'MetaPost'; }
pre.src-modula-2:before { content: 'Modula-2'; }
pre.src-pascal:before { content: 'Pascal'; }
pre.src-ps:before { content: 'PostScript'; }
pre.src-prolog:before { content: 'Prolog'; }
pre.src-simula:before { content: 'Simula'; }
pre.src-tcl:before { content: 'tcl'; }
pre.src-tex:before { content: 'TeX'; }
pre.src-plain-tex:before { content: 'Plain TeX'; }
pre.src-verilog:before { content: 'Verilog'; }
pre.src-vhdl:before { content: 'VHDL'; }
pre.src-xml:before { content: 'XML'; }
pre.src-nxml:before { content: 'XML'; }
/* add a generic configuration mode; LaTeX export needs an additional
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
pre.src-conf:before { content: 'Configuration File'; }
table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.org-right { text-align: center; }
th.org-left { text-align: center; }
th.org-center { text-align: center; }
td.org-right { text-align: right; }
td.org-left { text-align: left; }
td.org-center { text-align: center; }
dt { font-weight: bold; }
.footpara { display: inline; }
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
.equation-container {
display: table;
text-align: center;
width: 100%;
}
.equation {
vertical-align: middle;
}
.equation-label {
display: table-cell;
text-align: right;
vertical-align: middle;
}
.inlinetask {
padding: 10px;
border: 2px solid gray;
margin: 10px;
background: #ffffcc;
}
#org-div-home-and-up
{ text-align: right; font-size: 70%; white-space: nowrap; }
textarea { overflow-x: auto; }
.linenr { font-size: smaller }
.code-highlighted { background-color: #ffff00; }
.org-info-js_info-navigation { border-style: none; }
#org-info-js_console-label
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
.org-svg { width: 90%; }
/*]]>*/-->
</style>
<link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/styles/readtheorg/css/htmlize.css"/>
<link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/styles/readtheorg/css/readtheorg.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://fniessen.github.io/org-html-themes/styles/lib/js/jquery.stickytableheaders.min.js"></script>
<script type="text/javascript" src="https://fniessen.github.io/org-html-themes/styles/readtheorg/js/readtheorg.js"></script>
<script type="text/javascript">
/*
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2019 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
General Public License (GNU GPL) as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version. The code is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
As additional permission under GNU GPL version 3 section 7, you
may distribute non-source (e.g., minimized or compacted) forms of
that code without the copy of the GNU GPL normally required by
section 4, provided you include this license notice and a URL
through which recipients can access the Corresponding Source.
@licend The above is the entire license notice
for the JavaScript code in this tag.
*/
<!--/*--><![CDATA[/*><!--*/
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.cacheClassElem = elem.className;
elem.cacheClassTarget = target.className;
target.className = "code-highlighted";
elem.className = "code-highlighted";
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(elem.cacheClassElem)
elem.className = elem.cacheClassElem;
if(elem.cacheClassTarget)
target.className = elem.cacheClassTarget;
}
/*]]>*///-->
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
displayAlign: "center",
displayIndent: "0em",
"HTML-CSS": { scale: 100,
linebreaks: { automatic: "false" },
webFont: "TeX"
},
SVG: {scale: 100,
linebreaks: { automatic: "false" },
font: "TeX"},
NativeMML: {scale: 100},
TeX: { equationNumbers: {autoNumber: "AMS"},
MultLineWidth: "85%",
TagSide: "right",
TagIndent: ".8em"
}
});
</script>
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML"></script>
</head>
<body>
<div id="content">
<h1 class="title">too-many-cells</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org331b3fb">Description</a></li>
<li><a href="#org5de72b7">New features for current version</a></li>
<li><a href="#org6e9de18">Installation</a>
<ul>
<li><a href="#orgb4212d3">Dependencies</a></li>
<li><a href="#org93b67d3">Install <code>stack</code></a></li>
<li><a href="#org1a96cc7">Install <code>too-many-cells</code></a>
<ul>
<li><a href="#org3b9ff14">Source</a></li>
<li><a href="#orgda80eeb">Online</a></li>
<li><a href="#orgfa5dc10">Docker</a></li>
</ul>
</li>
<li><a href="#org062a8b4">macOS</a></li>
</ul>
</li>
<li><a href="#orgc10e04e">Troubleshooting</a>
<ul>
<li><a href="#org0b69ba6">I am getting errors like <code>AesonException "Error in $.packages.cassava.constraints.flags...</code> when running <code>stack</code> commands</a></li>
<li><a href="#orgd8b1230">I use conda or custom ld library locations and I cannot install <code>too-many-cells</code> or run into weird R errors</a></li>
<li><a href="#orgddfdc24">I am still having issues with installation</a></li>
</ul>
</li>
<li><a href="#org478cc02">Included projects</a></li>
<li><a href="#org94e26ec">Usage</a>
<ul>
<li><a href="#org0ca31b8"><code>make-tree</code></a>
<ul>
<li><a href="#org516edb5">Output</a></li>
<li><a href="#org5f8735d">Outline with options</a></li>
<li><a href="#org7a8f497">Example</a></li>
</ul>
</li>
<li><a href="#org1135c8b"><code>interactive</code></a></li>
<li><a href="#org018dacf"><code>differential</code></a></li>
<li><a href="#orgc8c6e96"><code>diversity</code></a></li>
<li><a href="#org10a19e3"><code>paths</code></a></li>
</ul>
</li>
<li><a href="#orgbf7fa57">Advanced documentation</a></li>
<li><a href="#org2a772db">Demo</a></li>
</ul>
</div>
</div>
<p>
<a href="https://gregoryschwartz.github.io/too-many-cells/">Website</a>
</p>
<p>
See <a href="https://github.com/GregorySchwartz/too-many-cells">https://github.com/GregorySchwartz/too-many-cells</a> for latest version.
</p>
<p>
See <a href="https://www.biorxiv.org/content/10.1101/519660v1">the bioRxiv paper</a> for more information about the algorithm.
</p>
<div class="figure">
<p><img src="img/pruned_tree.png" alt="pruned_tree.png" />
</p>
</div>
<div id="outline-container-org331b3fb" class="outline-2">
<h2 id="org331b3fb">Description</h2>
<div class="outline-text-2" id="text-org331b3fb">
<p>
<code>too-many-cells</code> is a suite of tools, algorithms, and visualizations focusing on
the relationships between cell clades. This includes new ways of clustering,
plotting, choosing differential expression comparisons, and more! While
<code>too-many-cells</code> was intended for single cell RNA-seq, any abundance data in any
domain can be used. Rather than opt for a unique positioning of each cell using
dimensionality reduction approaches like t-SNE and PCA, <code>too-many-cells</code>
recursively divides cells into clusters and relates clusters rather than
individual cells. In fact, by recursively dividing until further dividing would
be considered noise or random partitioning, we can eliminate noisy relationships
at the fine-grain level. The resulting binary tree serves as a basis for a
different perspective of single cells, using our <a href="http://github.com/GregorySchwartz/birch-beer#readme"> <code>birch-beer</code> </a> visualization
and tree measures to describe simultaneously large and small populations,
without additional parameters or runs. See below for a full list of features.
</p>
</div>
</div>
<div id="outline-container-org5de72b7" class="outline-2">
<h2 id="org5de72b7">New features for current version</h2>
<div class="outline-text-2" id="text-org5de72b7">
<ul class="org-ul">
<li>A new R wrapper was written to quickly get data to and from <code>too-many-cells</code>
from R. <a href="https://github.com/GregorySchwartz/tooManyCellsR">Check it out here</a>!</li>
<li>Now works with Cellranger 3.0 matrices in addition to Cellranger 2.0</li>
<li>Can prune (make into leaves) specified nodes with <code>--custom-cut</code>.</li>
</ul>
</div>
</div>
<div id="outline-container-org6e9de18" class="outline-2">
<h2 id="org6e9de18">Installation</h2>
<div class="outline-text-2" id="text-org6e9de18">
<p>
We provide multiple ways to install <code>too-many-cells</code>. We recommend installing
<code>stack</code> (<a href="#org93b67d3">see below</a>), but we also have <a href="#orgfa5dc10">docker</a> images and a <code>Dockerfile</code> to
use in any system in case you have a custom build (for instance, a non-standard
R installation) or difficulty installing. <b>macOS and Windows users:</b>
<code>too-many-cells</code> was built and tested on linux, so we highly recommend using the
<a href="#orgfa5dc10">docker</a> image (which a completely isolated environment which requires no
compiling or installation, other than docker itself) as there may be
difficulties in installing the dependencies. There are, however, additional
instructions for macOS <a href="#orgad5e09e">here</a> if you really want to compile it.
</p>
</div>
<div id="outline-container-orgb4212d3" class="outline-3">
<h3 id="orgb4212d3">Dependencies</h3>
<div class="outline-text-3" id="text-orgb4212d3">
<p>
You may require the following dependencies to build and run (from Ubuntu 14.04,
use the appropriate packages from your distribution of choice):
</p>
<ul class="org-ul">
<li>build-essential</li>
<li>libgmp-dev</li>
<li>libblas-dev</li>
<li>liblapack-dev</li>
<li>libgsl-dev</li>
<li>libgtk2.0-dev</li>
<li>libcairo2-dev</li>
<li>libpango1.0-dev</li>
<li>graphviz</li>
<li>r-base</li>
<li>r-base-dev</li>
</ul>
<p>
To install them, in Ubuntu:
</p>
<div class="org-src-container">
<pre class="src src-shell">sudo apt install build-essential libgmp-dev libblas-dev liblapack-dev libgsl-dev libgtk2.0-dev libcairo2-dev libpango1.0-dev graphviz r-base r-base-dev
</pre>
</div>
<p>
<code>too-many-cells</code> also uses the following packages from R:
</p>
<ul class="org-ul">
<li>cowplot</li>
<li>ggplot2</li>
<li>edgeR</li>
<li>jsonlite</li>
</ul>
<p>
To install them in R,
</p>
<div class="org-src-container">
<pre class="src src-R">install.packages<span style="color: #008787;">(</span>c<span style="color: #d75f87;">(</span><span style="color: #afaf00;">"ggplot2"</span>, <span style="color: #afaf00;">"cowplot"</span>, <span style="color: #afaf00;">"jsonlite"</span><span style="color: #d75f87;">)</span><span style="color: #008787;">)</span>
install.packages<span style="color: #008787;">(</span><span style="color: #afaf00;">"BiocManager"</span><span style="color: #008787;">)</span>
BiocManager::install<span style="color: #008787;">(</span><span style="color: #afaf00;">"edgeR"</span><span style="color: #008787;">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org93b67d3" class="outline-3">
<h3 id="org93b67d3">Install <code>stack</code></h3>
<div class="outline-text-3" id="text-org93b67d3">
<p>
See <a href="https://docs.haskellstack.org/en/stable/README/">https://docs.haskellstack.org/en/stable/README/</a> for more details.
</p>
<div class="org-src-container">
<pre class="src src-sh">curl -sSL https://get.haskellstack.org/ | sh
stack setup
</pre>
</div>
</div>
</div>
<div id="outline-container-org1a96cc7" class="outline-3">
<h3 id="org1a96cc7">Install <code>too-many-cells</code></h3>
<div class="outline-text-3" id="text-org1a96cc7">
</div>
<div id="outline-container-org3b9ff14" class="outline-4">
<h4 id="org3b9ff14">Source</h4>
<div class="outline-text-4" id="text-org3b9ff14">
<p>
Probably the easiest method if you don't want to mess with dependencies (outside
of the ones above).
</p>
<div class="org-src-container">
<pre class="src src-sh">git clone https://github.com/GregorySchwartz/too-many-cells.git
<span style="color: #ff8700;">cd</span> too-many-cells
stack install
</pre>
</div>
</div>
</div>
<div id="outline-container-orgda80eeb" class="outline-4">
<h4 id="orgda80eeb">Online</h4>
<div class="outline-text-4" id="text-orgda80eeb">
<p>
We only require <code>stack</code> (or <code>cabal</code>), you do not need to download any source
code (but you might need the stack.yaml dependency versions), just run the
following command to place <code>too-many-cells</code> in your <code>~/.local/bin/</code>:
</p>
<div class="org-src-container">
<pre class="src src-sh">stack install too-many-cells
</pre>
</div>
<p>
If you run into errors like <code>Error: While constructing the build plan, the
following exceptions were encountered:</code>, then follow it's advice. Usually you
just need to follow the suggestion and add the dependencies to the specified
file. For a quick <code>yaml</code> configuration, refer to
<a href="https://github.com/GregorySchwartz/too-many-cells/blob/master/stack.yaml">https://github.com/GregorySchwartz/too-many-cells/blob/master/stack.yaml</a>. Relies
on <code>eigen-3.3.4.1</code> right now.
</p>
</div>
</div>
<div id="outline-container-orgfa5dc10" class="outline-4">
<h4 id="orgfa5dc10">Docker</h4>
<div class="outline-text-4" id="text-orgfa5dc10">
<p>
Different computers have different setups, operating systems, and repositories.
Do put the entire program in a container to bypass difficulties (with the other
methods above), we user <code>docker</code>. So first, <a href="https://docs.docker.com/">install docker</a>.
</p>
<p>
To get <code>too-many-cells</code> (replace 0.1.5.0 with <a href="https://cloud.docker.com/repository/docker/gregoryschwartz/too-many-cells/general">any version needed</a>):
</p>
<div class="org-src-container">
<pre class="src src-sh">docker pull gregoryschwartz/too-many-cells:0.1.5.0
</pre>
</div>
<p>
To run <code>too-many-cells</code> in a docker container:
</p>
<div class="org-src-container">
<pre class="src src-sh">sudo docker run gregoryschwartz/too-many-cells:0.1.5.0 -h
</pre>
</div>
<p>
Docker won't be able to find your files by default. You need to mount the
folders with <code>-v</code> in order to have docker read and write from and to the
filesystem, respectively. Read the <a href="https://docs.docker.com/storage/volumes/">documentation</a> about volumes for more
information. Essentially, <code>-v /path/to/matrix/on/host:/input_matrix</code> with <code>-m
/input_matrix</code> is what you want, where before the <code>:</code> is on the host filesystem
while after the <code>:</code> is what the docker program sees. Then you can write the
output in the same way: <code>-v /path/to/output/on/host:/output</code> will write the
output to the folder before the <code>:</code>.
</p>
<p>
To build the <code>too-many-cells</code> image yourself if you want:
</p>
<div class="org-src-container">
<pre class="src src-sh">git clone https://github.com/GregorySchwartz/too-many-cells.git
<span style="color: #ff8700;">cd</span> too-many-cells
docker build -t too-many-cells -f ./Dockerfile .
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org062a8b4" class="outline-3">
<h3 id="org062a8b4">macOS</h3>
<div class="outline-text-3" id="text-org062a8b4">
<p>
<a id="orgad5e09e"></a>
</p>
<p>
We recommend using <a href="#orgfa5dc10">docker</a> on macOS. If you need to build <code>too-many-cells</code>, you
should get the above dependencies. For some dependencies, you can use <a href="https://brew.sh/">brewer</a>,
then install <code>too-many-cells</code> (in the cloned folder, don't forget to install the
R dependencies above):
</p>
<div class="org-src-container">
<pre class="src src-shell">brew cask install xquartz
brew install glib cairo gtk gettext fontconfig freetype
brew tap brewsci/bio
brew tap brewsci/science
brew install r zeromq graphviz pkg-config gsl libffi gobject-introspection gtk+ gtk+3
<span style="color: #767676;"># </span><span style="color: #767676;">Needed so pkg-config and libraries can be found.</span>
<span style="color: #767676;"># </span><span style="color: #767676;">For the second path, use the ouput of "brew info libffi".</span>
<span style="color: #ff8700;">export</span> <span style="color: #87afaf;">PKG_CONFIG_PATH</span>=/usr/local/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig
<span style="color: #767676;"># </span><span style="color: #767676;">Tell gtk that it's quartz</span>
stack install --flag gtk:have-quartz-gtk
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-orgc10e04e" class="outline-2">
<h2 id="orgc10e04e">Troubleshooting</h2>
<div class="outline-text-2" id="text-orgc10e04e">
</div>
<div id="outline-container-org0b69ba6" class="outline-3">
<h3 id="org0b69ba6">I am getting errors like <code>AesonException "Error in $.packages.cassava.constraints.flags...</code> when running <code>stack</code> commands</h3>
<div class="outline-text-3" id="text-org0b69ba6">
<p>
Try upgrading stack with <code>stack upgrade</code>. The new installation will be in
<code>~/.local/bin</code>, so use that binary.
</p>
</div>
</div>
<div id="outline-container-orgd8b1230" class="outline-3">
<h3 id="orgd8b1230">I use conda or custom ld library locations and I cannot install <code>too-many-cells</code> or run into weird R errors</h3>
<div class="outline-text-3" id="text-orgd8b1230">
<p>
<code>stack</code> and <code>too-many-cells</code> assume system libraries and programs. To solve this
issue, first install the dependencies above at the system level, including
system <code>R</code>. Then to every <code>stack</code> and <code>too-many-cells</code> command, prepend
<code>PATH="$HOME/.local/bin:/usr/bin:$PATH"</code> to all commands. For instance:
</p>
<ul class="org-ul">
<li><code>PATH="$HOME/.local/bin:/usr/bin:$PATH" stack install</code></li>
<li><code>PATH="$HOME/.local/bin:/usr/bin:$PATH" too-many-cells make-tree -h</code></li>
</ul>
</div>
</div>
<div id="outline-container-orgddfdc24" class="outline-3">
<h3 id="orgddfdc24">I am still having issues with installation</h3>
<div class="outline-text-3" id="text-orgddfdc24">
<p>
<a href="https://github.com/GregorySchwartz/too-many-cells/issues">Open an issue</a>! While working on the issue, try out the docker for
<code>too-many-cells</code>, it requires no installation at all (other than docker).
</p>
</div>
</div>
</div>
<div id="outline-container-org478cc02" class="outline-2">
<h2 id="org478cc02">Included projects</h2>
<div class="outline-text-2" id="text-org478cc02">
<p>
This project is a collection of libraries and programs written specifically for
<code>too-many-cells</code>:
</p>
<dl class="org-dl">
<dt><a href="https://github.com/GregorySchwartz/birch-beer"> <code>birch-beer</code> </a></dt><dd>Generate a tree for displaying a hierarchy of groups with
colors, scaling, and more.</dd>
<dt><a href="https://github.com/GregorySchwartz/modularity"> <code>modularity</code> </a></dt><dd>Find the modularity of a network.</dd>
<dt><a href="https://github.com/GregorySchwartz/spectral-clustering"> <code>spectral-clustering</code> </a></dt><dd>Library for spectral clustering.</dd>
<dt><a href="https://github.com/GregorySchwartz/hierarchical-spectral-clustering"> <code>hierarchical-spectral-clustering</code> </a></dt><dd>Hierarchical spectral clustering of a
graph.</dd>
<dt><a href="https://github.com/GregorySchwartz/differential"> <code>differential</code> </a></dt><dd>Finds out whether an entity comes from different
distributions (statuses).</dd>
</dl>
</div>
</div>
<div id="outline-container-org94e26ec" class="outline-2">
<h2 id="org94e26ec">Usage</h2>
<div class="outline-text-2" id="text-org94e26ec">
<p>
<code>too-many-cells</code> has several entry points depending on the desired analysis.
</p>
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
<col class="org-left" />
<col class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">Argument</th>
<th scope="col" class="org-left">Analysis</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left"><code>make-tree</code></td>
<td class="org-left">Generate the tree from single cell data with various measurement outputs and visualize tree</td>
</tr>
<tr>
<td class="org-left"><code>interactive</code></td>
<td class="org-left">Interactive visuzalization of the tree, very slow</td>
</tr>
<tr>
<td class="org-left"><code>differential</code></td>
<td class="org-left">Find differentially expressed genes between two nodes</td>
</tr>
<tr>
<td class="org-left"><code>diversity</code></td>
<td class="org-left">Conduct diversity analyses of multiple cell populations</td>
</tr>
<tr>
<td class="org-left"><code>paths</code></td>
<td class="org-left">The binary tree equivalent of the so called "pseudotime", or 1D dimensionality reduction</td>
</tr>
</tbody>
</table>
<p>
The main workflow is to first generate and plot the population tree using
<code>too-many-cells make-tree</code>, then use the rest of the entry points as needed.
</p>
<p>
At any point, use <code>-h</code> to see the help of each entry point.
</p>
<p>
Also, check out <a href="https://github.com/GregorySchwartz/tooManyCellsR">tooManyCellsR</a> for an R wrapper!
</p>
</div>
<div id="outline-container-org0ca31b8" class="outline-3">
<h3 id="org0ca31b8"><code>make-tree</code></h3>
<div class="outline-text-3" id="text-org0ca31b8">
<p>
<a id="org1c25758"></a>
</p>
<p>
<code>too-many-cells make-tree</code> generates a binary tree using hierarchical spectral
clustering. We start with all cells in a single node. Spectral clustering
partitions the cells into two groups. We assess the clustering using
Newman-Girvan modularity: if \(Q > 0\) then we recursively continue with
hierarchical spectral clustering. If not, then there is only a single community
and we do not partition – the resulting node is a leaf and is considered the
finest-grain cluster.
</p>
<p>
<b>The most important argument is the <code>--prior</code> argument.</b> Making the tree may
take some time, so if the tree was already generated and other analysis or
visualizations need to be run on the tree, point the <code>--prior</code> argument to the
output folder from a previous run of <code>too-many-cells</code>. If you do not use
<code>--prior</code>, <b>the entire tree will be recalculated even if you just wanted to
change the visualization!</b>
</p>
<p>
The main input is the <code>--matrix-path</code> argument. When a directory is supplied,
<code>too-many-cells</code> interprets the folder to have <code>matrix.mtx</code>, <code>genes.tsv</code>, and
<code>barcodes.tsv</code> files (<code>cellranger</code> outputs, see <code>cellranger</code> for specifics). If
a file is supplied instead of a directory, we assume a <code>csv</code> file containing
gene row names and cell column names. This argument can be called multiple times
to combine multiple single cell matrices: <code>--matrix-path input1 --matrix-path
input2</code>.
</p>
<p>
The second most important argument is <code>--labels-file</code>. Supply with a <code>csv</code> with
a format and header of "item,label" to provide colorings and statistics of the
relationships between labels. Here the "item" column contains the name of each
cell (barcode) and the label is any property of the cell (the tissue of origin,
hour in a time course, celltype, etc.).
</p>
<p>
To see the full list of options, use <code>too-many-cells -h</code> and <code>-h</code> for each entry
point (i.e. <code>too-many-cells make-tree -h</code>).
</p>
</div>
<div id="outline-container-org516edb5" class="outline-4">
<h4 id="org516edb5">Output</h4>
<div class="outline-text-4" id="text-org516edb5">
<p>
<code>too-many-cells make-tree</code> generates several files in the output folder. Below
is a short description of each file.
</p>
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
<col class="org-left" />
<col class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">File</th>
<th scope="col" class="org-left">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left"><code>clumpiness.csv</code></td>
<td class="org-left">When labels are provided, uses the clumpiness measure to determine the level of aggregation between each label within the tree.</td>
</tr>
<tr>
<td class="org-left"><code>clumpiness.pdf</code></td>
<td class="org-left">When labels are provided, a figure of the clumpiness between labels.</td>
</tr>
<tr>
<td class="org-left"><code>cluster_diversity.csv</code></td>
<td class="org-left">When labels are provided, the diversity, or "effective number of labels", of each cluster.</td>
</tr>
<tr>
<td class="org-left"><code>cluster_info.csv</code></td>
<td class="org-left">Various bits of information for each cluster and the path leading up to each cluster, from that cluster to the root. For instance, the <code>size</code> column has <code>cluster_size/parent_size/parent_parent_size/.../root_size</code></td>
</tr>
<tr>
<td class="org-left"><code>cluster_list.json</code></td>
<td class="org-left">The <code>json</code> file containing a list of clusterings.</td>
</tr>
<tr>
<td class="org-left"><code>cluster_tree.json</code></td>
<td class="org-left">The <code>json</code> file containing the output tree in a recursive format.</td>
</tr>
<tr>
<td class="org-left"><code>dendrogram.svg</code></td>
<td class="org-left">The visualization of the tree. There are many possible options for this visualization included. Can rename to choose between PNG, PS, PDF, and SVG using <code>--dendrogram-output</code>.</td>
</tr>
<tr>
<td class="org-left"><code>graph.dot</code></td>
<td class="org-left">A <code>dot</code> file of the tree, with less information than the tree in <code>cluster_results.json</code>.</td>
</tr>
<tr>
<td class="org-left"><code>node_info.csv</code></td>
<td class="org-left">Various information of each node in the tree.</td>
</tr>
<tr>
<td class="org-left"><code>projection.pdf</code></td>
<td class="org-left">When <code>--projection</code> is supplied with a file of the format "barcode,x,y", provides a plot of each cell at the specified x and y coordinates (for instance, when looking at t-SNE plots with the same labelings as the dendrogram here).</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="outline-container-org5f8735d" class="outline-4">
<h4 id="org5f8735d">Outline with options</h4>
<div class="outline-text-4" id="text-org5f8735d">
<p>
The basic outline of the <b>default</b> pre-processing pipeline with some relevant
options is as follows (there are many additional options including cell
whitelists and PCA that can be seen using <code>too-many-cells make-tree -h</code>):
</p>
<ol class="org-ol">
<li>Read matrix.</li>
<li>Remove cells with less than 250 counts (<code>--filter-thresholds</code>, <code>--no-filter</code>).</li>
<li>Remove genes with less than 1 count (<code>--filter-thresholds</code>, <code>--no-filter</code>).</li>
<li>Term frequency-inverse document frequency normalization (<code>--normalization</code>).</li>
<li>Finish.</li>
</ol>
</div>
</div>
<div id="outline-container-org7a8f497" class="outline-4">
<h4 id="org7a8f497">Example</h4>
<div class="outline-text-4" id="text-org7a8f497">
</div>
<ul class="org-ul">
<li><a id="orga19851f"></a>Setup<br />
<div class="outline-text-5" id="text-orga19851f">
<p>
We start with our input matrix. Here,
</p>
<div class="org-src-container">
<pre class="src src-sh">ls ./input
</pre>
</div>
<pre class="example">
barcodes.tsv genes.tsv matrix.mtx
</pre>
<p>
Note that the input can be a directory (with the <code>cellranger</code> matrix format
above) or a file (a <code>csv</code> file). You can also point to a <code>cellranger</code> >= 3.0
folder which has <code>matrix.mtx.gz</code>, <code>features.tsv.gz</code>, and <code>barcodes.tsv.gz</code> files
instead. <b>You don't need to use scRNA-seq data!</b> You can use any data that has
observations (cells) and features (genes), as long as you agree that the
observations are related by their feature abundances. <a id="org518dd9c"></a> If
you do upstream batch effect correction, PCA, normalization, or anything else,
be sure to use <code>--no-filter --normalization NoneNorm</code> to avoid wrong filters and
scalings! As for formats, the matrix market format contains three files like so:
</p>
<p>
The <code>matrix.mtx</code> file is in matrix market format.
</p>
<pre class="example">
%%MatrixMarket matrix coordinate integer general
%
23433 1981 4255069
4 1 1
5 1 1
11 1 2
23 1 2
25 1 2
40 1 2
48 1 1
...
</pre>
<p>
The <code>genes.tsv</code> file (or <code>features.tsv.gz</code>) contains the features of each cell
and corresponds to the rows of <code>matrix.mtx</code>. Here, both columns were the same
gene symbols, but you can have Ensembl as the first column and gene symbol as
the second, etc. The columns and column orders don't matter, but make sure all
matrices have the same format and specify the symbols you want to use (for
overlaying gene expression, differential expression, etc.) with
<code>--feature-column COLUMN</code>. So to use the second column for gene expression, you
would use <code>--feature-column 2</code>.
</p>
<pre class="example">
Xkr4 Xkr4
Rp1 Rp1
Sox17 Sox17
Mrpl15 Mrpl15
Lypla1 Lypla1
Tcea1 Tcea1
Rgs20 Rgs20
Atp6v1h Atp6v1h
Oprk1 Oprk1
Npbwr1 Npbwr1
...
</pre>
<p>
The <code>barcodes.tsv</code> file contains the ids of each cell or observation and
corresponds to the columns of <code>matrix.mtx</code>.
</p>
<pre class="example">
AAACCTGCAGTAACGG-1
AAACGGGAGAAGAAGC-1
AAACGGGAGACCGGAT-1
AAACGGGAGCGCTCCA-1
AAACGGGAGGACGAAA-1
AAACGGGAGGTACTCT-1
AAACGGGAGGTGCTTT-1
AAACGGGAGTCGAGTG-1
AAACGGGCATGGTCAT-1
AAAGATGAGCTTCGCG-1
...
</pre>
<p>
For a <code>csv</code> file, the format is dense (observation columns (cells), feature rows
(genes)):
</p>
<pre class="example">
"","A22.D042044.3_9_M.1.1","C5.D042044.3_9_M.1.1","D10.D042044.3_9_M.1.1","E13.D042044.3_9_M.1.1","F19.D042044.3_9_M.1.1","H2.D042044.3_9_M.1.1","I9.D042044.3_9_M.1.1",...
"0610005C13Rik",0,0,0,0,0,0,0,...
"0610007C21Rik",0,112,185,54,0,96,42,...
"0610007L01Rik",0,0,0,0,0,153,170,...
"0610007N19Rik",0,0,0,0,0,0,0,...
"0610007P08Rik",0,0,0,0,0,19,0,...
"0610007P14Rik",0,58,0,0,255,60,0,...
"0610007P22Rik",0,0,0,0,0,65,0,...
"0610008F07Rik",0,0,0,0,0,0,0,...
"0610009B14Rik",0,0,0,0,0,0,0,...
...
</pre>
<p>
We also know where each cell came from, so we mark that down as well in a
<code>labels.csv</code> file.
</p>
<pre class="example">
item,label
AAACCTGCAGTAACGG-1,Marrow
AAACGGGAGACCGGAT-1,Marrow
AAACGGGAGCGCTCCA-1,Marrow
AAACGGGAGGACGAAA-1,Marrow
AAACGGGAGGTACTCT-1,Marrow
...
</pre>
<p>
This can be easily accomplished with <code>sed</code>:
</p>
<div class="org-src-container">
<pre class="src src-sh">cat barcodes.tsv | sed <span style="color: #afaf00;">"s/-1/-1,Marrow/"</span> | s/-2/etc... > labels.csv
</pre>
</div>
<p>
For <code>cellranger</code>, note that the <code>-1</code>, <code>-2</code>, etc. postfixes denote the first,