Skip to content
Snippets Groups Projects
Commit e4fdf78c authored by Jeffrey Pullin's avatar Jeffrey Pullin
Browse files

Add rowData to pbmc3k and endothelial datasets

to fix Python indexing problems with Scanpy
parent 45f33749
No related branches found
No related tags found
No related merge requests found
Pipeline #9163 passed
......@@ -20,6 +20,9 @@ endothelial@assays$HTO <- NULL
endothelial@assays$SCT <- NULL
endothelial <- as.SingleCellExperiment(endothelial)
rowData(endothelial) <- DataFrame(gene = rownames(endothelial))
colData(endothelial)$predicted.id <- factor(colData(endothelial)$predicted.id)
colLabels(endothelial) <- colData(endothelial)$predicted.id
......
......@@ -7,6 +7,8 @@ args <- R.utils::commandArgs(
asValues = TRUE
)
.libPaths()
suppressMessages({
library(TENxPBMCData)
library(scater)
......@@ -23,6 +25,8 @@ rownames(pbmc3k) <- uniquifyFeatureNames(
rowData(pbmc3k)$Symbol_TENx
)
old_rowdata <- rowData(pbmc3k)
counts <- as(counts(pbmc3k), "dgCMatrix")
colnames(counts) <- paste0("Cell", 1:ncol(counts))
......@@ -81,6 +85,9 @@ pbmc3k <- RenameIdents(pbmc3k, new_cluster_ids)
pbmc3k <- as.SingleCellExperiment(pbmc3k)
colLabels(pbmc3k) <- colData(pbmc3k)$ident
# Add back some rowData to prevent downstream (Python) errors.
rowData(pbmc3k) <- rownames(pbmc3k)
# Filter to the top 5000 genes.
dec_pbmc3k <- modelGeneVarByPoisson(pbmc3k)
top_pbmc3k <- getTopHVGs(dec_pbmc3k, n = 2000)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment