Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/saeyslab/polygloty
Browse files Browse the repository at this point in the history
  • Loading branch information
berombau committed Sep 8, 2024
2 parents cd5c78d + 878d275 commit 9f0da52
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 27 deletions.
15 changes: 1 addition & 14 deletions book/in_memory2.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Read in the anndata object
```{r read_in}
library(anndata)
adata_path <- "usecase/data/sc_counts_reannotated_with_counts.h5ad"
adata_path <- "usecase/data/sc_counts_subset.h5ad"
adata <- anndata::read_h5ad(adata_path)
```

Expand All @@ -28,19 +28,6 @@ adata <- anndata::read_h5ad(adata_path)

# Usecase

## 3. Subset data

Subset to a single small molecule and control for computational efficiency:

```{r select_sm_celltype}
library(dplyr)
sm_name2 <- "Belinostat"
control_name <- "Dimethyl Sulfoxide"
# subset obs
adata <- adata[adata$obs$sm_name %in% c(control_name, sm_name), ]
```

## 4. Compute pseudobulk

Expand Down
14 changes: 1 addition & 13 deletions book/in_memory_interoperability.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -203,22 +203,10 @@ with (robjects.default_converter + pandas2ri.converter).context():
```{r read_in}
library(anndata)
adata_path <- "usecase/data/sc_counts_reannotated_with_counts.h5ad"
adata_path <- "usecase/data/sc_counts_subset.h5ad"
adata <- anndata::read_h5ad(adata_path)
```

Subset to a single small molecule and control for computational efficiency:

```{r select_sm_celltype}
library(dplyr)
sm_name <- "Belinostat"
control_name <- "Dimethyl Sulfoxide"
# subset obs
adata <- adata[adata$obs$sm_name %in% c(control_name, sm_name), adata$var$highly_variable]
```

## 4. Compute pseudobulk

```{r import_pandas}
Expand Down
2 changes: 2 additions & 0 deletions book/usecase/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ adata = adata[
adata.obs["sm_name"].isin([sm_name, control_name]) &
adata.obs["cell_type"].isin([cell_type]),
].copy()
adata.write_h5ad("data/sc_counts_subset.h5ad")
```

We will also subset the genes to the top 2000 most variable genes.
Expand Down

0 comments on commit 9f0da52

Please sign in to comment.