cicero batch correct

12 views
Skip to first unread message

Asma Riyaz

unread,
Jan 31, 2025, 9:11:46 PMJan 31
to cicero-users
Hello,

I have scATAC time point data (W15 and W19) and want to use Cicero to build trajectory. Here is the code I use:

```
DefaultAssay(utr_w15) <- "ATAC"
Idents(utr_w15) <- "Cell_type_joint"
utr_w15 <- subset(x = utr_w15, idents = c("Immature_HC", "Mature_HC"))
sce_utr_w15 <- as.SingleCellExperiment(utr_w15, assay ="ATAC")

DefaultAssay(integ) <- "ATAC"
Idents(integ) <- "Cell_type_joint"
integ <- subset(x = integ, idents = c("Immature_HC", "HC-2","Type_I_HC","Type_II_HC"))
sce_utr_w19 <- as.SingleCellExperiment(integ, assay ="ATAC")

gene_meta <- rowData(sce_utr_w15)
#gene_metadata must contain a column verbatim named 'gene_short_name' for certain functions.
gene_meta$gene_short_name  <- rownames(gene_meta)
cds_w15 <- new_cell_data_set(expression_data = counts(sce_utr_w15),
                         cell_metadata = colData(sce_utr_w15),
                         gene_metadata = gene_meta)

gene_meta <- rowData(sce_utr_w19)
#gene_metadata must contain a column verbatim named 'gene_short_name' for certain functions.
gene_meta$gene_short_name  <- rownames(gene_meta)
cds_w19 <- new_cell_data_set(expression_data = counts(sce_utr_w19),
                         cell_metadata = colData(sce_utr_w19),
                         gene_metadata = gene_meta)

cds_atac <- combine_cds(list(cds_w15, cds_w19),sample_col_name="monocle_sample")

cds_atac <- estimate_size_factors(cds_atac)
cds_atac <- preprocess_cds(cds_atac, method = "LSI")
cds_atac <- align_cds(cds_atac, preprocess_method = "LSI")
cds_atac <- reduce_dimension(cds_atac, reduction_method = 'UMAP',
                              preprocess_method = "LSI")
cds_atac <- cluster_cells(cds_atac)

cds_atac <- learn_graph(cds_atac)

plot_cells(cds_atac, color_cells_by = "pseudotime")
```

Could you please help me understand if I am I batch correcting the data correctly for Cicero? The trajectory in the UMAP (images attached) is completely disjoint. 

Thank you,
Asma

Screenshot 2025-01-31 at 2.41.39 PM.png
Screenshot 2025-01-31 at 2.41.52 PM.png
Reply all
Reply to author
Forward
0 new messages