-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathRunning in R.Rmd
54 lines (42 loc) · 1.09 KB
/
Running in R.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
title: "UTAG"
output: html_document
date: '2022-05-24'
---
```{r setup, include=FALSE}
#install.packages('reticulate')
library(reticulate)
use_condaenv('utag')
pd = import('pandas', as = 'pd')
#system('pip3 install git+https://github.com/ElementoLab/utag.git@main')
```
```{r}
print('Hello World')
pd = import('pandas', as = 'pd', convert = FALSE)
#import pandas
#import anndata
```
```{python}
from utag import utag
# Use Scanpy to get a h5ad file with provided data
import scanpy as sc
adata = sc.read(
'data/healthy_lung_adata.h5ad',
backup_url='https://zenodo.org/record/6376767/files/healthy_lung_adata.h5ad?download=1')
# Run UTAG on provided data
utag_results = utag(
adata,
slide_key="roi",
max_dist=20,
normalization_mode='l1_norm',
apply_clustering=True,
clustering_method = 'leiden',
resolutions = [0.05, 0.1, 0.3]
)
```
## Including Plots
You can also embed plots, for example:
```{r pressure, echo=FALSE}
plot(pressure)
```
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.