Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while running learn_graph(cds, use_partition = FALSE) #704

Open
Fatemeh99m opened this issue Mar 1, 2024 · 0 comments
Open

Error while running learn_graph(cds, use_partition = FALSE) #704

Fatemeh99m opened this issue Mar 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Fatemeh99m
Copy link

I am using version 5 seurat and CCAIntegration as the integration method for my data set. after creating cds, I have problems while running learn graph. I faced this error : Error: names(cds@clusters[[reduction_method]]$partitions) == NULL
I didnt run "cds <- cluster_cells(cds)" cause I wanted to use cca_clusters.
This is my code :
`gene_annotation <- as.data.frame(rownames(obj@reductions[["pca"]]@feature.loadings), row.names = rownames(obj@reductions[["pca"]]@feature.loadings))
colnames(gene_annotation) <- "gene_short_name"
head(gene_annotation)

cell_metadata <- as.data.frame(obj[["RNA"]]$counts@Dimnames[[2]], row.names = obj[["RNA"]]$counts@Dimnames[[2]])
colnames(cell_metadata) <- "barcode"
head(cell_metadata)

New_matrix <- obj[["RNA"]]$data
New_matrix <- New_matrix[rownames(obj@reductions[["pca"]]@feature.loadings), ]
expression_matrix <- New_matrix

cds<- new_cell_data_set(expression_matrix,
cell_metadata = cell_metadata,
gene_metadata = gene_annotation)

list_cluster <-Idents(obj)
names(list_cluster) <- obj[["RNA"]]$data@Dimnames[[2]]
cds@clusters@listData[["UMAP"]][["clusters"]] <- list_cluster

cds@clusters@listData[["UMAP"]][["louvain_res"]] <- "NA"
cds@int_colData@listData$reducedDims$UMAP <-obj@reductions[["umap.cca"]]@cell.embeddings

cds <- preprocess_cds(cds, num_dim = 35)
cds <- align_cds(cds)
cds <- learn_graph(cds, verbose = FALSE, use_partition = FALSE)`

@Fatemeh99m Fatemeh99m added the bug Something isn't working label Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant