a b/docs/voltronobjects.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>Importing Spatial Data</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">Importing Spatial Data</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="working-with-voltron-objects" class="section level1">
468
<h1>Working with VoltRon objects</h1>
469
<p>In this tutorial, we will cover some of the fundemantel built-in
470
functions of VoltRon to manage data, images and spatial information of
471
assays. Here is the list of example datasets included in the
472
Package.</p>
473
<pre class="r watch-out"><code>data(&quot;visium_data&quot;)
474
data(&quot;melc_data&quot;)
475
data(&quot;xenium_data&quot;)
476
data(&quot;merged_object&quot;)</code></pre>
477
<p><br></p>
478
<div id="samplemetadata" class="section level2">
479
<h2>Sample Metadata</h2>
480
<p>The sample metadata is a summarized data frame which provides
481
informations on assays, layers and sample (tissue blocks) included in
482
the VoltRon object. You can use the <strong>SampleMetadata</strong>
483
function to call this table. The row names are the unique assay IDs,
484
following assay types (e.g. Visium), layer name and Sample (typicall
485
tissue block with multiple layers and assays).</p>
486
<pre class="r watch-out"><code>SampleMetadata(visium_data)</code></pre>
487
<pre><code>##         Assay    Layer    Sample
488
## Assay1 Visium Section1 Anterior1</code></pre>
489
<p><br></p>
490
</div>
491
<div id="metadata" class="section level2">
492
<h2>Metadata</h2>
493
<p>The <strong>Metadata</strong> function calls the metadata table of
494
the main assay type (see <a href="#assays">vrMainAssay</a>).</p>
495
<pre class="r watch-out"><code>Metadata(visium_data)</code></pre>
496
<pre><code>##                                                  id Count assay_id  Assay    Layer    Sample
497
## AAAGGCTCTCGCGCCG-1_Assay1 AAAGGCTCTCGCGCCG-1_Assay1 39690   Assay1 Visium Section1 Anterior1
498
## AAATGGCCCGTGCCCT-1_Assay1 AAATGGCCCGTGCCCT-1_Assay1 33516   Assay1 Visium Section1 Anterior1
499
## AAATTACACGACTCTG-1_Assay1 AAATTACACGACTCTG-1_Assay1 12250   Assay1 Visium Section1 Anterior1
500
## AAGACATACGTGGTTT-1_Assay1 AAGACATACGTGGTTT-1_Assay1 31821   Assay1 Visium Section1 Anterior1
501
## ACCTACTATAAATCTA-1_Assay1 ACCTACTATAAATCTA-1_Assay1 41387   Assay1 Visium Section1 Anterior1
502
## ACGCGGGCCAAGGACA-1_Assay1 ACGCGGGCCAAGGACA-1_Assay1 48003   Assay1 Visium Section1 Anterior1</code></pre>
503
<p>You can also specify the assay ID or the assay type to call metadata
504
of a subset of spatial points.</p>
505
<pre class="r watch-out"><code>Metadata(visium_data, assay = &quot;Visium&quot;)
506
Metadata(visium_data, assay = &quot;Assay1&quot;)</code></pre>
507
<p>The <strong>type</strong> argument returns all spatial points of a
508
given spatial point type (ROI, spot, cell, molecule or tile).</p>
509
<pre class="r watch-out"><code>Metadata(visium_data, type = &quot;spot&quot;)</code></pre>
510
<p>If the type argument is specified as <strong>all</strong>. Then this
511
would return the VoltRon Metadata Object (vrMetadata)</p>
512
<pre class="r watch-out"><code>Metadata(visium_data, type = &quot;all&quot;)</code></pre>
513
<pre><code>## VoltRon Metadata Object 
514
## This object includes: 
515
##    100 spots</code></pre>
516
<p><br></p>
517
</div>
518
<div id="spatialpoints" class="section level2">
519
<h2>Spatial Points</h2>
520
<p>In a VoltRon object, spatial points are spatially defined entities
521
with coordinates, segments which are of any of five assay types (ROI,
522
spot, cell, molecule and tile).</p>
523
<p>The <strong>vrSpatialPoints</strong> function return the IDs of these
524
entities for further downstream operations, such as subsetting etc.</p>
525
<pre class="r watch-out"><code>vrSpatialPoints(visium_data)</code></pre>
526
<pre><code>## [1] &quot;AAAGGCTCTCGCGCCG-1_Assay1&quot; &quot;AAATGGCCCGTGCCCT-1_Assay1&quot; &quot;AAATTACACGACTCTG-1_Assay1&quot;</code></pre>
527
<p>You can also specify the assay ID or the assay type to call metadata
528
of a subset of spatial points.</p>
529
<pre class="r watch-out"><code>vrSpatialPoints(visium_data, assay = &quot;Visium&quot;)
530
vrSpatialPoints(visium_data, assay = &quot;Assay1&quot;)</code></pre>
531
<pre><code>## [1] &quot;AAAGGCTCTCGCGCCG-1_Assay1&quot; &quot;AAATGGCCCGTGCCCT-1_Assay1&quot; &quot;AAATTACACGACTCTG-1_Assay1&quot;</code></pre>
532
<p><br></p>
533
</div>
534
<div id="assays" class="section level2">
535
<h2>Assays</h2>
536
<p>The default (or main) assay of the VoltRon object is typically shown
537
when printed (next to the assay name says “main” in paranthesis)</p>
538
<pre class="r watch-out"><code>melc_data</code></pre>
539
<pre><code>## VoltRon Object 
540
## control_case_3: 
541
##   Layers: Section1 
542
## Assays: MELC(Main) 
543
## Features: main(Main)</code></pre>
544
<p>You can also call/get the name of the default (or main) using the
545
<strong>vrMainAssay</strong> function</p>
546
<pre class="r watch-out"><code>vrMainAssay(melc_data)</code></pre>
547
<pre><code>## [1] &quot;MELC&quot;</code></pre>
548
<p>You can also set the main assay yourself, but only the assay types
549
given in the <strong>Assay</strong> column of
550
<strong>SampleMetadata(object)</strong>.</p>
551
<pre class="r watch-out"><code>SampleMetadata(melc_data)</code></pre>
552
<pre><code>##        Assay    Layer         Sample
553
## Assay1  MELC Section1 control_case_3</code></pre>
554
<pre class="r watch-out"><code>vrMainAssay(melc_data) &lt;- &quot;MELC&quot;</code></pre>
555
<p>You can also get the assay IDs associated with the main assay using
556
<strong>vrAssayNames</strong> function.</p>
557
<pre class="r watch-out"><code>vrAssayNames(melc_data)</code></pre>
558
<pre><code>## [1] &quot;Assay1&quot;</code></pre>
559
<p>The assay type can be provided with the <strong>assay</strong>
560
arguement to get type specific assay IDs</p>
561
<pre class="r watch-out"><code>vrAssayNames(melc_data, assay = &quot;MELC&quot;)</code></pre>
562
<pre><code>## [1] &quot;Assay1&quot;</code></pre>
563
<p><br></p>
564
</div>
565
<div id="coordinates-and-segments" class="section level2">
566
<h2>Coordinates and Segments</h2>
567
<p>The <strong>vrCoordinates</strong> function is used to call the
568
centroids of spots, cells and all other spatial points types with
569
VoltRon objects.</p>
570
<pre class="r watch-out"><code>vrCoordinates(visium_data)</code></pre>
571
<pre><code>##                                   x        y z
572
## CCTTGACCACTTTATT-1_Assay1 463.78658 183.1497 0
573
## ATTTGTCTTGGGAGCT-1_Assay1 374.97419 275.8864 0
574
## TCACGCATTGTAGATC-1_Assay1 250.58520 319.1566 0
575
## CCGAGCTGTGCTTGTC-1_Assay1 474.47505 411.9449 0
576
## GCATGGGTACTGACGC-1_Assay1  87.10844 269.6902 0
577
## AGTCGGCCCAAACGAC-1_Assay1 215.00861 368.6231 0</code></pre>
578
<p>You can also specify the assay ID or the assay type to call
579
coordinates of a subset of spatial points.</p>
580
<pre class="r watch-out"><code>vrCoordinates(visium_data, assay = &quot;Visium&quot;)
581
vrCoordinates(visium_data, assay = &quot;Assay1&quot;)</code></pre>
582
<p><br></p>
583
<p>Each assay a VoltRon object may incorporate indefinite number of
584
coordinate systems. One can look for these coordinate systems using the
585
<strong>vrMainSpatial</strong> function, and select one of systems to
586
call coordinates (see <a href="#image">vrMainSpatial</a>)</p>
587
<pre class="r watch-out"><code>vrCoordinates(visium_data, spatial_name = &quot;main&quot;)</code></pre>
588
<p>The <strong>reg</strong> option in the <strong>vrCoordinates</strong>
589
function looks for a registered version of the main coordinate system
590
and returns its coordinates (if there is any).</p>
591
<pre class="r watch-out"><code>vrCoordinates(visium_data, spatial_name = &quot;main&quot;, reg = TRUE)</code></pre>
592
<pre><code>## Warning in .local(object, ...): There are no registered spatial systems with name main!</code></pre>
593
<pre><code>##                                   x        y z
594
## CCTTGACCACTTTATT-1_Assay1 463.78658 183.1497 0
595
## ATTTGTCTTGGGAGCT-1_Assay1 374.97419 275.8864 0
596
## TCACGCATTGTAGATC-1_Assay1 250.58520 319.1566 0
597
## CCGAGCTGTGCTTGTC-1_Assay1 474.47505 411.9449 0
598
## GCATGGGTACTGACGC-1_Assay1  87.10844 269.6902 0
599
## AGTCGGCCCAAACGAC-1_Assay1 215.00861 368.6231 0</code></pre>
600
<p><br></p>
601
<p>The arguements of the <strong>vrSegments</strong> functions are
602
idential to vrCoordinates and return a list of polygon corners
603
associated with the coordinate system of the coordinates.</p>
604
<pre class="r watch-out"><code>vrSegments(xenium_data)
605
vrSegments(xenium_data, assay = &quot;Xenium&quot;)
606
vrSegments(xenium_data, assay = &quot;Assay1&quot;)
607
vrSegments(xenium_data, spatial_name = &quot;main&quot;)
608
vrSegments(xenium_data, spatial_name = &quot;main&quot;, reg = TRUE)</code></pre>
609
<pre><code>## $`171_Assay1`
610
##     id      x      y
611
## 1  171 105.25 145.50
612
## 2  171 101.75 144.25
613
## 3  171 101.50 143.25
614
## 4  171 109.75 135.25
615
## 5  171 112.00 127.00
616
## 6  171 115.50 123.50
617
## 7  171 120.00 123.50
618
## 8  171 124.25 132.50
619
## 9  171 121.00 136.00
620
## 10 171 120.25 140.00
621
## 11 171 111.25 143.50
622
## 12 171 105.50 145.25
623
## 13 171 105.25 145.50
624
## 
625
## $`180_Assay1`
626
##     id      x      y
627
## 14 180 148.25 153.25
628
## 15 180 145.75 151.50
629
## 16 180 143.25 147.50
630
## 17 180 143.25 146.25
631
## 18 180 143.00 144.50
632
## 19 180 142.50 140.50
633
## 20 180 144.25 140.50
634
## 21 180 146.25 140.75
635
## 22 180 148.50 141.00
636
## 23 180 151.00 144.75
637
## 24 180 150.50 150.00
638
## 25 180 148.75 153.25
639
## 26 180 148.25 153.25</code></pre>
640
<p><br></p>
641
</div>
642
<div id="image" class="section level2">
643
<h2>Images and Coordinate Systems</h2>
644
<p>Below we review some of the essential built-in functions to
645
manipulate and manage images of a VoltRon object as well as the
646
coordinate systems that are associated with these images.</p>
647
<p><br></p>
648
<div id="spatial-coordinate-systems" class="section level3">
649
<h3>Spatial Coordinate Systems</h3>
650
<p>In a VoltRon object, each image has a unique ID which is also
651
associated with a coordinate (or spatial) system. The names of these
652
spatial systems can be called using the <strong>vrSpatialNames</strong>
653
function.</p>
654
<pre class="r watch-out"><code>vrSpatialNames(visium_data)</code></pre>
655
<pre><code>## [1] &quot;main&quot;</code></pre>
656
<p>You can also specify the assay ID or the assay type to call image
657
names of a subset assays or any assay type (see <a
658
href="#samplemetadata">Sample Metadata</a>)</p>
659
<pre class="r watch-out"><code>vrSpatialNames(visium_data, assay = &quot;Visium&quot;)
660
vrSpatialNames(visium_data, assay = &quot;Assay1&quot;)</code></pre>
661
<pre><code>## [1] &quot;main&quot;</code></pre>
662
<p><br></p>
663
<p>If you wanna see the list of all spatial systems associated with all
664
assays of the main assay type, you can call the
665
<strong>vrMainSpatial</strong> function.</p>
666
<pre class="r watch-out"><code>vrMainSpatial(visium_data)</code></pre>
667
<pre><code>##    Assay Spatial
668
## 1 Assay1    main</code></pre>
669
<p>You can also specify the assay ID or the assay type to call spatial
670
system names of a subset assays or any assay type (see <a
671
href="#samplemetadata">Sample Metadata</a>)</p>
672
<pre class="r watch-out"><code>vrMainSpatial(visium_data, assay = &quot;Visium&quot;)
673
vrMainSpatial(visium_data, assay = &quot;Assay1&quot;)</code></pre>
674
<pre><code>##    Assay Spatial
675
## 1 Assay1    main</code></pre>
676
<p><br></p>
677
</div>
678
<div id="channel-names" class="section level3">
679
<h3>Channel Names</h3>
680
<p>Each spatial system object (vrSpatial) in VoltRon object can also
681
include a indefinite number of channels which you can get (or request) a
682
list of for further use.</p>
683
<pre class="r watch-out"><code>vrImageChannelNames(melc_data)
684
vrImageChannelNames(melc_data, assay = &quot;MELC&quot;)
685
vrImageChannelNames(melc_data, assay = &quot;Assay1&quot;)</code></pre>
686
<pre><code>##        Assay    Layer         Sample Spatial  Channels
687
## Assay1  MELC Section1 control_case_3    MELC DAPI,CD45</code></pre>
688
<p><br></p>
689
</div>
690
<div id="get-and-set-images" class="section level3">
691
<h3>Get and Set Images</h3>
692
<p>In VoltRon, images can be called specifically, or return as a list.
693
The return image is of a magick image object (see <a
694
href="https://cran.r-project.org/web/packages/magick/vignettes/intro.html">magick</a>
695
package)</p>
696
<pre class="r watch-out"><code>vrImages(visium_data)
697
vrImages(visium_data, assay = &quot;Visium&quot;)
698
vrImages(visium_data, assay = &quot;Assay1&quot;)</code></pre>
699
<p><img src="voltronobjects_files/figure-html/unnamed-chunk-36-1.png" width="60%" style="display: block; margin: auto;" /></p>
700
<!-- <img width="50%" height="50%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/voltronobjects_HE.png" class="center"> -->
701
<p><br></p>
702
<p>Once you know the name of a specific channel, you can the image of a
703
specific channel by providing the name and the associated channel.</p>
704
<pre class="r watch-out"><code>vrImages(melc_data, name = &quot;MELC&quot;, channel = &quot;DAPI&quot;)</code></pre>
705
<p><img src="voltronobjects_files/figure-html/unnamed-chunk-38-1.png" width="60%" style="display: block; margin: auto;" /></p>
706
<!-- <img width="50%" height="50%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/importdata_DAPI.png" class="center"> -->
707
<p><br></p>
708
<p>You can set up the main channel as well as the main spatial system
709
name for later use.</p>
710
<pre class="r watch-out"><code>vrMainSpatial(melc_data, assay = &quot;Assay1&quot;) &lt;- c(&quot;MELC&quot;, &quot;CD45&quot;)
711
vrImages(melc_data)</code></pre>
712
<p><img src="voltronobjects_files/figure-html/unnamed-chunk-40-1.png" width="60%" style="display: block; margin: auto;" /></p>
713
<!-- <img width="50%" height="50%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/importdata_CD45.png" class="center"> -->
714
<p><br></p>
715
<p>You can also resize the images as they are being returned. This is
716
usually used for visualization purposes and helps speeding up
717
visualization for large images. This is accomplished with
718
<strong>scale.perc</strong> arguement.</p>
719
<pre class="r watch-out"><code>vrImages(melc_data, scale.perc = 25)</code></pre>
720
<p><br></p>
721
</div>
722
<div id="combining-image-channels" class="section level3">
723
<h3>Combining Image Channels</h3>
724
<p>VoltRon even allows manipulation of channel images if you also
725
provide an associate list of colors.</p>
726
<pre class="r watch-out"><code>melc_data &lt;- combineChannels(melc_data, 
727
                             channels = c(&quot;DAPI&quot;, &quot;CD45&quot;), colors = c(&quot;grey&quot;, &quot;green&quot;), 
728
                             channel_key = &quot;combined&quot;)</code></pre>
729
<p>These new images can be stored as new channels within the same image
730
object, and called later again</p>
731
<pre class="r watch-out"><code>vrImageChannelNames(melc_data)</code></pre>
732
<pre><code>##        Assay    Layer         Sample Spatial           Channels
733
## Assay1  MELC Section1 control_case_3    MELC DAPI,CD45,combined</code></pre>
734
<pre class="r watch-out"><code>vrImages(melc_data, channel = &quot;combined&quot;)</code></pre>
735
<p><img src="voltronobjects_files/figure-html/unnamed-chunk-45-1.png" width="60%" style="display: block; margin: auto;" /></p>
736
<p><br></p>
737
</div>
738
</div>
739
<div id="feature-matrix-data" class="section level2">
740
<h2>Feature Matrix (Data)</h2>
741
<pre class="r watch-out"><code>vrData(visium_data)[3:8,3:5]</code></pre>
742
<pre><code>##         AAATTACACGACTCTG-1_Assay1 AAGACATACGTGGTTT-1_Assay1 ACCTACTATAAATCTA-1_Assay1
743
## Gm19938                         0                         0                         0
744
## Gm37381                         0                         0                         0
745
## Rp1                             0                         0                         0
746
## Sox17                           0                         1                         1
747
## Gm37587                         0                         0                         0
748
## Gm37323                         0                         0                         0</code></pre>
749
<pre class="r watch-out"><code>vrData(visium_data, norm = TRUE)[3:8,3:5]</code></pre>
750
<pre><code>##         AAATTACACGACTCTG-1_Assay1 AAGACATACGTGGTTT-1_Assay1 ACCTACTATAAATCTA-1_Assay1
751
## Gm19938                         0                 0.0000000                 0.0000000
752
## Gm37381                         0                 0.0000000                 0.0000000
753
## Rp1                             0                 0.0000000                 0.0000000
754
## Sox17                           0                 0.2732722                 0.2164184
755
## Gm37587                         0                 0.0000000                 0.0000000
756
## Gm37323                         0                 0.0000000                 0.0000000</code></pre>
757
<p><br></p>
758
</div>
759
<div id="embedding" class="section level2">
760
<h2>Embeddings</h2>
761
<p>You can parse and even set individual embedding elements in a VoltRon
762
object.</p>
763
<pre class="r watch-out"><code>vrEmbeddingNames(xenium_data)</code></pre>
764
<pre><code>## [1] &quot;pca&quot;  &quot;umap&quot;</code></pre>
765
<p>You can use these names of get the associated embedding dataset from
766
the object.</p>
767
<pre class="r watch-out"><code>vrEmbeddings(xenium_data, type = &quot;umap&quot;)</code></pre>
768
<pre><code>##                    x        y
769
## 171_Assay1 -7.110343 0.451607
770
## 180_Assay1  5.333756 3.896294
771
## 182_Assay1  3.805085 4.581084
772
## 185_Assay1  5.330851 3.870111
773
## 197_Assay1 -4.397479 2.763229
774
## 206_Assay1 -1.753468 3.973698</code></pre>
775
<p>You can also set and create new embedding elements in the voltron
776
object. In this case, you have to make sure that the row names should
777
match with the targeted spatial points.</p>
778
<pre class="r watch-out"><code>new_umap_data &lt;- vrEmbeddings(xenium_data, type = &quot;umap&quot;)
779
vrEmbeddings(xenium_data, type = &quot;new_umap&quot;) &lt;- new_umap_data*2</code></pre>
780
<p>Now we can observe changes to the new embedding data.</p>
781
<pre class="r watch-out"><code>vrEmbeddings(xenium_data, type = &quot;new_umap&quot;)</code></pre>
782
<pre><code>##                     x        y
783
## 171_Assay1 -14.220687 0.903214
784
## 180_Assay1  10.667511 7.792587
785
## 182_Assay1   7.610170 9.162168
786
## 185_Assay1  10.661703 7.740223
787
## 197_Assay1  -8.794958 5.526458
788
## 206_Assay1  -3.506937 7.947396</code></pre>
789
<p>You can choose individual assay names or assay classes.</p>
790
<pre class="r watch-out"><code>vrEmbeddings(xenium_data, type = &quot;umap&quot;, assay = &quot;Xenium&quot;)
791
vrEmbeddings(xenium_data, type = &quot;pca&quot;, assay = &quot;Assay1&quot;)</code></pre>
792
<p><br></p>
793
</div>
794
<div id="subsetting-voltron-objects" class="section level2">
795
<h2>Subsetting VoltRon objects</h2>
796
<p><br></p>
797
<div id="sampleassay" class="section level3">
798
<h3>sample/assay</h3>
799
<p>VoltRon object can be subsetted in a variety of ways using assay
800
names, sample names, spatial point names, features (e.g. gene), image
801
coordinates (crop boxes or bounding boxes) as well as interactively.</p>
802
<pre class="r watch-out"><code>visium_data_subset &lt;- subset(visium_data, assays = &quot;Assay1&quot;)</code></pre>
803
<pre class="r watch-out"><code>visium_data_subset &lt;- subset(visium_data, samples = &quot;Anterior1&quot;)
804
visium_data_subset</code></pre>
805
<pre><code>## VoltRon Object 
806
## Anterior1: 
807
##   Layers: Section1 
808
## Assays: Visium(Main) 
809
## Features: RNA(Main)</code></pre>
810
<p><br></p>
811
</div>
812
<div id="spatial-points" class="section level3">
813
<h3>spatial points</h3>
814
<p>You can use a list of spatial points (typically using
815
<strong>vrSpatialPoints</strong> function, see <a
816
href="#spatialpoints">vrSpatialPoints</a>)</p>
817
<pre class="r watch-out"><code>selected_points &lt;- vrSpatialPoints(visium_data)
818
selected_points[1:20]</code></pre>
819
<pre><code>## [1] &quot;AAAGGCTCTCGCGCCG-1_Assay1&quot; &quot;AAATGGCCCGTGCCCT-1_Assay1&quot; &quot;AAATTACACGACTCTG-1_Assay1&quot;</code></pre>
820
<pre class="r watch-out"><code>visium_data_subset &lt;- subset(visium_data, spatialpoints = selected_points[1:20])
821
visium_data_subset</code></pre>
822
<pre><code>## VoltRon Object 
823
## Anterior1: 
824
##   Layers: Section1 
825
## Assays: Visium(Main) 
826
## Features: RNA(Main)</code></pre>
827
<p><br></p>
828
</div>
829
<div id="features" class="section level3">
830
<h3>features</h3>
831
<p>You can select a few number of features and subset the features given
832
this list. However, it would only subset the main assay (see <a
833
href="#assays">vrMainAssay</a>)</p>
834
<pre class="r watch-out"><code>selected_features &lt;- vrFeatures(visium_data)
835
selected_features[1:20]</code></pre>
836
<pre><code>##  [1] &quot;Xkr4&quot;          &quot;Gm1992&quot;        &quot;Gm19938&quot;       &quot;Gm37381&quot;       &quot;Rp1&quot;           &quot;Sox17&quot;         &quot;Gm37587&quot;       &quot;Gm37323&quot;       &quot;Mrpl15&quot;        &quot;Lypla1&quot;       
837
## [11] &quot;Tcea1&quot;         &quot;Rgs20&quot;         &quot;Gm16041&quot;       &quot;Atp6v1h&quot;       &quot;Oprk1&quot;         &quot;Npbwr1&quot;        &quot;Rb1cc1&quot;        &quot;4732440D04Rik&quot; &quot;Alkal1&quot;        &quot;St18&quot;</code></pre>
838
<pre class="r watch-out"><code>visium_data_subset &lt;- subset(visium_data, features = selected_features[1:20])
839
vrFeatures(visium_data_subset)</code></pre>
840
<pre><code>##  [1] &quot;Xkr4&quot;          &quot;Gm1992&quot;        &quot;Gm19938&quot;       &quot;Gm37381&quot;       &quot;Rp1&quot;           &quot;Sox17&quot;         &quot;Gm37587&quot;       &quot;Gm37323&quot;       &quot;Mrpl15&quot;        &quot;Lypla1&quot;       
841
## [11] &quot;Tcea1&quot;         &quot;Rgs20&quot;         &quot;Gm16041&quot;       &quot;Atp6v1h&quot;       &quot;Oprk1&quot;         &quot;Npbwr1&quot;        &quot;Rb1cc1&quot;        &quot;4732440D04Rik&quot; &quot;Alkal1&quot;        &quot;St18&quot;</code></pre>
842
<p><br></p>
843
</div>
844
<div id="interactive-subsetting" class="section level3">
845
<h3>Interactive subsetting</h3>
846
<p>VoltRon allows interactively subsetting spatial data. Using the
847
arguement <strong>interactive = TRUE</strong>, a mini Shiny app is
848
triggered where users can select a bounding box to crop the spatial
849
data.</p>
850
<pre class="r watch-out"><code>visium_data_subset_info &lt;- subset(visium_data, interactive = TRUE)
851
visium_data_subset &lt;- visium_data_subset_info$subsets[[1]]</code></pre>
852
<pre><code>VoltRon Object 
853
Anterior1_subset: 
854
  Layers: Section1 
855
Assays: Visium(Main) </code></pre>
856
<pre class="r watch-out"><code>vrImages(visium_data_subset)</code></pre>
857
<p><br></p>
858
</div>
859
</div>
860
<div id="visualization" class="section level2">
861
<h2>Visualization</h2>
862
<p>VoltRon provides visualization utilities for both spatial and
863
embedding level visualizations.</p>
864
<p><br></p>
865
<div id="spatial-plots" class="section level3">
866
<h3>Spatial Plots</h3>
867
<p><strong>vrSpatialPlot</strong> is the main function for visualize
868
labels and identities of cells. This information is parsed from the
869
Metadata of the main assay (see <a href="#assays">vrMainAssay</a>). The
870
users can also specify the assay.</p>
871
<pre class="r watch-out"><code>vrSpatialPlot(xenium_data, group.by = &quot;clusters&quot;)</code></pre>
872
<p><img width="50%" height="50%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/voltronobjects_sp.png" class="center"></p>
873
<p><br></p>
874
<p>You can also visualize the segments of spatial points and even get
875
the segments transparent</p>
876
<pre class="r watch-out"><code>vrSpatialPlot(xenium_data, group.by = &quot;clusters&quot;, plot.segments = TRUE, alpha = 0.6)</code></pre>
877
<p><img width="50%" height="50%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/voltronobjects_spsegment.png" class="center"></p>
878
<p><br></p>
879
<p>The background color can be set to any color.</p>
880
<pre class="r watch-out"><code>vrSpatialPlot(xenium_data, group.by = &quot;clusters&quot;, plot.segments = TRUE, 
881
              background.color = &quot;white&quot;)</code></pre>
882
<p><img width="50%" height="50%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/voltronobjects_spback.png" class="center"></p>
883
<p><br></p>
884
<p>In cases where there are multiple coordinate systems, you can get the
885
background set to the name of the image (or coordinate system). You can
886
get the name of these images from <a
887
href="#image">vrSpatialNames</a>.</p>
888
<p>If also want to select a channel from the same coordinate system, you
889
can set background arguement as a vector of 2 where first is the name of
890
the image (coordinate system) and the other would be channel name. You
891
can get the name of these channels from <a
892
href="#image">vrImageChannelNames</a>.</p>
893
<pre class="r watch-out"><code>vrSpatialPlot(xenium_data, group.by = &quot;clusters&quot;, plot.segments = TRUE,
894
              spatial = &quot;main&quot;)
895
vrSpatialPlot(xenium_data, group.by = &quot;clusters&quot;, plot.segments = TRUE,
896
              spatial = &quot;main&quot;, channel = &quot;DAPI&quot;)</code></pre>
897
<p><br></p>
898
<p>If the visualized assay is of a type “spot”, you can crop the image
899
to encapsulate the smallest subset that include all spots.</p>
900
<pre class="r watch-out"><code>vrSpatialPlot(visium_data, group.by = &quot;Sample&quot;, crop = TRUE)</code></pre>
901
<p><img width="50%" height="50%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/voltronobjects_spcrop.png" class="center"></p>
902
<p><br></p>
903
<p>The <strong>vrSpatialFeaturePlot</strong> functions the same way as
904
vrSpatialPlot but requires extra arguements such as
905
<strong>features</strong> for selecting features, <strong>norm</strong>
906
for normalized expression (default), and <strong>log</strong> for log
907
transformed counts.</p>
908
<pre class="r watch-out"><code>vrSpatialFeaturePlot(visium_data, features = &quot;Count&quot;)
909
vrSpatialFeaturePlot(visium_data, features = &quot;Stat1&quot;, norm = TRUE)</code></pre>
910
<p><img width="100%" height="100%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/voltronobjects_spfeature.png" class="center"></p>
911
<p><br></p>
912
<p>For all variations of <strong>vrSpatialPlot</strong> and
913
<strong>vrSpatialFeaturePlot</strong> functions above, you can specifiy
914
the assay names or assay class.</p>
915
<pre class="r watch-out"><code>vrSpatialPlot(visium_data, assay = &quot;Visium&quot;, plot.segments = TRUE)
916
vrSpatialPlot(visium_data, assay = &quot;Assay1&quot;, plot.segments = TRUE)
917
vrSpatialFeaturePlot(visium_data, assay = &quot;Visium&quot;, features = &quot;Count&quot;)
918
vrSpatialFeaturePlot(visium_data, assay = &quot;Assay1&quot;, features = &quot;Count&quot;)</code></pre>
919
<p><br></p>
920
</div>
921
<div id="spatial-plots-multi-layer" class="section level3">
922
<h3>Spatial Plots (Multi-Layer)</h3>
923
<p><strong>vrSpatialPlot</strong> function can be paired with the
924
<strong>addSpatialLayer</strong> function to add additional assays of
925
the same spatial coordinate system as the original assay. We use the
926
piping operator “|&gt;” to connect to functions which overlays the
927
results of the first image with the second.
928
<strong>addSpatialLayer</strong> will check if two assays are within the
929
same tissue block and coordinate system, and will overlay these assays
930
if thats the case.</p>
931
<p>This utility can be used to visualize molecules along with cell
932
segments. Here we can also color each individual molecule (gene)
933
type.</p>
934
<pre class="r watch-out"><code>library(ggnewscale)</code></pre>
935
<pre class="r watch-out"><code>vrSpatialPlot(merged_object, plot.segments = TRUE, group.by = &quot;clusters&quot;) |&gt;
936
  addSpatialLayer(merged_object, assay = &quot;Assay2&quot;, group.by = &quot;gene&quot;, alpha = 1, 
937
                  colors = list(KRT15 = &quot;blue&quot;, KRT14 = &quot;green&quot;))</code></pre>
938
<pre><code>## Warning: Duplicated `override.aes` is ignored.</code></pre>
939
<p><img src="voltronobjects_files/figure-html/unnamed-chunk-73-1.png" width="60%" style="display: block; margin: auto;" /></p>
940
<p><br></p>
941
<p>You can also visualize the segments that represents annotations of
942
the tissue sections along with the cells.</p>
943
<pre class="r watch-out"><code>vrSpatialPlot(merged_object, plot.segments = FALSE, group.by = &quot;clusters&quot;) |&gt;
944
  addSpatialLayer(merged_object, assay = &quot;Assay3&quot;, group.by = &quot;Region&quot;, alpha = 0.3, 
945
                  color = list(Region1 = &quot;blue&quot;, Region2 = &quot;yellow&quot;))</code></pre>
946
<pre><code>## Warning: Duplicated `override.aes` is ignored.</code></pre>
947
<p><img src="voltronobjects_files/figure-html/unnamed-chunk-74-1.png" width="60%" style="display: block; margin: auto;" /></p>
948
<p><br></p>
949
</div>
950
<div id="embedding-plots" class="section level3">
951
<h3>Embedding Plots</h3>
952
<p>Dimensional reduction and embedding features are also possible for
953
the VoltRon objects.</p>
954
<pre class="r watch-out"><code>vrEmbeddingPlot(xenium_data, embedding = &quot;umap&quot;, group.by = &quot;clusters&quot;, label = T)</code></pre>
955
<p><img width="50%" height="50%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/voltronobjects_embed.png" class="center"></p>
956
<p><br></p>
957
<p>The <strong>vrEmbeddingFeaturePlot</strong> functions the same way as
958
vrEmbeddingPlot but requires extra arguements such as
959
<strong>features</strong> for selecting features, <strong>norm</strong>
960
for normalized expression (default), and <strong>log</strong> for log
961
transformed counts.</p>
962
<pre class="r watch-out"><code>vrEmbeddingFeaturePlot(xenium_data, embedding = &quot;umap&quot;, features = &quot;Count&quot;)
963
vrEmbeddingFeaturePlot(xenium_data, embedding = &quot;umap&quot;, features = &quot;KRT5&quot;, norm = FALSE)</code></pre>
964
<p><img width="100%" height="100%" src="https://bimsbstatic.mdc-berlin.de/landthaler/VoltRon/Package/images/voltronobjects_embedfeature.png" class="center"></p>
965
<p><br></p>
966
<p>For all variations of <strong>vrEmbeddingPlot</strong> and
967
<strong>vrEmbeddingFeaturePlot</strong> functions above, you can
968
specifiy the assay names or assay class.</p>
969
<pre class="r watch-out"><code>vrEmbeddingPlot(xenium_data, assay = &quot;Xenium&quot;, embedding = &quot;umap&quot;)
970
vrEmbeddingPlot(xenium_data, assay = &quot;Assay1&quot;, embedding = &quot;umap&quot;)
971
vrEmbeddingFeaturePlot(xenium_data, assay = &quot;Xenium&quot;, embedding = &quot;umap&quot;, features = &quot;Count&quot;)
972
vrEmbeddingFeaturePlot(xenium_data, assay = &quot;Assay1&quot;, embedding = &quot;umap&quot;, features = &quot;Count&quot;)</code></pre>
973
</div>
974
</div>
975
</div>
976
977
978
979
</div>
980
</div>
981
982
</div>
983
984
<script>
985
986
// add bootstrap table styles to pandoc tables
987
function bootstrapStylePandocTables() {
988
  $('tr.odd').parent('tbody').parent('table').addClass('table table-condensed');
989
}
990
$(document).ready(function () {
991
  bootstrapStylePandocTables();
992
});
993
994
995
</script>
996
997
<!-- tabsets -->
998
999
<script>
1000
$(document).ready(function () {
1001
  window.buildTabsets("TOC");
1002
});
1003
1004
$(document).ready(function () {
1005
  $('.tabset-dropdown > .nav-tabs > li').click(function () {
1006
    $(this).parent().toggleClass('nav-tabs-open');
1007
  });
1008
});
1009
</script>
1010
1011
<!-- code folding -->
1012
1013
<script>
1014
$(document).ready(function ()  {
1015
1016
    // temporarily add toc-ignore selector to headers for the consistency with Pandoc
1017
    $('.unlisted.unnumbered').addClass('toc-ignore')
1018
1019
    // move toc-ignore selectors from section div to header
1020
    $('div.section.toc-ignore')
1021
        .removeClass('toc-ignore')
1022
        .children('h1,h2,h3,h4,h5').addClass('toc-ignore');
1023
1024
    // establish options
1025
    var options = {
1026
      selectors: "h1,h2,h3,h4",
1027
      theme: "bootstrap3",
1028
      context: '.toc-content',
1029
      hashGenerator: function (text) {
1030
        return text.replace(/[.\\/?&!#<>]/g, '').replace(/\s/g, '_');
1031
      },
1032
      ignoreSelector: ".toc-ignore",
1033
      scrollTo: 0
1034
    };
1035
    options.showAndHide = false;
1036
    options.smoothScroll = false;
1037
1038
    // tocify
1039
    var toc = $("#TOC").tocify(options).data("toc-tocify");
1040
});
1041
</script>
1042
1043
<!-- dynamically load mathjax for compatibility with self-contained -->
1044
<script>
1045
  (function () {
1046
    var script = document.createElement("script");
1047
    script.type = "text/javascript";
1048
    script.src  = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
1049
    document.getElementsByTagName("head")[0].appendChild(script);
1050
  })();
1051
</script>
1052
1053
</body>
1054
</html>