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

Seurat v3 input matrices for monocle #1096

Closed
s849 opened this issue Jan 25, 2019 · 4 comments
Closed

Seurat v3 input matrices for monocle #1096

s849 opened this issue Jan 25, 2019 · 4 comments

Comments

@s849
Copy link

s849 commented Jan 25, 2019

Hi,

I was wondering if anyone has tried to use Monocle2 using input matrices derived from Seurat v3? I was able to do it before (with Seurat v2), but now I am not sure if I am doing it correctly. Using the following input information, I was able to get Monocle2 to work:

expr_matrix <- subset@assays$integrated[,names(subset@active.ident)]
sample_sheet = data.frame(row.names=colnames(expr_matrix),cluster=subset@active.ident, genotype=subset@meta.data$orig.ident)
gene_annotation <- data.frame(row.names=rownames(expr_matrix), gene_short_name=rownames(expr_matrix))

## create a new CellDataSet object
pd <- new("AnnotatedDataFrame", data = sample_sheet) 
fd <- new("AnnotatedDataFrame", data = gene_annotation) 
newData <- newCellDataSet(as(as.matrix(expr_matrix), "sparseMatrix"),phenoData = pd,featureData = fd,lowerDetectionLimit=0.5,expressionFamily=negbinomial.size())

Thanks!

@andrewwbutler
Copy link
Collaborator

Hi,

We don't currently have an conversion function in v3 for Monocle but Monocle2 has a function here to import v2 Seurat objects. You can check your code against that to ensure everything is going to the right place.

@timoast
Copy link
Collaborator

timoast commented May 17, 2019

Hi, we are in the process of adding Seurat -> Monocle conversion and it will be available soon (see #1241)

@timoast timoast closed this as completed May 17, 2019
@HomairaH
Copy link

HomairaH commented Jun 9, 2019

Is the v3 -> Monocole conversion available?

@Sophia409
Copy link

@mojaveazure Same question,Is the v3 -> Monocole conversion available?
Recently monocle 3 has upgraded.And after I modify the code that is used to import seurat object according to new new_cell_data_set function,it gave errors. Can you give me some help?Thank you very much.

#262 how to import seurat object
data <- Merge.integrated@assays$RNA@data
cell_metadata <- new('AnnotatedDataFrame', data = Merge.integrated@meta.data)
fData <- data.frame(gene_short_name = row.names(data), row.names = row.names(data))
gene_metadata <- new('AnnotatedDataFrame', data = fData)
#Construct monocle cds
tdcds <- new_cell_data_set(data,
cell_metadata = cell_metadata,
gene_metadata = gene_metadata
)`

Error in as.data.frame.default(from) : cannot coerce class ‘structure("AnnotatedDataFrame", package = "Biobase")’ to a data.frame

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants