How to introduce normalized and scaled seurat data into monocle 3?
1
0
Entering edit mode
22 months ago
Sun • 0

Hello every,

I am trying to transform a seurat oject to a monocle 3 object. I use the following codes:

seur_obj <- NormalizeData(seur_obj)
seur_obj <- FindVariableFeatures(seur_obj)
seur_obj <- ScaleData(seur_obj)
seur_obj <- RunPCA(seur_obj)
seur_obj <- RunUMAP(seur_obj, dims = 1:20)

data <- GetAssayData(seur_obj, assay = 'RNA', slot = 'counts')
cell_metadata <- seur_obj@meta.data
gene_annotation <- data.frame(gene_short_name = rownames(data))
rownames(gene_annotation) <- rownames(data)
mono_obj <- new_cell_data_set(data, cell_metadata = cell_metadata, 
                        gene_metadata = gene_annotation)

It seems that only the "counts" slot in the seur_obj can be introduced into the monocle object, and is stored in the "@assays@data$counts" slot. If I use "scale.data" in the

"GetAssayData" function like:
data <- GetAssayData(seur_obj, assay = 'RNA', slot = 'scale.data')
cell_metadata <- seur_obj@meta.data
gene_annotation <- data.frame(gene_short_name = rownames(data))
rownames(gene_annotation) <- rownames(data)
mono_obj <- new_cell_data_set(data, cell_metadata = cell_metadata, 
                        gene_metadata = gene_annotation)

I will get error:

Error in log(cell_total) : (converted from warning) NaNs produced

So how to introduce normalized and scaled seurat data into mono_obj? Or is there functions to do normalization and scaling in monocle?

In Monocle 3, the function "preprocess_cds" normalize and scale the data by default, by I don't know where the nornalized and scaled data is stored. I can only find the counts data in mono_obj@assays@data$counts.

Beside, I want to do some analysis on some clusters based on the normalized scaled data in the mono_obj. Because I can only find the count data, I expect to convert the mono_obj to a Seurat object. In monocle 2, the function "exportCDS" can do this, but this function has disappeared. Is there any other function that does this in monocle 3?

Thank you in advance!

Monocle scRNA-seq Seurat • 1.5k views
ADD COMMENT
0
Entering edit mode

Have a look at as.cell_data_set from SeuratWrappers

ADD REPLY
0
Entering edit mode
3 days ago
Reza • 0

I have a same question it seems that when we use the preprocess_cds() function, it does not save the normalized data directly in a separate slot for general use. Instead, normalization is typically applied on-the-fly for dimensionality reduction and trajectory analysis purposes. I want to use graph_test() but not sure if should manually normalize the data first (in Seurat ) before calling the graph_test() function.

ADD COMMENT
0
Entering edit mode

For OP's question, my guess is that they got NA's because ScaleData is only called on the VariableFeatures found the step before.

Try : seur_obj <- ScaleData(seur_obj, features=rownames(seur_obj))

For your question, you should be able to do both, in Monocle you can use normalize_expr_data to normalize your matrix.

Also helpful : https://github.com/cole-trapnell-lab/monocle-release/issues/162

ADD REPLY

Login before adding your answer.

Traffic: 2248 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6