Diff of /docs/roianalysis.html [000000] .. [413088]

Switch to unified view

a b/docs/roianalysis.html
1
<!DOCTYPE html>
2
3
<html>
4
5
<head>
6
7
<meta charset="utf-8" />
8
<meta name="generator" content="pandoc" />
9
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
10
11
12
13
14
<title>ROI Analysis</title>
15
16
<script src="site_libs/header-attrs-2.29/header-attrs.js"></script>
17
<script src="site_libs/jquery-3.6.0/jquery-3.6.0.min.js"></script>
18
<meta name="viewport" content="width=device-width, initial-scale=1" />
19
<link href="site_libs/bootstrap-3.3.5/css/flatly.min.css" rel="stylesheet" />
20
<script src="site_libs/bootstrap-3.3.5/js/bootstrap.min.js"></script>
21
<script src="site_libs/bootstrap-3.3.5/shim/html5shiv.min.js"></script>
22
<script src="site_libs/bootstrap-3.3.5/shim/respond.min.js"></script>
23
<style>h1 {font-size: 34px;}
24
       h1.title {font-size: 38px;}
25
       h2 {font-size: 30px;}
26
       h3 {font-size: 24px;}
27
       h4 {font-size: 18px;}
28
       h5 {font-size: 16px;}
29
       h6 {font-size: 12px;}
30
       code {color: inherit; background-color: rgba(0, 0, 0, 0.04);}
31
       pre:not([class]) { background-color: white }</style>
32
<script src="site_libs/jqueryui-1.13.2/jquery-ui.min.js"></script>
33
<link href="site_libs/tocify-1.9.1/jquery.tocify.css" rel="stylesheet" />
34
<script src="site_libs/tocify-1.9.1/jquery.tocify.js"></script>
35
<script src="site_libs/navigation-1.1/tabsets.js"></script>
36
<link href="site_libs/highlightjs-9.12.0/textmate.css" rel="stylesheet" />
37
<script src="site_libs/highlightjs-9.12.0/highlight.js"></script>
38
<link href="site_libs/font-awesome-6.5.2/css/all.min.css" rel="stylesheet" />
39
<link href="site_libs/font-awesome-6.5.2/css/v4-shims.min.css" rel="stylesheet" />
40
41
<style type="text/css">
42
  code{white-space: pre-wrap;}
43
  span.smallcaps{font-variant: small-caps;}
44
  span.underline{text-decoration: underline;}
45
  div.column{display: inline-block; vertical-align: top; width: 50%;}
46
  div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
47
  ul.task-list{list-style: none;}
48
    </style>
49
50
<style type="text/css">code{white-space: pre;}</style>
51
<script type="text/javascript">
52
if (window.hljs) {
53
  hljs.configure({languages: []});
54
  hljs.initHighlightingOnLoad();
55
  if (document.readyState && document.readyState === "complete") {
56
    window.setTimeout(function() { hljs.initHighlighting(); }, 0);
57
  }
58
}
59
</script>
60
61
62
63
64
65
66
67
68
69
<style type = "text/css">
70
.main-container {
71
  max-width: 940px;
72
  margin-left: auto;
73
  margin-right: auto;
74
}
75
img {
76
  max-width:100%;
77
}
78
.tabbed-pane {
79
  padding-top: 12px;
80
}
81
.html-widget {
82
  margin-bottom: 20px;
83
}
84
button.code-folding-btn:focus {
85
  outline: none;
86
}
87
summary {
88
  display: list-item;
89
}
90
details > summary > p:only-child {
91
  display: inline;
92
}
93
pre code {
94
  padding: 0;
95
}
96
</style>
97
98
99
<style type="text/css">
100
.dropdown-submenu {
101
  position: relative;
102
}
103
.dropdown-submenu>.dropdown-menu {
104
  top: 0;
105
  left: 100%;
106
  margin-top: -6px;
107
  margin-left: -1px;
108
  border-radius: 0 6px 6px 6px;
109
}
110
.dropdown-submenu:hover>.dropdown-menu {
111
  display: block;
112
}
113
.dropdown-submenu>a:after {
114
  display: block;
115
  content: " ";
116
  float: right;
117
  width: 0;
118
  height: 0;
119
  border-color: transparent;
120
  border-style: solid;
121
  border-width: 5px 0 5px 5px;
122
  border-left-color: #cccccc;
123
  margin-top: 5px;
124
  margin-right: -10px;
125
}
126
.dropdown-submenu:hover>a:after {
127
  border-left-color: #adb5bd;
128
}
129
.dropdown-submenu.pull-left {
130
  float: none;
131
}
132
.dropdown-submenu.pull-left>.dropdown-menu {
133
  left: -100%;
134
  margin-left: 10px;
135
  border-radius: 6px 0 6px 6px;
136
}
137
</style>
138
139
<script type="text/javascript">
140
// manage active state of menu based on current page
141
$(document).ready(function () {
142
  // active menu anchor
143
  href = window.location.pathname
144
  href = href.substr(href.lastIndexOf('/') + 1)
145
  if (href === "")
146
    href = "index.html";
147
  var menuAnchor = $('a[href="' + href + '"]');
148
149
  // mark the anchor link active (and if it's in a dropdown, also mark that active)
150
  var dropdown = menuAnchor.closest('li.dropdown');
151
  if (window.bootstrap) { // Bootstrap 4+
152
    menuAnchor.addClass('active');
153
    dropdown.find('> .dropdown-toggle').addClass('active');
154
  } else { // Bootstrap 3
155
    menuAnchor.parent().addClass('active');
156
    dropdown.addClass('active');
157
  }
158
159
  // Navbar adjustments
160
  var navHeight = $(".navbar").first().height() + 15;
161
  var style = document.createElement('style');
162
  var pt = "padding-top: " + navHeight + "px; ";
163
  var mt = "margin-top: -" + navHeight + "px; ";
164
  var css = "";
165
  // offset scroll position for anchor links (for fixed navbar)
166
  for (var i = 1; i <= 6; i++) {
167
    css += ".section h" + i + "{ " + pt + mt + "}\n";
168
  }
169
  style.innerHTML = "body {" + pt + "padding-bottom: 40px; }\n" + css;
170
  document.head.appendChild(style);
171
});
172
</script>
173
174
<!-- tabsets -->
175
176
<style type="text/css">
177
.tabset-dropdown > .nav-tabs {
178
  display: inline-table;
179
  max-height: 500px;
180
  min-height: 44px;
181
  overflow-y: auto;
182
  border: 1px solid #ddd;
183
  border-radius: 4px;
184
}
185
186
.tabset-dropdown > .nav-tabs > li.active:before, .tabset-dropdown > .nav-tabs.nav-tabs-open:before {
187
  content: "\e259";
188
  font-family: 'Glyphicons Halflings';
189
  display: inline-block;
190
  padding: 10px;
191
  border-right: 1px solid #ddd;
192
}
193
194
.tabset-dropdown > .nav-tabs.nav-tabs-open > li.active:before {
195
  content: "\e258";
196
  font-family: 'Glyphicons Halflings';
197
  border: none;
198
}
199
200
.tabset-dropdown > .nav-tabs > li.active {
201
  display: block;
202
}
203
204
.tabset-dropdown > .nav-tabs > li > a,
205
.tabset-dropdown > .nav-tabs > li > a:focus,
206
.tabset-dropdown > .nav-tabs > li > a:hover {
207
  border: none;
208
  display: inline-block;
209
  border-radius: 4px;
210
  background-color: transparent;
211
}
212
213
.tabset-dropdown > .nav-tabs.nav-tabs-open > li {
214
  display: block;
215
  float: none;
216
}
217
218
.tabset-dropdown > .nav-tabs > li {
219
  display: none;
220
}
221
</style>
222
223
<!-- code folding -->
224
225
226
227
<style type="text/css">
228
229
#TOC {
230
  margin: 25px 0px 20px 0px;
231
}
232
@media (max-width: 768px) {
233
#TOC {
234
  position: relative;
235
  width: 100%;
236
}
237
}
238
239
@media print {
240
.toc-content {
241
  /* see https://github.com/w3c/csswg-drafts/issues/4434 */
242
  float: right;
243
}
244
}
245
246
.toc-content {
247
  padding-left: 30px;
248
  padding-right: 40px;
249
}
250
251
div.main-container {
252
  max-width: 1200px;
253
}
254
255
div.tocify {
256
  width: 20%;
257
  max-width: 260px;
258
  max-height: 85%;
259
}
260
261
@media (min-width: 768px) and (max-width: 991px) {
262
  div.tocify {
263
    width: 25%;
264
  }
265
}
266
267
@media (max-width: 767px) {
268
  div.tocify {
269
    width: 100%;
270
    max-width: none;
271
  }
272
}
273
274
.tocify ul, .tocify li {
275
  line-height: 20px;
276
}
277
278
.tocify-subheader .tocify-item {
279
  font-size: 0.90em;
280
}
281
282
.tocify .list-group-item {
283
  border-radius: 0px;
284
}
285
286
.tocify-subheader {
287
  display: inline;
288
}
289
.tocify-subheader .tocify-item {
290
  font-size: 0.95em;
291
}
292
293
</style>
294
295
296
297
</head>
298
299
<body>
300
301
302
<div class="container-fluid main-container">
303
304
305
<!-- setup 3col/9col grid for toc_float and main content  -->
306
<div class="row">
307
<div class="col-xs-12 col-sm-4 col-md-3">
308
<div id="TOC" class="tocify">
309
</div>
310
</div>
311
312
<div class="toc-content col-xs-12 col-sm-8 col-md-9">
313
314
315
316
317
<div class="navbar navbar-default  navbar-fixed-top" role="navigation">
318
  <div class="container">
319
    <div class="navbar-header">
320
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-bs-toggle="collapse" data-target="#navbar" data-bs-target="#navbar">
321
        <span class="icon-bar"></span>
322
        <span class="icon-bar"></span>
323
        <span class="icon-bar"></span>
324
      </button>
325
      <a class="navbar-brand" href="index.html">VoltRon</a>
326
    </div>
327
    <div id="navbar" class="navbar-collapse collapse">
328
      <ul class="nav navbar-nav">
329
        <li>
330
  <a href="tutorials.html">Explore</a>
331
</li>
332
<li class="dropdown">
333
  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
334
    Vignette
335
     
336
    <span class="caret"></span>
337
  </a>
338
  <ul class="dropdown-menu" role="menu">
339
    <li class="dropdown-submenu">
340
      <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">Spatial Data Integration</a>
341
      <ul class="dropdown-menu" role="menu">
342
        <li>
343
          <a href="registration.html">Spatial Data Alignment</a>
344
        </li>
345
        <li>
346
          <a href="multiomic.html">Multi-omic Integration</a>
347
        </li>
348
        <li>
349
          <a href="nicheclustering.html">Niche Clustering</a>
350
        </li>
351
      </ul>
352
    </li>
353
    <li class="dropdown-submenu">
354
      <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">Downstream Analysis</a>
355
      <ul class="dropdown-menu" role="menu">
356
        <li>
357
          <a href="roianalysis.html">ROI Analysis</a>
358
        </li>
359
        <li>
360
          <a href="spotanalysis.html">Cell/Spot Analysis</a>
361
        </li>
362
        <li>
363
          <a href="moleculeanalysis.html">Molecule Analysis</a>
364
        </li>
365
        <li>
366
          <a href="pixelanalysis.html">Pixels (Image Only) Analysis</a>
367
        </li>
368
      </ul>
369
    </li>
370
    <li class="dropdown-submenu">
371
      <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">Utilities</a>
372
      <ul class="dropdown-menu" role="menu">
373
        <li>
374
          <a href="interactive.html">Interactive Utilities</a>
375
        </li>
376
        <li>
377
          <a href="importingdata.html">Importing Spatial Data</a>
378
        </li>
379
        <li>
380
          <a href="voltronobjects.html">Working with VoltRon Objects</a>
381
        </li>
382
        <li>
383
          <a href="conversion.html">Converting VoltRon Objects</a>
384
        </li>
385
        <li>
386
          <a href="ondisk.html">OnDisk-based Analysis Utilities</a>
387
        </li>
388
      </ul>
389
    </li>
390
  </ul>
391
</li>
392
      </ul>
393
      <ul class="nav navbar-nav navbar-right">
394
        <li class="dropdown">
395
  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
396
    <span class="fa fa-envelope-o"></span>
397
     
398
    Contact
399
     
400
    <span class="caret"></span>
401
  </a>
402
  <ul class="dropdown-menu" role="menu">
403
    <li>
404
      <a href="https://bioinformatics.mdc-berlin.de">Altuna Lab/BIMSB Bioinfo</a>
405
    </li>
406
    <li>
407
      <a href="https://www.mdc-berlin.de/landthaler">Landthaler Lab/BIMSB</a>
408
    </li>
409
  </ul>
410
</li>
411
<li class="dropdown">
412
  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
413
    <span class="fa fa-github"></span>
414
     
415
    GitHub
416
     
417
    <span class="caret"></span>
418
  </a>
419
  <ul class="dropdown-menu" role="menu">
420
    <li>
421
      <a href="https://github.com/BIMSBbioinfo/VoltRon">VoltRon</a>
422
    </li>
423
    <li>
424
      <a href="https://github.com/BIMSBbioinfo">BIMSB Bioinfo</a>
425
    </li>
426
  </ul>
427
</li>
428
      </ul>
429
    </div><!--/.nav-collapse -->
430
  </div><!--/.container -->
431
</div><!--/.navbar -->
432
433
<div id="header">
434
435
436
437
<h1 class="title toc-ignore">ROI Analysis</h1>
438
439
</div>
440
441
442
<style>
443
.title{
444
  display: none;
445
}
446
body {
447
  text-align: justify
448
}
449
.center {
450
  display: block;
451
  margin-left: auto;
452
  margin-right: auto;
453
}
454
table, th, td {
455
  border-collapse: collapse;
456
  align-self: center;
457
  padding-right: 10px;
458
  padding-left: 10px;
459
}
460
</style>
461
<style type="text/css">
462
.watch-out {
463
  color: black;
464
}
465
</style>
466
<p><br></p>
467
<div id="roi-analysis" class="section level1">
468
<h1>ROI Analysis</h1>
469
<p>VoltRon is capable of analyzing readouts from distinct spatial
470
technologies including <strong>segmentation (ROI)-based transciptomics
471
assays</strong> that capture large polygonic regions on tissue sections.
472
VoltRon recognizes such readouts including ones from commercially
473
available tools and allows users to implement a workflow similar to ones
474
conducted on bulk RNA-Seq datasets. In this tutorial, we will analyze
475
morphological images and gene expression profiles provided by the
476
readouts of the <a
477
href="https://nanostring.com/products/geomx-digital-spatial-profiler/geomx-dsp-overview/">Nanostring’s
478
GeoMx Digital Spatial Profiler</a> platform, a high-plex spatial
479
profiling technology which produces segmentation-based protein and RNA
480
assays.</p>
481
<p>In this use case, <strong>eight tissue micro array (TMA) tissue
482
sections</strong> were fitted into the scan area of the slide loaded on
483
the GeoMx DSP instrument. These sections were cut from <strong>control
484
and COVID-19 lung tissues</strong> of donors categorized based on
485
disease durations (acute and prolonged). See <a
486
href="https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE190732">GSE190732</a>
487
for more information.</p>
488
<p>You can download these tutorial files from here:</p>
489
<table>
490
<tr>
491
<th>
492
File
493
</th>
494
<th>
495
Link
496
</th>
497
</tr>
498
<tr>
499
<td>
500
Counts
501
</td>
502
<td>
503
<a href="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/ROIanalysis/GeoMx/DCC-20230427.zip">DDC
504
files</a>
505
</td>
506
</tr>
507
<tr>
508
<td>
509
GeoMx Human Whole Transcriptome Atlas
510
</td>
511
<td>
512
<a href="https://nanostring.com/wp-content/uploads/Hs_R_NGS_WTA_v1.0.pkc_.zip">Human
513
RNA WTA for NGS</a>
514
</td>
515
</tr>
516
<tr>
517
<td>
518
Segment Summary
519
</td>
520
<td>
521
<a href="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/ROIanalysis/GeoMx/segmentSummary.csv">
522
ROI Metadata file </a>
523
</td>
524
</tr>
525
<tr>
526
<td>
527
Morphology Image
528
</td>
529
<td>
530
<a href="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/ROIanalysis/GeoMx/Lu1A1B5umtrueexp.tif">
531
Image file </a>
532
</td>
533
</tr>
534
<tr>
535
<td>
536
OME.TIFF Image
537
</td>
538
<td>
539
<a href="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/ROIanalysis/GeoMx/Lu1A1B5umtrueexp.ome.tiff">
540
OME.TIFF file </a>
541
</td>
542
</tr>
543
<tr>
544
<td>
545
OME.TIFF Image (XML)
546
</td>
547
<td>
548
<a href="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/ROIanalysis/GeoMx/Lu1A1B5umtrueexp.ome.tiff.xml" download target="_blank">
549
OME.TIFF (XML) file </a>
550
</td>
551
</tr>
552
</table>
553
<p>
554
</p>
555
<p>We now import the GeoMx data, and start analyzing 87 user selected
556
segments (i.e. region of interests, <strong>ROI</strong>) to check
557
spatial localization of signals. The <strong>importGeoMx</strong>
558
function requires:</p>
559
<ul>
560
<li>The path to the Digital Count Conversion file,
561
<strong>dcc.path</strong>, and Probe Kit Configuration file,
562
<strong>pkc.file</strong>, which are both provided as the output of the
563
<a
564
href="https://emea.illumina.com/products/by-type/informatics-products/basespace-sequence-hub/apps/nanostring-geomxr-ngs-pipeline.html">GeoMx
565
NGS Pipeline</a>.</li>
566
<li>The path the to the metadata file, <strong>summarySegment</strong>,
567
and the specific excel sheet that the metadata is found,
568
<strong>summarySegmentSheetName</strong>, the path to the main
569
morphology <strong>image</strong> and the original <strong>ome.tiff
570
(xml)</strong> file, all of which are provided and imported from the DSP
571
Control Center. Please see <a
572
href="https://nanostring.com/support-documents/geomx-dsp-data-analysis-user-manual/">GeoMx
573
DSP Data Analysis User Manual</a> for more information.</li>
574
</ul>
575
<pre class="r watch-out"><code>library(VoltRon)
576
library(xlsx)
577
GeoMxR1 &lt;- importGeoMx(dcc.path = &quot;DCC-20230427/&quot;, 
578
                       pkc.file = &quot;Hs_R_NGS_WTA_v1.0.pkc&quot;,
579
                       summarySegment = &quot;segmentSummary.csv&quot;,
580
                       image = &quot;Lu1A1B5umtrueexp.tif&quot;,
581
                       ome.tiff = &quot;Lu1A1B5umtrueexp.ome.tiff.xml&quot;,
582
                       sample_name = &quot;GeoMxR1&quot;)</code></pre>
583
<p>We can import the GeoMx ROI segments from the
584
<strong>Lu1A1B5umtrueexp.ome.tiff</strong> image file directly by
585
replacing the .xml file with the .ome.tiff file in the
586
<strong>ome.tiff</strong> argument. Note that you need to call the
587
<strong>RBioFormats</strong> library. If you are getting a <strong>java
588
error</strong> when running importGeoMx, try increasing the maximum heap
589
size by supplying the <strong>-Xmx</strong> parameter. Run the code
590
below before rerunning <strong>importGeoMx</strong> again.</p>
591
<pre class="r watch-out"><code>options(java.parameters = &quot;-Xmx4g&quot;)
592
library(RBioFormats)</code></pre>
593
<p><br></p>
594
<div id="quality-control" class="section level2">
595
<h2>Quality Control</h2>
596
<p>Once the GeoMx data is imported, we can start off with examining key
597
quality control measures and statistics on each segment to investigate
598
each individual ROI such as sequencing saturation and the number of
599
cells (nuclei) within each segment. VoltRon also provides the total
600
number of unique transcripts per ROI and stores in the metadata.</p>
601
<pre class="r watch-out"><code>library(ggplot2)
602
vrBarPlot(GeoMxR1, 
603
          features = c(&quot;Count&quot;, &quot;Nuclei.count&quot;, &quot;Sequencing.saturation&quot;),
604
          x.label = &quot;ROI.name&quot;, group.by = &quot;ROI.type&quot;) + 
605
  theme(axis.text.x = element_text(size = 3))</code></pre>
606
<p><img width="100%" height="100%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/roi_barplot.png" class="center"></p>
607
<p>For measuring the quality of individual ROIs, we can add a new
608
metadata column, called <strong>CountPerNuclei</strong>, to check the
609
average quality of cells per ROI. It seems some number of ROIs with low
610
counts per nuclei also have low sequencing saturation.</p>
611
<pre class="r watch-out"><code>GeoMxR1$CountPerNuclei &lt;- GeoMxR1$Count/GeoMxR1$Nuclei.count
612
vrBarPlot(GeoMxR1, 
613
          features = c(&quot;Count&quot;, &quot;Nuclei.count&quot;, 
614
                       &quot;Sequencing.saturation&quot;, &quot;CountPerNuclei&quot;),
615
          x.label = &quot;ROI.name&quot;, group.by = &quot;ROI.type&quot;, ncol = 2) + 
616
  theme(axis.text.x = element_text(size = 5))</code></pre>
617
<p><img width="100%" height="100%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/roi_barplot2.png" class="center"></p>
618
<p><br></p>
619
</div>
620
<div id="processing" class="section level2">
621
<h2>Processing</h2>
622
<p>We can now filter ROIs based on our earlier observation of them
623
having low count per nuclei where some also have low sequencing
624
saturation.</p>
625
<pre class="r watch-out"><code># Filter for count per nuclei
626
GeoMxR1 &lt;- subset(GeoMxR1, subset = CountPerNuclei &gt; 500)</code></pre>
627
<p>We then filter genes with low counts by extracting the count matrix
628
and putting aside all genes whose maximum count across all 87 ROIs are
629
less than 10.</p>
630
<pre class="r watch-out"><code>GeoMxR1_data &lt;- vrData(GeoMxR1, norm = FALSE)
631
feature_ind &lt;- apply(GeoMxR1_data, 1, function(x) max(x) &gt; 10)
632
selected_features &lt;- vrFeatures(GeoMxR1)[feature_ind]
633
GeoMxR1_lessfeatures &lt;- subset(GeoMxR1, features = selected_features)</code></pre>
634
<p>VoltRon is capable of normalizing data provided by a diverse set of
635
spatial technologies, including the quantile normalization method
636
suggested by the <a
637
href="https://nanostring.com/support-documents/geomx-dsp-data-analysis-user-manual/">GeoMx
638
DSP Data Analysis User Manual</a> which scales the ROI profiles to the
639
third quartile followed by the geometric mean of all third quartiles
640
multipled to the scaled profile.</p>
641
<pre class="r watch-out"><code>GeoMxR1 &lt;- normalizeData(GeoMxR1, method = &quot;Q3Norm&quot;)</code></pre>
642
<p><br></p>
643
</div>
644
<div id="interactive-subsetting" class="section level2">
645
<h2>Interactive Subsetting</h2>
646
<p>Spatially informed genomic technologies heavily depend on image
647
manipulation as images provide an additional set of information. Hence,
648
VoltRon incorporates several interactive built-in utilities. One such
649
functionality allows manipulating images of VoltRon assays where users
650
can interactively choose subsets of images. However, we first resize the
651
morphology image by providing the width of the new image (thus height
652
will be reduced to preserve the aspect ratio).</p>
653
<pre class="r watch-out"><code># resizing the image
654
# GeoMxR1 &lt;- resizeImage(GeoMxR1, size = 4000)</code></pre>
655
<p>VoltRon provides <strong>a mini Shiny app</strong> for subsetting
656
spatial points of a VoltRon object by using the image as a reference.
657
This app is particularly useful when multiple tissue sections were
658
fitted to a scan area of a slide, such as the one from GeoMx DSP
659
instrument. We use <strong>interactive = TRUE</strong> option in the
660
subset function to call the mini Shiny app, and select bounding boxes of
661
each newly created subset. <strong>Please continue until all eight
662
sections are selected and subsetted</strong>.</p>
663
<pre class="r watch-out"><code>GeoMxR1_subset &lt;- subset(GeoMxR1, interactive = TRUE)</code></pre>
664
<p><img width="85%" height="85%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/interactivesubset.gif" class="center"></p>
665
<p>We can now merge the list of subsets, or samples, each associated
666
with one of eight sections. You can provide a list of names for the
667
newly subsetted samples.</p>
668
<pre class="r watch-out"><code>GeoMxR1_subset_list &lt;- GeoMxR1_subset$subsets
669
GeoMxR1 &lt;- merge(GeoMxR1_subset_list[[1]], GeoMxR1_subset_list[-1])
670
GeoMxR1</code></pre>
671
<pre><code>VoltRon Object 
672
prolonged case 4: 
673
  Layers: Section1 
674
acute case 3: 
675
  Layers: Section1 
676
control case 2: 
677
  Layers: Section1 
678
acute case 1: 
679
  Layers: Section1 
680
acute case 2: 
681
  Layers: Section1 
682
... 
683
There are 8 samples in total 
684
Assays: GeoMx(Main) </code></pre>
685
<p><br></p>
686
<p>You may also save the selected image subsets and reproduce the
687
interactive subsetting operation for later use.</p>
688
<pre class="r watch-out"><code>samples &lt;- c(&quot;prolonged case 4&quot;, &quot;acute case 3&quot;, &quot;control case 2&quot;, 
689
             &quot;acute case 1&quot;, &quot;acute case 2&quot;, &quot;prolonged case 5&quot;, 
690
             &quot;prolonged case 3&quot;, &quot;control case 1&quot;)
691
subset_info_list &lt;- GeoMxR1_subset$subset_info_list[[1]]
692
GeoMxR1_subset_list &lt;- list()
693
for(i in 1:length(subset_info_list)){
694
  GeoMxR1_subset_list[[i]]  &lt;- subset(GeoMxR1, image = subset_info_list[i])
695
  GeoMxR1_subset_list[[i]] &lt;- samples[i]
696
}
697
GeoMxR1 &lt;- merge(GeoMxR1_subset_list[[1]], GeoMxR1_subset_list[-1])</code></pre>
698
<p><br></p>
699
</div>
700
<div id="visualization" class="section level2">
701
<h2>Visualization</h2>
702
<p>We will now select sections of interests from the VoltRon object, and
703
visualize ROIs and features for each of these sections.</p>
704
<p>The function <strong>vrSpatialPlot</strong> plots categorical
705
attributes associated with ROIs. In this case, we will visualize types
706
of ROIs that were labelled and annotated during ROI selection.</p>
707
<pre class="r watch-out"><code>GeoMxR1_subset &lt;- subset(GeoMxR1, sample = c(&quot;prolonged case 4&quot;,&quot;acute case 3&quot;))
708
vrSpatialPlot(GeoMxR1_subset, group.by = &quot;ROI.type&quot;, ncol = 3, alpha = 0.6)</code></pre>
709
<p><img width="90%" height="90%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/roi_spatialplot.png" class="center"></p>
710
<p>The function <strong>vrSpatialFeaturePlot</strong> detects the number
711
of assays within each VoltRon object and visualizes each feature per
712
each spatial image. A grid of images are visualized either the number of
713
assays or the number of features are larger than 1. Here, we visualize
714
the normalized expression of COL1A1 and C1S, two fibrotic markers,
715
across ROIs of two prolonged covid cases. One may observe that the
716
fibrotic regions of prolonged case 5 have considerably more COL1A1 and
717
C1S compared to prolonged case 4.</p>
718
<pre class="r watch-out"><code>GeoMxR1_subset &lt;- subset(GeoMxR1, sample = c(&quot;prolonged case 4&quot;,&quot;prolonged case 5&quot;))
719
vrSpatialFeaturePlot(GeoMxR1_subset, features = c(&quot;COL1A1&quot;, &quot;C1S&quot;), group.by = &quot;ROI.name&quot;, 
720
                     log = TRUE, label = TRUE, keep.scale = &quot;feature&quot;, title.size = 15)</code></pre>
721
<p><img width="85%" height="85%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/roi_featureplot.png" class="center"></p>
722
<p><br></p>
723
</div>
724
<div id="dimensionality-reduction" class="section level2">
725
<h2>Dimensionality Reduction</h2>
726
<p>We can now process the normalized and demultiplexed samples to map
727
ROIs across all sections onto lower dimensional spaces. The functions
728
<strong>getFeatures</strong> and <strong>getPCA</strong> select features
729
(i.e. genes) of interest from the data matrix across all samples and
730
reduce it to a selected number of principal components.</p>
731
<pre class="r watch-out"><code>GeoMxR1 &lt;- getFeatures(GeoMxR1)
732
GeoMxR1 &lt;- getPCA(GeoMxR1, dims = 30)</code></pre>
733
<p>The function <strong>vrEmbeddingPlot</strong> can be used to
734
visualize embedding spaces (pca, umap, etc.) for any spatial point
735
supported by VoltRon, hence cells, spots and ROI are all visualized
736
using the same set of functions. Here we generate a new metadata column
737
that represents the <strong>disease durations (control, acute and
738
prolonged case)</strong>, then map gene profiles to the first two
739
principal components.</p>
740
<pre class="r watch-out"><code>GeoMxR1$Condition &lt;- gsub(&quot; [0-9]+$&quot;, &quot;&quot;, GeoMxR1$Sample)
741
vrEmbeddingPlot(GeoMxR1, group.by = c(&quot;Condition&quot;), embedding = &quot;pca&quot;, pt.size = 3)</code></pre>
742
<p><img width="70%" height="70%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/roi_embeddingplotsingle.png" class="center"></p>
743
<p>VoltRon provides additional dimensionality reduction techniques such
744
as <strong>UMAP</strong>.</p>
745
<pre class="r watch-out"><code>GeoMxR1 &lt;- getUMAP(GeoMxR1)</code></pre>
746
<p>Gene expression profiles of ROIs associated with prolonged case
747
sections seem to show some heterogeneity. We now color segments by
748
section (or replicate, <strong>Sample</strong>) to observe the sources
749
of variability. Three replicates of prolonged cases exhibit three
750
different clusters of ROIs.</p>
751
<pre class="r watch-out"><code>vrEmbeddingPlot(GeoMxR1, group.by = c(&quot;Condition&quot;), embedding = &quot;pca&quot;, pt.size = 3)
752
vrEmbeddingPlot(GeoMxR1, group.by = c(&quot;ROI.type&quot;), embedding = &quot;pca&quot;, pt.size = 3)
753
vrEmbeddingPlot(GeoMxR1, group.by = c(&quot;ROI.type&quot;), embedding = &quot;umap&quot;, pt.size = 3)</code></pre>
754
<p><img width="100%" height="100%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/roi_embeddingplot.png" class="center"></p>
755
</div>
756
<div id="differential-expression-analysis" class="section level2">
757
<h2>Differential Expression Analysis</h2>
758
<p>VoltRon provides wrapping functions for calling tools and methods
759
from popular differential expression analysis package such as <a
760
href="https://genomebiology.biomedcentral.com/articles/10.1186/s13059-014-0550-8">DESeq2</a>.
761
We utilize <strong>DESeq2</strong> to find differentially expressed
762
genes across each pair of ROI types conditions.</p>
763
<pre class="r watch-out"><code># get DE for all conditions
764
library(DESeq2)
765
library(dplyr)
766
DEresults &lt;- getDiffExp(GeoMxR1, group.by = &quot;ROI.type&quot;,
767
                        group.base = &quot;vessel&quot;, method = &quot;DESeq2&quot;)
768
DEresults_sig &lt;- DEresults %&gt;% filter(!is.na(padj)) %&gt;% 
769
  filter(padj &lt; 0.05, abs(log2FoldChange) &gt; 1)
770
head(DEresults_sig)</code></pre>
771
<div>
772
<pre><code style="font-size: 11.7px;">         baseMean log2FoldChange     lfcSE     stat       pvalue         padj     gene             comparison
773
ACTA2    33.48395       1.508701 0.3458464 4.362343 1.286768e-05 4.902586e-03    ACTA2 ROI.type_vessel_epithelium
774
ADAMTS1  22.29160       1.152556 0.2272085 5.072680 3.922515e-07 4.109815e-04  ADAMTS1 ROI.type_vessel_epithelium
775
C11orf96 27.48924       1.142085 0.3041057 3.755554 1.729585e-04 2.588819e-02 C11orf96 ROI.type_vessel_epithelium
776
CNN1     16.87670       1.112662 0.2680222 4.151381 3.304757e-05 9.766004e-03     CNN1 ROI.type_vessel_epithelium
777
CRYAB    21.85960       1.264747 0.2173272 5.819552 5.900570e-09 2.472929e-05    CRYAB ROI.type_vessel_epithelium
778
FLNA     44.50957       1.270025 0.3243115 3.916066 9.000548e-05 1.985331e-02     FLNA ROI.type_vessel_epithelium</code></pre>
779
</div>
780
<p><br></p>
781
<p>The <strong>vrHeatmapPlot</strong> takes a set of features for any
782
type of spatial point (cells, spots and ROIs) and visualizes scaled data
783
per each feature. We select <strong>highlight.some = TRUE</strong> to
784
annotate features which could be large in size where you can also select
785
the number of such highlighted genes with <strong>n_highlight</strong>.
786
There seems to be two groups of fibrotic regions that most likely
787
associated with two prolonged case samples.</p>
788
<pre class="r watch-out"><code># get DE for all conditions
789
library(ComplexHeatmap)
790
vrHeatmapPlot(GeoMxR1, features = unique(DEresults_sig$gene), group.by = &quot;ROI.type&quot;, 
791
              highlight.some = TRUE, n_highlight = 40)</code></pre>
792
<p><img width="90%" height="90%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/roi_heatmap.png" class="center"></p>
793
<p><br></p>
794
<p>In order to get a deeper understanding of differences between
795
fibrotic regions across two prolonged case replicates. We first subset
796
the GeoMx data to only sections with fibrotic ROIs.</p>
797
<pre class="r watch-out"><code>fibrotic_ROI &lt;- vrSpatialPoints(GeoMxR1)[GeoMxR1$ROI.type == &quot;fibrotic&quot;]
798
GeoMxR1_subset &lt;- subset(GeoMxR1, spatialpoints = fibrotic_ROI)
799
vrSpatialPlot(GeoMxR1_subset, group.by = &quot;ROI.type&quot;, ncol = 3, alpha = 0.4)</code></pre>
800
<p><img width="90%" height="90%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/roi_spatialplot_fibrotic.png" class="center"></p>
801
<p>The <strong>getDiffExp</strong> function is capable of testing
802
differential expression across all metadata columns, including the
803
<strong>Samples</strong> column that captures labels of different tissue
804
sections. Macrophage markers such as CD68 and CD163 are differentially
805
expressed in fibrotic regions of case 5 compared to case 4, including
806
FN1, a profibrotic gene whose expression can be found on
807
macrophages.</p>
808
<pre class="r watch-out"><code>DEresults &lt;- getDiffExp(GeoMxR1_subset, group.by = &quot;Sample&quot;, 
809
                        group.base = &quot;prolonged case 5&quot;, method = &quot;DESeq2&quot;)
810
DEresults_sig &lt;- DEresults %&gt;% filter(!is.na(padj)) %&gt;%
811
  filter(padj &lt; 0.05, abs(log2FoldChange) &gt; 1)
812
DEresults_sig &lt;- DEresults_sig[order(DEresults_sig$log2FoldChange, decreasing = TRUE),]
813
head(DEresults_sig)</code></pre>
814
<div>
815
<pre><code style="font-size: 10.7px;">       baseMean log2FoldChange     lfcSE      stat       pvalue         padj   gene                               comparison
816
COL3A1 708.5599       6.635411 0.5198805 12.763338 2.626978e-37 1.596809e-33 COL3A1 Sample_prolonged case 5_prolonged case 4
817
COL1A2 836.0790       5.237228 0.4407380 11.882861 1.453071e-32 4.416246e-29 COL1A2 Sample_prolonged case 5_prolonged case 4
818
COL1A1 460.2184       5.175153 0.5237868  9.880267 5.069785e-23 3.081669e-20 COL1A1 Sample_prolonged case 5_prolonged case 4
819
FN1    278.6594       5.083687 0.3717299 13.675754 1.417301e-42 1.723013e-38    FN1 Sample_prolonged case 5_prolonged case 4
820
HBB    202.7693       4.944228 0.4884175 10.122955 4.370193e-24 3.794888e-21    HBB Sample_prolonged case 5_prolonged case 4
821
A2M    466.4328       4.925236 0.4542682 10.842133 2.173435e-27 3.774636e-24    A2M Sample_prolonged case 5_prolonged case 4</code></pre>
822
</div>
823
<p><br></p>
824
<!-- Markers of each individual tissue section for each disease duration is shown on the Heatmap.  -->
825
<!-- ```{r eval = FALSE, class.source="watch-out"} -->
826
<!-- # get DE for all conditions -->
827
<!-- vrHeatmapPlot(GeoMxR1, features = unique(DEresults_sig$gene),  -->
828
<!--               group.by = "Sample", highlight.some = TRUE) -->
829
<!-- ``` -->
830
<!-- <img width="90%" height="90%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/roi_heatmap2.png" class="center"> -->
831
<!-- <br> -->
832
</div>
833
<div id="roi-deconvolution" class="section level2">
834
<h2>ROI Deconvolution</h2>
835
<p>VoltRon supports multiple bulk RNA deconvolution algorithms to
836
analyze the cellular composition of both ROIs and spots. In order to
837
integrate the scRNA data and the GeoMx data sets within the VoltRon
838
objects, we will use the <a
839
href="https://xuranw.github.io/MuSiC/articles/MuSiC.html">MuSiC</a>
840
package. We will use a human lung scRNA dataset (GSE198864) as
841
reference, which is found <a
842
href="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/ROIanalysis/GSE198864_lung.rds">here</a>.</p>
843
<pre class="r watch-out"><code>set.seed(1)
844
library(Seurat)
845
library(SingleCellExperiment)
846
seu &lt;- readRDS(&quot;GSE198864_lung.rds&quot;)
847
scRNAlung &lt;- seu[,sample(1:ncol(seu), 10000, replace = FALSE)]
848
849
# Visualize clusters
850
DimPlot(scRNAlung, reduction = &quot;umap&quot;, label = T, group.by = &quot;Clusters&quot;) + NoLegend()</code></pre>
851
<p><img width="60%" height="60%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/roi_deconvolution_singlecell.png" class="center"></p>
852
<p>We utilize the <strong>getDeconvolution</strong> function to call
853
wrapper functions for deconvolution algorithms (see ). For all layers
854
with GoeMx assays, an additional assay within the same layer with
855
<strong>_decon</strong> postfix will be created. The
856
<strong>sc.object</strong> argument can either be a
857
<strong>Seurat</strong> or <strong>SingleCellExperiment</strong>
858
object.</p>
859
<pre class="r watch-out"><code>library(MuSiC)
860
GeoMxR1 &lt;- getDeconvolution(GeoMxR1,
861
                            sc.object = scRNAlung, sc.assay = &quot;RNA&quot;, 
862
                            sc.cluster = &quot;Clusters&quot;, sc.samples = &quot;orig.ident&quot;)</code></pre>
863
<pre><code>VoltRon Object 
864
prolonged case 4: 
865
  Layers: Section1 
866
acute case 3: 
867
  Layers: Section1 
868
control case 2: 
869
  Layers: Section1 
870
acute case 1: 
871
  Layers: Section1 
872
acute case 2: 
873
  Layers: Section1 
874
... 
875
There are 8 samples in total 
876
Assays: GeoMx(Main) 
877
Features: RNA(Main) NegProbe Decon </code></pre>
878
<p>We can now visualize cell type compositions of each ROI. Before
879
running <strong>vrProportionPlot</strong> function, we need to set the
880
main feature type as <strong>Decon</strong>. One may see the increased
881
proportion of cells NK cells and T cells in immune ROIs.</p>
882
<pre class="r watch-out"><code>vrMainFeatureType(GeoMxR1) &lt;- &quot;Decon&quot;
883
vrProportionPlot(GeoMxR1, x.label = &quot;ROI.name&quot;)</code></pre>
884
<p><img width="100%" height="100%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/roi_deconvolution.png" class="center"></p>
885
<p>Here, we can subset the GeoMx object further to dive deep into the
886
cellular proportions of each fibrotic region of prolonged cases.
887
Comparing prolonged case 5 against case 4, we see an increase in the
888
cellular population of the stromal cluster defined in <a
889
href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9922044/">Mothes et.
890
al 2023</a> (that are both vascular and airway smooth muscle cells), and
891
an increase abundance of macrophages which may indicate that these
892
macrophages are profibrotic being within and close to fibrotic regions
893
with increased gene expression of FN1.</p>
894
<pre class="r watch-out"><code># subsetting fibrotic regions
895
spatialpoints &lt;- vrSpatialPoints(GeoMxR1)[GeoMxR1$ROI.type == &quot;fibrotic&quot;]
896
GeoMxR1_subset &lt;- subset(GeoMxR1, spatialpoints = spatialpoints)
897
898
# Proportion plot
899
vrProportionPlot(GeoMxR1_subset, x.label = &quot;ROI.name&quot;, split.method = &quot;facet_grid&quot;, 
900
                 split.by = &quot;Sample&quot;)
901
902
# barplot 
903
vrBarPlot(GeoMxR1_subset, features = c(&quot;stromal&quot;, &quot;macrophages&quot;), group.by = &quot;Sample&quot;,
904
          x.label = &quot;ROI.name&quot;, split.by = &quot;Sample&quot;)</code></pre>
905
<p><img width="80%" height="80%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/roi_heatmap_fibrotic.png" class="center"></p>
906
<p><img width="80%" height="80%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/roi_barplot_prop_fibrotic.png" class="center"></p>
907
</div>
908
<div id="he-image-integration" class="section level2">
909
<h2>H&amp;E Image Integration</h2>
910
<p>Questions may arise if in fact these ROIs are fibrotic even though
911
they were initially annotated as fibrotic regions. VoltRon provides
912
advanced image registration workflows which we can use to H&amp;E images
913
of from the same TMA blocks where GeoMx slides were established.</p>
914
<p>We first import the H&amp;E image of the prolonged case 4 TMA section
915
using the <strong>importImageData</strong> function. This will import
916
the H&amp;E image as a standalone VoltRon object. For more information
917
on image-based VoltRon objects, see the <a
918
href="pixelanalysis.html">Downstream analysis of Pixels</a> section.</p>
919
<p>We will use the H&amp;E image of TMA section taken from the same
920
block as the Prolonged case 4. You can download the image from <a
921
href="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/ROIanalysis/GeoMx/prolonged_case4_HE.tif">here</a>.</p>
922
<pre class="r watch-out"><code>vrHEimage &lt;- importImageData(&quot;prolonged_case4_HE.tif&quot;, channel_names = &quot;H&amp;E&quot;)
923
vrImages(vrHEimage, scale.perc = 40)</code></pre>
924
<p><img width="50%" height="50%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/prolonged_case4_HE.png" class="center"></p>
925
<p><br></p>
926
<p>We can now register the GeoMx slide with the newly imported H&amp;E
927
based VoltRon object. Since two images are associated with TMA sections
928
that are not adjacent, we have to rely on the localization of vessels
929
visible in both images for alignment. VoltRon allows manipulating
930
multiple channels of an image object two choose the best background
931
image for manual landmark selection. For more information on both manual
932
and automated registration of VoltRon objects, see <a
933
href="registration.html">here</a>.</p>
934
<p>VoltRon provides multiple registration methods to align images. Here,
935
after running the <strong>registerSpatialData</strong> function, we
936
choose the <strong>Homography + Non-rigid (TPS)</strong> method which
937
utilizes a perspective transformation on the H&amp;E image followed by a
938
thin plate spline (TPS) alignment. The perspective transformation
939
performs a global alignment between the H&amp;E image and the main GeoMx
940
image (here the scan image with combined antibody channels), and the TPS
941
method allows correct local deformations between the perspective
942
transformed H&amp;E image and the GeoMx image for a more accurate</p>
943
<pre class="r watch-out"><code>GeoMxR1_subset &lt;- subset(GeoMxR1, sample = c(&quot;prolonged case 4&quot;))
944
GeoMxReg &lt;- registerSpatialData(reference_spatdata = GeoMxR1_subset, 
945
                                query_spatdata = vrHEimage)</code></pre>
946
<p><img width="80%" height="80%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/roi_manualregistration.png" class="center"></p>
947
<p>The result of the registration is a list of registered VoltRon
948
objects which we can use for parsing the registered image as well. In
949
this case, the second element of the resulting list would be the
950
registered H&amp;E based VoltRon object.</p>
951
<pre class="r watch-out"><code>vrHEimage_reg &lt;- GeoMxReg$registered_spat[[2]]</code></pre>
952
<p>We can check the additional coordinate system now available for the
953
registered H&amp;E image. One is the coordinate system with the original
954
image, and the other with the one that is registered.</p>
955
<pre class="r watch-out"><code>vrSpatialNames(vrHEimage_reg)</code></pre>
956
<pre><code>[1] &quot;main&quot;     &quot;main_reg&quot;</code></pre>
957
<p>We can also exchange images where the H&amp;E image now is registered
958
to the perspective of the GeoMx channels, and can be defined as a new
959
channel in the original GeoMx object.</p>
960
<pre class="r watch-out"><code>vrImages(GeoMxR1_subset[[&quot;Assay1&quot;]], name = &quot;main&quot;, channel = &quot;H&amp;E&quot;) &lt;- vrImages(vrHEimage_reg, name = &quot;main_reg&quot;, channel = &quot;H&amp;E&quot;)</code></pre>
961
<p>We can now observe the new channels (H&amp;E) available for the GeoMx
962
assay using <strong>vrImageChannelNames</strong>. H&amp;E is saved as a
963
separate channel along with the originally available antibody channels
964
of the original GeoMx experiment.</p>
965
<pre class="r watch-out"><code>vrImageChannelNames(GeoMxR1_subset)</code></pre>
966
<div>
967
<pre><code style="font-size: 12px;">       Assay    Layer           Sample Spatial                                               Channels
968
Assay1 GeoMx Section1 prolonged case 4    main scanimage,DNA,PanCK,CD45,Alpha Smooth Muscle Actin,H&E</code></pre>
969
</div>
970
<p>We can now visualize the ROIs and their annotations where the
971
registered H&amp;E visible in the background. We define the spatial key
972
<strong>main</strong> and the channel name <strong>H&amp;E</strong>.</p>
973
<pre class="r watch-out"><code>vrSpatialPlot(GeoMxR1_subset, group.by = &quot;ROI.type&quot;, alpha = 0.7, 
974
              spatial = &quot;main&quot;, channel = &quot;H&amp;E&quot;)</code></pre>
975
<p><img width="70%" height="70%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/roi_spatialplot_withHE.png" class="center"></p>
976
<p>Interactive Visualization can also be used to zoom in to ROIs and
977
investigate the pathology associated with GeoMx ROIs labeled as
978
fibrotic.</p>
979
<pre class="r watch-out"><code>vrSpatialPlot(GeoMxR1_subset, group.by = &quot;ROI.type&quot;, alpha = 0.7, 
980
              spatial = &quot;main&quot;, channel = &quot;H&amp;E&quot;, 
981
              interactive = TRUE)</code></pre>
982
<p><img width="60%" height="60%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/roi_spatialplot_withHE_interactive.png" class="center"></p>
983
</div>
984
</div>
985
986
987
988
</div>
989
</div>
990
991
</div>
992
993
<script>
994
995
// add bootstrap table styles to pandoc tables
996
function bootstrapStylePandocTables() {
997
  $('tr.odd').parent('tbody').parent('table').addClass('table table-condensed');
998
}
999
$(document).ready(function () {
1000
  bootstrapStylePandocTables();
1001
});
1002
1003
1004
</script>
1005
1006
<!-- tabsets -->
1007
1008
<script>
1009
$(document).ready(function () {
1010
  window.buildTabsets("TOC");
1011
});
1012
1013
$(document).ready(function () {
1014
  $('.tabset-dropdown > .nav-tabs > li').click(function () {
1015
    $(this).parent().toggleClass('nav-tabs-open');
1016
  });
1017
});
1018
</script>
1019
1020
<!-- code folding -->
1021
1022
<script>
1023
$(document).ready(function ()  {
1024
1025
    // temporarily add toc-ignore selector to headers for the consistency with Pandoc
1026
    $('.unlisted.unnumbered').addClass('toc-ignore')
1027
1028
    // move toc-ignore selectors from section div to header
1029
    $('div.section.toc-ignore')
1030
        .removeClass('toc-ignore')
1031
        .children('h1,h2,h3,h4,h5').addClass('toc-ignore');
1032
1033
    // establish options
1034
    var options = {
1035
      selectors: "h1,h2,h3",
1036
      theme: "bootstrap3",
1037
      context: '.toc-content',
1038
      hashGenerator: function (text) {
1039
        return text.replace(/[.\\/?&!#<>]/g, '').replace(/\s/g, '_');
1040
      },
1041
      ignoreSelector: ".toc-ignore",
1042
      scrollTo: 0
1043
    };
1044
    options.showAndHide = false;
1045
    options.smoothScroll = false;
1046
1047
    // tocify
1048
    var toc = $("#TOC").tocify(options).data("toc-tocify");
1049
});
1050
</script>
1051
1052
<!-- dynamically load mathjax for compatibility with self-contained -->
1053
<script>
1054
  (function () {
1055
    var script = document.createElement("script");
1056
    script.type = "text/javascript";
1057
    script.src  = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
1058
    document.getElementsByTagName("head")[0].appendChild(script);
1059
  })();
1060
</script>
1061
1062
</body>
1063
</html>