Skip to content

Commit

Permalink
Fix issue #56 (#60)
Browse files Browse the repository at this point in the history
* convert dataframe to matrix

* Update README.md

Co-authored-by: EC2 Default User <[email protected]>
  • Loading branch information
Lila14 and EC2 Default User authored Sep 1, 2022
1 parent d564af5 commit a25bec1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ anndata2seurat <- function(inFile, outFile = NULL, main_layer = "counts", assay
srt@meta.data <- obs_df
embed_names <- unlist(reticulate::py_to_r(ad$obsm_keys()))
if (length(embed_names) > 0) {
embeddings <- sapply(embed_names, function(x) reticulate::py_to_r(ad$obsm[x]), simplify = FALSE, USE.NAMES = TRUE)
embeddings <- sapply(embed_names, function(x) as.matrix(reticulate::py_to_r(ad$obsm[x])), simplify = FALSE, USE.NAMES = TRUE)
names(embeddings) <- embed_names
for (name in embed_names) {
rownames(embeddings[[name]]) <- colnames(assays[[assay]])
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ BiocManager::install(c("LoomExperiment", "SingleCellExperiment"))

To use sceasy ensure the anndata package (with scipy==1.2.1) is installed:

```conda install anndata==0.6.19 scipy==1.2.1 -c bioconda```
```conda install anndata scipy -c bioconda```

Optionally, if you plan to convert between loom and anndata, please also ensure that the `loompy` package is installed:

Expand Down

0 comments on commit a25bec1

Please sign in to comment.