Skip to content

Commit

Permalink
Deploying to gh-pages from @ dde4a1d 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
LouiseDck committed Sep 11, 2024
1 parent 6a202f8 commit eb3009f
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 33 deletions.
13 changes: 11 additions & 2 deletions book/in_memory/reticulate.html
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ <h1 data-number="6"><span class="header-section-number">6</span> Reticulate: bas
</div>
<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>rd<span class="sc">$</span><span class="fu">choice</span>(example)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] 2</code></pre>
<pre><code>[1] 3</code></pre>
</div>
<div class="sourceCode cell-code" id="cb5"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>bi<span class="sc">$</span><span class="fu">list</span>(bi<span class="sc">$</span><span class="fu">reversed</span>(example))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
Expand Down Expand Up @@ -422,7 +422,16 @@ <h1 data-number="8"><span class="header-section-number">8</span> Usecase</h1>
<div class="sourceCode cell-code" id="cb19"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a>path <span class="ot">&lt;-</span> <span class="st">"umap.png"</span></span>
<span id="cb19-2"><a href="#cb19-2" aria-hidden="true" tabindex="-1"></a>sc<span class="sc">$</span>pl<span class="sc">$</span><span class="fu">umap</span>(adata, <span class="at">color=</span><span class="st">"leiden_res1"</span>, <span class="at">save=</span>path)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<p><img src="../../figuresumapumap.png" id="fig-umap.png" class="img-fluid" alt="UMAP plot of the adata object">)</p>
<div id="fig-umap.png" class="quarto-float quarto-figure quarto-figure-center anchored">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-umap.png-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="../../figuresumapumap.png" class="img-fluid figure-img">
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-umap.png-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;8.1: UMAP plot of the adata object
</figcaption>
</figure>
</div>


</section>
Expand Down
30 changes: 19 additions & 11 deletions book/in_memory/rpy2.html
Original file line number Diff line number Diff line change
Expand Up @@ -387,17 +387,25 @@ <h2 data-number="4.1" class="anchored" data-anchor-id="rpy2-basic-functionality"
<div class="cell-output cell-output-stdout">
<pre><code>
0%| | 0.00/9.82M [00:00&lt;?, ?B/s]
0%| | 8.00k/9.82M [00:00&lt;02:10, 78.6kB/s]
0%| | 32.0k/9.82M [00:00&lt;01:01, 167kB/s]
1%| | 96.0k/9.82M [00:00&lt;00:27, 366kB/s]
2%|1 | 192k/9.82M [00:00&lt;00:17, 578kB/s]
4%|3 | 400k/9.82M [00:00&lt;00:09, 1.08MB/s]
8%|8 | 816k/9.82M [00:00&lt;00:04, 2.04MB/s]
16%|#6 | 1.62M/9.82M [00:00&lt;00:02, 3.95MB/s]
33%|###3 | 3.25M/9.82M [00:00&lt;00:00, 7.69MB/s]
63%|######3 | 6.23M/9.82M [00:00&lt;00:00, 14.2MB/s]
94%|#########3| 9.21M/9.82M [00:01&lt;00:00, 18.7MB/s]
100%|##########| 9.82M/9.82M [00:01&lt;00:00, 9.39MB/s]</code></pre>
0%| | 8.00k/9.82M [00:00&lt;02:25, 70.5kB/s]
0%| | 32.0k/9.82M [00:00&lt;01:08, 150kB/s]
1%| | 96.0k/9.82M [00:00&lt;00:30, 332kB/s]
2%|2 | 208k/9.82M [00:00&lt;00:17, 578kB/s]
4%|4 | 424k/9.82M [00:00&lt;00:09, 1.03MB/s]
9%|8 | 872k/9.82M [00:00&lt;00:04, 1.98MB/s]
14%|#4 | 1.38M/9.82M [00:00&lt;00:03, 2.70MB/s]
17%|#6 | 1.62M/9.82M [00:00&lt;00:03, 2.64MB/s]
29%|##8 | 2.83M/9.82M [00:01&lt;00:01, 5.11MB/s]
30%|### | 2.98M/9.82M [00:01&lt;00:01, 3.90MB/s]
45%|####5 | 4.46M/9.82M [00:01&lt;00:00, 6.69MB/s]
53%|#####2 | 5.16M/9.82M [00:01&lt;00:00, 6.52MB/s]
60%|#####9 | 5.86M/9.82M [00:01&lt;00:00, 6.38MB/s]
67%|######6 | 6.58M/9.82M [00:01&lt;00:00, 6.34MB/s]
74%|#######4 | 7.30M/9.82M [00:01&lt;00:00, 6.34MB/s]
82%|########1 | 8.03M/9.82M [00:01&lt;00:00, 6.33MB/s]
89%|########9 | 8.77M/9.82M [00:02&lt;00:00, 6.37MB/s]
97%|#########6| 9.51M/9.82M [00:02&lt;00:00, 6.38MB/s]
100%|##########| 9.82M/9.82M [00:02&lt;00:00, 4.73MB/s]</code></pre>
</div>
<div class="sourceCode cell-code" id="cb10"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a><span class="cf">with</span> anndata2ri.converter.context():</span>
Expand Down
4 changes: 2 additions & 2 deletions search.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
"href": "book/in_memory/rpy2.html",
"title": "4  Rpy2",
"section": "",
"text": "4.1 Rpy2: basic functionality\nRpy2 is a foreign function interface to R. It can be used in the following way:\nimport rpy2\nimport rpy2.robjects as robjects\n\n/home/runner/work/polygloty/polygloty/renv/python/virtualenvs/renv-python-3.12/lib/python3.12/site-packages/rpy2/rinterface_lib/embedded.py:276: UserWarning: R was initialized outside of rpy2 (R_NilValue != NULL). Trying to use it nevertheless.\n warnings.warn(msg)\nR was initialized outside of rpy2 (R_NilValue != NULL). Trying to use it nevertheless.\n\nvector = robjects.IntVector([1,2,3])\nrsum = robjects.r['sum']\n\nrsum(vector)\n\n\n IntVector with 1 elements.\n \n\n\n\n6\nLuckily, we’re not restricted to just calling R functions and creating R objects. The real power of this in-memory interoperability lies in the conversion of Python objects to R objects to call R functions on, and then to the conversion of the results back to Python objects.\nRpy2 requires specific conversion rules for different Python objects. It is straightforward to create R vectors from corresponding Python lists:\nstr_vector = robjects.StrVector(['abc', 'def', 'ghi'])\nflt_vector = robjects.FloatVector([0.3, 0.8, 0.7])\nint_vector = robjects.IntVector([1, 2, 3])\nmtx = robjects.r.matrix(robjects.IntVector(range(10)), nrow=5)\nHowever, for single cell biology, the objects that are most interesting to convert are (count) matrices, arrays and dataframes. In order to do this, you need to import the corresponding rpy2 modules and specify the conversion context.\nimport numpy as np\n\nfrom rpy2.robjects import numpy2ri\nfrom rpy2.robjects import default_converter\n\nrd_m = np.random.random((10, 7))\n\nwith (default_converter + numpy2ri.converter).context():\n mtx2 = robjects.r.matrix(rd_m, nrow = 10)\nimport pandas as pd\n\nfrom rpy2.robjects import pandas2ri\n\npd_df = pd.DataFrame({'int_values': [1,2,3],\n 'str_values': ['abc', 'def', 'ghi']})\n\nwith (default_converter + pandas2ri.converter).context():\n pd_df_r = robjects.DataFrame(pd_df)\nOne big limitation of rpy2 is the inability to convert sparse matrices: there is no built-in conversion module for scipy. The anndata2ri package provides, apart from functionality to convert SingleCellExperiment objects to an anndata objects, functions to convert sparse matrices.\nimport scipy as sp\n\nfrom anndata2ri import scipy2ri\n\nsparse_matrix = sp.sparse.csc_matrix(rd_m)\n\nwith (default_converter + scipy2ri.converter).context():\n sp_r = scipy2ri.py2rpy(sparse_matrix)\nWe will showcase how to use anndata2ri to convert an anndata object to a SingleCellExperiment object and vice versa as well:\nimport anndata as ad\nimport scanpy.datasets as scd\n\nimport anndata2ri\n\nadata_paul = scd.paul15()\n\n\n 0%| | 0.00/9.82M [00:00&lt;?, ?B/s]\n 0%| | 8.00k/9.82M [00:00&lt;02:10, 78.6kB/s]\n 0%| | 32.0k/9.82M [00:00&lt;01:01, 167kB/s] \n 1%| | 96.0k/9.82M [00:00&lt;00:27, 366kB/s]\n 2%|1 | 192k/9.82M [00:00&lt;00:17, 578kB/s] \n 4%|3 | 400k/9.82M [00:00&lt;00:09, 1.08MB/s]\n 8%|8 | 816k/9.82M [00:00&lt;00:04, 2.04MB/s]\n 16%|#6 | 1.62M/9.82M [00:00&lt;00:02, 3.95MB/s]\n 33%|###3 | 3.25M/9.82M [00:00&lt;00:00, 7.69MB/s]\n 63%|######3 | 6.23M/9.82M [00:00&lt;00:00, 14.2MB/s]\n 94%|#########3| 9.21M/9.82M [00:01&lt;00:00, 18.7MB/s]\n100%|##########| 9.82M/9.82M [00:01&lt;00:00, 9.39MB/s]\n\n\nwith anndata2ri.converter.context():\n sce = anndata2ri.py2rpy(adata_paul)\n ad2 = anndata2ri.rpy2py(sce)",
"text": "4.1 Rpy2: basic functionality\nRpy2 is a foreign function interface to R. It can be used in the following way:\nimport rpy2\nimport rpy2.robjects as robjects\n\n/home/runner/work/polygloty/polygloty/renv/python/virtualenvs/renv-python-3.12/lib/python3.12/site-packages/rpy2/rinterface_lib/embedded.py:276: UserWarning: R was initialized outside of rpy2 (R_NilValue != NULL). Trying to use it nevertheless.\n warnings.warn(msg)\nR was initialized outside of rpy2 (R_NilValue != NULL). Trying to use it nevertheless.\n\nvector = robjects.IntVector([1,2,3])\nrsum = robjects.r['sum']\n\nrsum(vector)\n\n\n IntVector with 1 elements.\n \n\n\n\n6\nLuckily, we’re not restricted to just calling R functions and creating R objects. The real power of this in-memory interoperability lies in the conversion of Python objects to R objects to call R functions on, and then to the conversion of the results back to Python objects.\nRpy2 requires specific conversion rules for different Python objects. It is straightforward to create R vectors from corresponding Python lists:\nstr_vector = robjects.StrVector(['abc', 'def', 'ghi'])\nflt_vector = robjects.FloatVector([0.3, 0.8, 0.7])\nint_vector = robjects.IntVector([1, 2, 3])\nmtx = robjects.r.matrix(robjects.IntVector(range(10)), nrow=5)\nHowever, for single cell biology, the objects that are most interesting to convert are (count) matrices, arrays and dataframes. In order to do this, you need to import the corresponding rpy2 modules and specify the conversion context.\nimport numpy as np\n\nfrom rpy2.robjects import numpy2ri\nfrom rpy2.robjects import default_converter\n\nrd_m = np.random.random((10, 7))\n\nwith (default_converter + numpy2ri.converter).context():\n mtx2 = robjects.r.matrix(rd_m, nrow = 10)\nimport pandas as pd\n\nfrom rpy2.robjects import pandas2ri\n\npd_df = pd.DataFrame({'int_values': [1,2,3],\n 'str_values': ['abc', 'def', 'ghi']})\n\nwith (default_converter + pandas2ri.converter).context():\n pd_df_r = robjects.DataFrame(pd_df)\nOne big limitation of rpy2 is the inability to convert sparse matrices: there is no built-in conversion module for scipy. The anndata2ri package provides, apart from functionality to convert SingleCellExperiment objects to an anndata objects, functions to convert sparse matrices.\nimport scipy as sp\n\nfrom anndata2ri import scipy2ri\n\nsparse_matrix = sp.sparse.csc_matrix(rd_m)\n\nwith (default_converter + scipy2ri.converter).context():\n sp_r = scipy2ri.py2rpy(sparse_matrix)\nWe will showcase how to use anndata2ri to convert an anndata object to a SingleCellExperiment object and vice versa as well:\nimport anndata as ad\nimport scanpy.datasets as scd\n\nimport anndata2ri\n\nadata_paul = scd.paul15()\n\n\n 0%| | 0.00/9.82M [00:00&lt;?, ?B/s]\n 0%| | 8.00k/9.82M [00:00&lt;02:25, 70.5kB/s]\n 0%| | 32.0k/9.82M [00:00&lt;01:08, 150kB/s] \n 1%| | 96.0k/9.82M [00:00&lt;00:30, 332kB/s]\n 2%|2 | 208k/9.82M [00:00&lt;00:17, 578kB/s] \n 4%|4 | 424k/9.82M [00:00&lt;00:09, 1.03MB/s]\n 9%|8 | 872k/9.82M [00:00&lt;00:04, 1.98MB/s]\n 14%|#4 | 1.38M/9.82M [00:00&lt;00:03, 2.70MB/s]\n 17%|#6 | 1.62M/9.82M [00:00&lt;00:03, 2.64MB/s]\n 29%|##8 | 2.83M/9.82M [00:01&lt;00:01, 5.11MB/s]\n 30%|### | 2.98M/9.82M [00:01&lt;00:01, 3.90MB/s]\n 45%|####5 | 4.46M/9.82M [00:01&lt;00:00, 6.69MB/s]\n 53%|#####2 | 5.16M/9.82M [00:01&lt;00:00, 6.52MB/s]\n 60%|#####9 | 5.86M/9.82M [00:01&lt;00:00, 6.38MB/s]\n 67%|######6 | 6.58M/9.82M [00:01&lt;00:00, 6.34MB/s]\n 74%|#######4 | 7.30M/9.82M [00:01&lt;00:00, 6.34MB/s]\n 82%|########1 | 8.03M/9.82M [00:01&lt;00:00, 6.33MB/s]\n 89%|########9 | 8.77M/9.82M [00:02&lt;00:00, 6.37MB/s]\n 97%|#########6| 9.51M/9.82M [00:02&lt;00:00, 6.38MB/s]\n100%|##########| 9.82M/9.82M [00:02&lt;00:00, 4.73MB/s]\n\n\nwith anndata2ri.converter.context():\n sce = anndata2ri.py2rpy(adata_paul)\n ad2 = anndata2ri.rpy2py(sce)",
"crumbs": [
"In-memory interoperability",
"<span class='chapter-number'>4</span>  <span class='chapter-title'>Rpy2</span>"
Expand Down Expand Up @@ -192,7 +192,7 @@
"href": "book/in_memory/reticulate.html",
"title": "5  Reticulate",
"section": "",
"text": "Reticulate is a foreign function interface in R to Python.\n\n6 Reticulate: basic functionality\nData types are automatically converted from Python to R and vice versa. A useful table of automatic conversions can be found here.\nYou can easily import python modules, and call the functions in the following way:\n\nlibrary(reticulate)\n\nbi &lt;- reticulate::import_builtins()\nrd &lt;- reticulate::import(\"random\")\n\nexample &lt;- c(1,2,3)\nbi$max(example)\n\n[1] 3\n\nrd$choice(example)\n\n[1] 2\n\nbi$list(bi$reversed(example))\n\n[1] 3 2 1\n\n\nNumpy is also easily used:\n\nnp &lt;- reticulate::import(\"numpy\")\n\na &lt;- np$asarray(tuple(list(1,2), list(3, 4)))\nb &lt;- np$asarray(list(5,6))\nb &lt;- np$reshape(b, newshape = tuple(1L,2L))\n\nnp$concatenate(tuple(a, b), axis=0L)\n\n [,1] [,2]\n[1,] 1 2\n[2,] 3 4\n[3,] 5 6\n\n\nIf you want more finegrained control over conversion, you can specify in the import statement that you do not want results of functions of that package to be converted to R data types.\n\nnp &lt;- reticulate::import(\"numpy\", convert = FALSE)\n\na &lt;- np$asarray(tuple(list(1,2), list(3, 4)))\nb &lt;- np$asarray(list(5,6))\nb &lt;- np$reshape(b, newshape = tuple(1L,2L))\n\nnp$concatenate(tuple(a, b), axis=0L)\n\narray([[1., 2.],\n [3., 4.],\n [5., 6.]])\n\n\nYou can explicitly convert data types:\n\nresult &lt;- np$concatenate(tuple(a, b), axis=0L)\n\npy_to_r(result)\n\n [,1] [,2]\n[1,] 1 2\n[2,] 3 4\n[3,] 5 6\n\nresult_r &lt;- py_to_r(result)\nr_to_py(result_r)\n\narray([[1., 2.],\n [3., 4.],\n [5., 6.]])\n\n\n\n\n7 Interactivity\nYou can easily include Python chunks in Rmarkdown notebooks using the Python engine in knitr.\n\n\n8 Usecase\nWe will not showcase the usefulness of reticulate by using the DE analysis: it would involve loading in pandas to create a Python dataframe, adding rownames and columnnames and then grouping them, but that is easier to do natively in R.\nA more interesting thing you can do using reticulate is interacting with anndata-based Python packages, such as scanpy!\n\nlibrary(anndata)\nlibrary(reticulate)\nsc &lt;- import(\"scanpy\")\n\nadata_path &lt;- \"../usecase/data/sc_counts_subset.h5ad\"\nadata &lt;- anndata::read_h5ad(adata_path)\n\nWe can preprocess the data:\n\nsc$pp$filter_cells(adata, min_genes = 200)\nsc$pp$filter_genes(adata, min_cells = 3)\n\n\nsc$pp$pca(adata)\nsc$pp$neighbors(adata)\nsc$tl$umap(adata)\n\nadata\n\nAnnData object with n_obs × n_vars = 32727 × 20542\n obs: 'dose_uM', 'timepoint_hr', 'well', 'row', 'col', 'plate_name', 'cell_id', 'cell_type', 'split', 'donor_id', 'sm_name', 'control', 'SMILES', 'sm_lincs_id', 'library_id', 'leiden_res1', 'group', 'cell_type_orig', 'plate_well_celltype_reannotated', 'cell_count_by_well_celltype', 'cell_count_by_plate_well', 'n_genes'\n var: 'highly_variable', 'means', 'dispersions', 'dispersions_norm', 'n_cells'\n uns: 'cell_type_colors', 'celltypist_celltype_colors', 'donor_id_colors', 'hvg', 'leiden_res1_colors', 'log1p', 'neighbors', 'over_clustering', 'rank_genes_groups', 'pca', 'umap'\n obsm: 'HTO_clr', 'X_pca', 'X_umap', 'protein_counts'\n varm: 'PCs'\n obsp: 'connectivities', 'distances'\n\n\nWe can’t easily show the result of the plot in this Quarto notebook, but we can save it and show it:\n\npath &lt;- \"umap.png\"\nsc$pl$umap(adata, color=\"leiden_res1\", save=path)\n\n)",
"text": "Reticulate is a foreign function interface in R to Python.\n\n6 Reticulate: basic functionality\nData types are automatically converted from Python to R and vice versa. A useful table of automatic conversions can be found here.\nYou can easily import python modules, and call the functions in the following way:\n\nlibrary(reticulate)\n\nbi &lt;- reticulate::import_builtins()\nrd &lt;- reticulate::import(\"random\")\n\nexample &lt;- c(1,2,3)\nbi$max(example)\n\n[1] 3\n\nrd$choice(example)\n\n[1] 3\n\nbi$list(bi$reversed(example))\n\n[1] 3 2 1\n\n\nNumpy is also easily used:\n\nnp &lt;- reticulate::import(\"numpy\")\n\na &lt;- np$asarray(tuple(list(1,2), list(3, 4)))\nb &lt;- np$asarray(list(5,6))\nb &lt;- np$reshape(b, newshape = tuple(1L,2L))\n\nnp$concatenate(tuple(a, b), axis=0L)\n\n [,1] [,2]\n[1,] 1 2\n[2,] 3 4\n[3,] 5 6\n\n\nIf you want more finegrained control over conversion, you can specify in the import statement that you do not want results of functions of that package to be converted to R data types.\n\nnp &lt;- reticulate::import(\"numpy\", convert = FALSE)\n\na &lt;- np$asarray(tuple(list(1,2), list(3, 4)))\nb &lt;- np$asarray(list(5,6))\nb &lt;- np$reshape(b, newshape = tuple(1L,2L))\n\nnp$concatenate(tuple(a, b), axis=0L)\n\narray([[1., 2.],\n [3., 4.],\n [5., 6.]])\n\n\nYou can explicitly convert data types:\n\nresult &lt;- np$concatenate(tuple(a, b), axis=0L)\n\npy_to_r(result)\n\n [,1] [,2]\n[1,] 1 2\n[2,] 3 4\n[3,] 5 6\n\nresult_r &lt;- py_to_r(result)\nr_to_py(result_r)\n\narray([[1., 2.],\n [3., 4.],\n [5., 6.]])\n\n\n\n\n7 Interactivity\nYou can easily include Python chunks in Rmarkdown notebooks using the Python engine in knitr.\n\n\n8 Usecase\nWe will not showcase the usefulness of reticulate by using the DE analysis: it would involve loading in pandas to create a Python dataframe, adding rownames and columnnames and then grouping them, but that is easier to do natively in R.\nA more interesting thing you can do using reticulate is interacting with anndata-based Python packages, such as scanpy!\n\nlibrary(anndata)\nlibrary(reticulate)\nsc &lt;- import(\"scanpy\")\n\nadata_path &lt;- \"../usecase/data/sc_counts_subset.h5ad\"\nadata &lt;- anndata::read_h5ad(adata_path)\n\nWe can preprocess the data:\n\nsc$pp$filter_cells(adata, min_genes = 200)\nsc$pp$filter_genes(adata, min_cells = 3)\n\n\nsc$pp$pca(adata)\nsc$pp$neighbors(adata)\nsc$tl$umap(adata)\n\nadata\n\nAnnData object with n_obs × n_vars = 32727 × 20542\n obs: 'dose_uM', 'timepoint_hr', 'well', 'row', 'col', 'plate_name', 'cell_id', 'cell_type', 'split', 'donor_id', 'sm_name', 'control', 'SMILES', 'sm_lincs_id', 'library_id', 'leiden_res1', 'group', 'cell_type_orig', 'plate_well_celltype_reannotated', 'cell_count_by_well_celltype', 'cell_count_by_plate_well', 'n_genes'\n var: 'highly_variable', 'means', 'dispersions', 'dispersions_norm', 'n_cells'\n uns: 'cell_type_colors', 'celltypist_celltype_colors', 'donor_id_colors', 'hvg', 'leiden_res1_colors', 'log1p', 'neighbors', 'over_clustering', 'rank_genes_groups', 'pca', 'umap'\n obsm: 'HTO_clr', 'X_pca', 'X_umap', 'protein_counts'\n varm: 'PCs'\n obsp: 'connectivities', 'distances'\n\n\nWe can’t easily show the result of the plot in this Quarto notebook, but we can save it and show it:\n\npath &lt;- \"umap.png\"\nsc$pl$umap(adata, color=\"leiden_res1\", save=path)\n\n\n\n\n\n\n\nFigure 8.1: UMAP plot of the adata object",
"crumbs": [
"In-memory interoperability",
"<span class='chapter-number'>5</span>  <span class='chapter-title'>Reticulate</span>"
Expand Down
Loading

0 comments on commit eb3009f

Please sign in to comment.