-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathGettingStarted.html
302 lines (240 loc) · 13.8 KB
/
GettingStarted.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<meta name="author" content="Everyone" />
<title>Getting Started</title>
<script src="GettingStarted_files/header-attrs-2.7/header-attrs.js"></script>
<script src="GettingStarted_files/jquery-1.11.3/jquery.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="GettingStarted_files/bootstrap-3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<script src="GettingStarted_files/bootstrap-3.3.5/js/bootstrap.min.js"></script>
<script src="GettingStarted_files/bootstrap-3.3.5/shim/html5shiv.min.js"></script>
<script src="GettingStarted_files/bootstrap-3.3.5/shim/respond.min.js"></script>
<style>h1 {font-size: 34px;}
h1.title {font-size: 38px;}
h2 {font-size: 30px;}
h3 {font-size: 24px;}
h4 {font-size: 18px;}
h5 {font-size: 16px;}
h6 {font-size: 12px;}
code {color: inherit; background-color: rgba(0, 0, 0, 0.04);}
pre:not([class]) { background-color: white }</style>
<script src="GettingStarted_files/navigation-1.1/tabsets.js"></script>
<link href="GettingStarted_files/highlightjs-9.12.0/default.css" rel="stylesheet" />
<script src="GettingStarted_files/highlightjs-9.12.0/highlight.js"></script>
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
</style>
<style type="text/css">code{white-space: pre;}</style>
<script type="text/javascript">
if (window.hljs) {
hljs.configure({languages: []});
hljs.initHighlightingOnLoad();
if (document.readyState && document.readyState === "complete") {
window.setTimeout(function() { hljs.initHighlighting(); }, 0);
}
}
</script>
<style type = "text/css">
.main-container {
max-width: 940px;
margin-left: auto;
margin-right: auto;
}
img {
max-width:100%;
}
.tabbed-pane {
padding-top: 12px;
}
.html-widget {
margin-bottom: 20px;
}
button.code-folding-btn:focus {
outline: none;
}
summary {
display: list-item;
}
pre code {
padding: 0;
}
</style>
<!-- tabsets -->
<style type="text/css">
.tabset-dropdown > .nav-tabs {
display: inline-table;
max-height: 500px;
min-height: 44px;
overflow-y: auto;
border: 1px solid #ddd;
border-radius: 4px;
}
.tabset-dropdown > .nav-tabs > li.active:before {
content: "";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li.active:before {
content: "";
border: none;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open:before {
content: "";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}
.tabset-dropdown > .nav-tabs > li.active {
display: block;
}
.tabset-dropdown > .nav-tabs > li > a,
.tabset-dropdown > .nav-tabs > li > a:focus,
.tabset-dropdown > .nav-tabs > li > a:hover {
border: none;
display: inline-block;
border-radius: 4px;
background-color: transparent;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li {
display: block;
float: none;
}
.tabset-dropdown > .nav-tabs > li {
display: none;
}
</style>
<!-- code folding -->
</head>
<body>
<div class="container-fluid main-container">
<div id="header">
<h1 class="title toc-ignore">Getting Started</h1>
<h4 class="author">Everyone</h4>
<h4 class="date">3/14/2021</h4>
</div>
<div id="input-files" class="section level3">
<h3>Input Files</h3>
<p>iTIME accepts 3 files as input: a summary, clinical, and spatial file. All files should be csv files. The summary file should contain summary level statistics and should contain one row per sample, while the clinical data file should contain one row per patient. Both the clinical and summary files should contain a variable to link sample IDs and clinical IDs (‘Merge Variable’), though the variables do not need to be named the same in both datasets. iTIME does not need to have a spatial data file if only univariate or multivariate summaries are of interest, however, for the spatial data tab clinical and summary data are needed.</p>
</div>
<div id="summary-pages" class="section level3">
<h3>Summary Pages</h3>
<div id="univariate-summary" class="section level4">
<h4>Univariate Summary</h4>
<p>This page provides a summary of the marker chosen from the dropdown menu below and allows users to plot a marker against clinical variables and select the appropriate plot type. Plot types available are boxplot, violin plot, histogram, and scatter plot, all of which have the clinical variable along the x-axis. The boxplot, violin plot, and histogram are only applicable for categorical clinical features, while the scatter plot is only applicable for continuous clinical features. The red dashed line in each of these plots correspond to the selected percent threshold. Two additional summary tables are provided: a contingency table threshold can be set to compute greater than or less than by the clinical variable selected, and a frequency table displaying the number of samples greater than various thresholds and without stratification.</p>
<p>Currently, there is the ability to apply a <strong>square root</strong> transformation for the summary plots.</p>
</div>
<div id="multivariate-summary" class="section level4">
<h4>Multivariate Summary</h4>
<p>The data are displayed as a heatmap of the selected markers (rows). These data rows have the ability to be clustered through the toggle, where the columns (clinical variable) has the ability to be grouped together based on clinical variable annotation. The order of the samples (columns) and markers (rows) of the heatmap are determined by hierarchical clustering which assigns clusters based on ‘complete’ dissimilarity. Complete dissimilarity refers to the distance of two clusters being determined by the largest distance between elements in either cluster. The dataset will be sorted by the selected clinical variable to allow for a heatmap where the samples with the same class of a clinical variable are grouped together or appear in increasing order for continuous variables (such as age). Markers to include in the plot are selected through toggling the check-box next to the marker name.</p>
</div>
</div>
<div id="spatial-page" class="section level3">
<h3>Spatial Page</h3>
<p>The spatial page plots the individual cells by positivity for the markers and plots Ripley’s K estimates over a range of r values using default 100 simulated point patterns.</p>
<p>The bottom panel is a plot of a selected measure of spatial clustering. Ripley’s K, Besag’s L, and Marcon’s M quantify the of the degree of spatial clustering for a particular cell type. These quantities assume that the point process of interest follows complete spatial randomness (CSR) that is that the location of the cells do not form clusters nor do they occur in a regular pattern. Each measure is computed by counting the number of neighboring cells for each cell, where two cells are said to be neighboring if they are within a specified distance, r as seen in the x-axis of ‘Plot of Spatial Clustering Estimator’, of each other.</p>
<p>Edge corrections are needed for these methods to account for the fact that these cell types are assumed occur outside of the TMA at the same rate. The edge corrections inflate the number of neighboring cells based on their proximity to the edge. Two popular methods edge corrections are isotropic and translational. Translation edge correction translates the region of interest based on the distance between two points and then measures the area of the intersection of the original region and translated region. An isotropic edge correction weights each pair of points based on how much of the circumference of a circle centered around one point and going through the other is outside of the region of interest.</p>
<p>Ripley’s <span class="math inline">\(K\)</span> is the basis for Besag’s <span class="math inline">\(L\)</span> and Marcon’s <span class="math inline">\(M\)</span> and is computed by <span class="math display">\[
\hat{K}\left(r\right) = (n(n-1))^{-1}A \sum^{n}_{i=1} \sum_{j\neq i}w_{ij}|(x_j:d(x_i,x_j)\lt r)|,
\]</span></p>
<p>where <span class="math inline">\(n\)</span> is the number of cells, <span class="math inline">\(A\)</span> is the area of the TMA, <span class="math inline">\(d(x_i,x_j)\)</span> is the distance between the <span class="math inline">\(i^{th}\)</span> and <span class="math inline">\(j^{th}\)</span> cell, and <span class="math inline">\(w_{ij}\)</span> is weighting factor from the edge correction. The expected value of <span class="math inline">\(K\)</span> under the CSR is <span class="math inline">\(\pi r^2\)</span>. Both Besag’s L and Marcon’s <span class="math inline">\(M\)</span> are different standardizations to Ripley’s <span class="math inline">\(K\)</span>, which are computed by:</p>
<ul>
<li><span class="math inline">\(L\left(r\right) = \sqrt{K\left(r\right)/\pi}\)</span> and has
<ul>
<li>Expected value of <span class="math inline">\(L(r)\)</span> of <span class="math inline">\(r\)</span>. Note that the expected value of <span class="math inline">\(L\)</span> grows proportionally with <span class="math inline">\(r\)</span>.</li>
</ul></li>
<li><span class="math inline">\(M\left(r\right) = K\left(r\right)/(\pi r^2)\)</span>
<ul>
<li>Expected value of <span class="math inline">\(M(r)\)</span> is 1. Note that the expected value not a function of <span class="math inline">\(r\)</span>.</li>
</ul></li>
</ul>
<p>Neither Ripley’s <span class="math inline">\(K\)</span> nor Besag’s <span class="math inline">\(L\)</span> involve a comparison to the null case of complete spatial randomness. By subtracting their respective expected values i.e. <span class="math inline">\(H(r) = K(r)-\pi r^2\)</span> and <span class="math inline">\(H^* = (r)L(r) - r\)</span>, <span class="math inline">\(H(r)\)</span> and <span class="math inline">\(H^*(r)\)</span> can both be interpreted as a measure of the degree of spatial clustering. Notice that <span class="math inline">\(M(r)\)</span> is a measure of the degree of spatial clusetering since it is the ratio Ripley’s K and it’s expected value.</p>
<!-- ```{r, modified_ripleys, echo=F, fig.align='center'} -->
<!-- tbl = data.frame("Metric" = c("Besag's L","Marcon's M"), -->
<!-- "Formula" = c("$L\\left(r\\right) = \\sqrt{K\\left(r\\right)/\\pi}$", "$M\\left(r\\right) = K\\left(r\\right)/(\\pi r^2)$"), -->
<!-- "Expected Value" = c("$r$", "1"), -->
<!-- "Formula Displayed in Plot" = c("$L\\left(r\\right) - r$","$M\\left(r\\right)$")) -->
<!-- colnames(tbl) = c("Metric","Formula","Expected Value","Formula Displayed in Plot") -->
<!-- knitr::kable( tbl, escape = F, align = 'c', format = 'html') %>% -->
<!-- kableExtra::kable_styling(position = "center", protect_latex = FALSE, latex_options = 'basic') -->
<!-- ``` -->
<p><br/> <span class="math inline">\(H(r)\)</span> and <span class="math inline">\(H^*(r)\)</span> Interpretation: If value is larger than 0, than there is evidence of spatial clustering.</p>
<p>Marcon’s <span class="math inline">\(M\)</span> Interpretation: If value is larger than 1, than there is evidence of spatial clustering. Additionally, <span class="math inline">\(M(r)\)</span> is 1.50 at some chosen radius means you’re observing 50% more clustering than Poisson distribution would predict.</p>
</div>
<div id="summary-file" class="section level3">
<h3>Summary File</h3>
<div class="figure">
<img src="GettingStarted_images/example_summary_data_format.png" alt="" />
<p class="caption">Summary File Example</p>
</div>
</div>
<div id="clinical-file" class="section level3">
<h3>Clinical File</h3>
<div class="figure">
<img src="GettingStarted_images/example_clinical_data_format.png" alt="" />
<p class="caption">Clinical File Example</p>
</div>
</div>
<div id="spatial-file" class="section level3">
<h3>Spatial File</h3>
<div class="figure">
<img src="GettingStarted_images/example_spatial_data_format.png" alt="" />
<p class="caption">Spatial File Example</p>
</div>
</div>
<div id="how-to-use" class="section level2">
<h2>How to Use</h2>
<p>Loading <strong>Example Data</strong> and selecting common column between <strong>Summary Data</strong> and <strong>Clinical Data</strong></p>
<div class="figure">
<img src="GettingStarted_images/load_data_help.png" alt="" />
<p class="caption">Loading Data Help</p>
</div>
<div id="help" class="section level3">
<h3>Help</h3>
<p><strong>If you have any questions or comments, we would love to hear them. You can email us at <a href="mailto:[email protected]">[email protected]</a> or feel free to <a href="https://github.com/FridleyLab/iTIME/issues">open an issue</a> in our github page.</strong></p>
</div>
</div>
</div>
<script>
// add bootstrap table styles to pandoc tables
function bootstrapStylePandocTables() {
$('tr.odd').parent('tbody').parent('table').addClass('table table-condensed');
}
$(document).ready(function () {
bootstrapStylePandocTables();
});
</script>
<!-- tabsets -->
<script>
$(document).ready(function () {
window.buildTabsets("TOC");
});
$(document).ready(function () {
$('.tabset-dropdown > .nav-tabs > li').click(function () {
$(this).parent().toggleClass('nav-tabs-open');
});
});
</script>
<!-- code folding -->
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "GettingStarted_files/mathjax-local/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
</body>
</html>