cellrouter icon indicating copy to clipboard operation
cellrouter copied to clipboard

Seurat to cellrouter error

Open ghoshal opened this issue 5 years ago • 3 comments

Hi,

I am trying to use cell router for trajectory analysis with Seurat object. Here are the commands and the errors that I am getting.

intestinal_organoids_corrected_metadata <- [email protected]

intestinal_organoids_corrected_data <- as.data.frame(as.matrix(intestinal_organoids_corrected@data)) intestinal_organoids_corrected_cellrouter <- CellRouter(rawdata=as.data.frame(intestinal_organoids_corrected_data), min.cells=0,min.genes=0) intestinal_organoids_corrected_cellrouter <- addInfo(intestinal_organoids_corrected_cellrouter, metadata = intestinal_organoids_corrected_metadata, colname = 'res.0.9', metadata.column='res.0.9') intestinal_organoids_corrected_cellrouter <- addInfo(intestinal_organoids_corrected_cellrouter, metadata = intestinal_organoids_corrected_metadata, colname = 'class', metadata.column='class')

plotReducedDimension(intestinal_organoids_corrected_cellrouter, reduction.type = 'tsne', dims.use = c(1,2), annotation = "res.0.9", annotation.color ='res.0.9_color', showlabels = TRUE, 4.5, 3.5, filename='intestinal_organoids_corrected_tsne_seurat_clusters_cellrouter.pdf')

Error in names(x) <- value : 'names' attribute [2] must be the same length as the vector [0]

#for trajectory analysis: intestinal_organoids_corrected_cellrouter <- buildKNN(intestinal_organoids_corrected_cellrouter, k = 10, column.ann = 'res.0.9', num.pcs = 20, sim.type = 'jaccard')

Error in dist(matrix) : Can only handle data frames, vectors, matrices, and lists!

plotKNN(cellrouter, reduction.type = 'tsne', column.ann = 'res.0.9', column.color = 'res.0.9_color', width = 5, height = 4, filename='results/knn_tsne_original_clusters.pdf')

Appreciate your help.

Thanks,

Bibaswan

ghoshal avatar Mar 29 '19 18:03 ghoshal

Thanks for using CellRouter!

Can you please show me: intestinal_organoids_corrected_metadata[1:5,] cellrouter@sampTab[1:5,] cellrouter@ndata[1:5,1:5]

I am trying to figure it out how your data look like.

Thanks a lot!

On Fri, Mar 29, 2019 at 2:31 PM ghoshal [email protected] wrote:

Hi,

I am trying to use cell router for trajectory analysis with Seurat object. Here are the commands and the errors that I am getting.

intestinal_organoids_corrected_metadata <- [email protected]

intestinal_organoids_corrected_data <- as.data.frame(as.matrix(intestinal_organoids_corrected@data)) intestinal_organoids_corrected_cellrouter <- CellRouter(rawdata=as.data.frame(intestinal_organoids_corrected_data), min.cells=0,min.genes=0) intestinal_organoids_corrected_cellrouter <- addInfo(intestinal_organoids_corrected_cellrouter, metadata = intestinal_organoids_corrected_metadata, colname = 'res.0.9', metadata.column='res.0.9') intestinal_organoids_corrected_cellrouter <- addInfo(intestinal_organoids_corrected_cellrouter, metadata = intestinal_organoids_corrected_metadata, colname = 'class', metadata.column='class')

plotReducedDimension(intestinal_organoids_corrected_cellrouter, reduction.type = 'tsne', dims.use = c(1,2), annotation = "res.0.9", annotation.color ='res.0.9_color', showlabels = TRUE, 4.5, 3.5,

filename='intestinal_organoids_corrected_tsne_seurat_clusters_cellrouter.pdf')

Error in names(x) <- value : 'names' attribute [2] must be the same length as the vector [0]

#for trajectory analysis: intestinal_organoids_corrected_cellrouter <- buildKNN(intestinal_organoids_corrected_cellrouter, k = 10, column.ann = ' res.0.9', num.pcs = 20, sim.type = 'jaccard')

Error in dist(matrix) : Can only handle data frames, vectors, matrices, and lists!

plotKNN(cellrouter, reduction.type = 'tsne', column.ann = 'res.0.9', column.color = 'res.0.9_color', width = 5, height = 4, filename='results/knn_tsne_original_clusters.pdf')

Appreciate your help.

Thanks,

Bibaswan

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/edroaldo/cellrouter/issues/22, or mute the thread https://github.com/notifications/unsubscribe-auth/AJqUR1h8jwLygxcUbOEp6vyAE8BVQ9z0ks5vblwDgaJpZM4cTAWW .

-- Edroaldo

edroaldo avatar Mar 29 '19 18:03 edroaldo

Sorry for the late response. Here are the outputs you requested. intestinal_organoids_corrected_metadata[1:5,] nGene nUMI orig.ident class treatment res.0.9 C1_Indepth_AAACCTGCACACCGAC 5888 33542 sample_C1_Indepth Day4_LP99 LP99 3 C1_Indepth_AAACCTGGTATTACCG 4065 15866 sample_C1_Indepth Day4_LP99 LP99 12 C1_Indepth_AAACCTGGTCTCTTAT 3541 12334 sample_C1_Indepth Day4_LP99 LP99 5 C1_Indepth_AAACCTGTCAACACCA 3400 11853 sample_C1_Indepth Day4_LP99 LP99 5 C1_Indepth_AAACCTGTCTCGCATC 3934 15885 sample_C1_Indepth Day4_LP99 LP99 4

cellrouter@sampTab[1:5,]

sample_id nGene nUMI conditions C1_Indepth_AAACCTGCACACCGAC C1_Indepth_AAACCTGCACACCGAC 5888 33542 C1_Indepth_AAACCTGCACACCGAC C1_Indepth_AAACCTGGTATTACCG C1_Indepth_AAACCTGGTATTACCG 4065 15866 C1_Indepth_AAACCTGGTATTACCG C1_Indepth_AAACCTGGTCTCTTAT C1_Indepth_AAACCTGGTCTCTTAT 3541 12334 C1_Indepth_AAACCTGGTCTCTTAT C1_Indepth_AAACCTGTCAACACCA C1_Indepth_AAACCTGTCAACACCA 3400 11853 C1_Indepth_AAACCTGTCAACACCA C1_Indepth_AAACCTGTCTCGCATC C1_Indepth_AAACCTGTCTCGCATC 3934 15885 C1_Indepth_AAACCTGTCTCGCATC res.0.9 res.0.9_color class class_color C1_Indepth_AAACCTGCACACCGAC 3 #FF7F00 Day4_LP99 #FF7F00 C1_Indepth_AAACCTGGTATTACCG 12 #FF7F00 Day4_LP99 #FF7F00 C1_Indepth_AAACCTGGTCTCTTAT 5 #FF7F00 Day4_LP99 #FF7F00 C1_Indepth_AAACCTGTCAACACCA 5 #FF7F00 Day4_LP99 #FF7F00 C1_Indepth_AAACCTGTCTCGCATC 4 #FF7F00 Day4_LP99 #FF7F00

cellrouter@ndata[1:5,1:5]

C1_Indepth_AAACCTGCACACCGAC C1_Indepth_AAACCTGGTATTACCG C1_Indepth_AAACCTGGTCTCTTAT RP11-34P13.7 0 0 0 RP11-34P13.8 0 0 0 FO538757.3 0 0 0 FO538757.2 1 0 0 AP006222.2 0 0 0 C1_Indepth_AAACCTGTCAACACCA C1_Indepth_AAACCTGTCTCGCATC RP11-34P13.7 0 0 RP11-34P13.8 0 0 FO538757.3 0 0 FO538757.2 0 1 AP006222.2 1 0

ghoshal avatar Apr 03 '19 15:04 ghoshal

Sorry for the late reply. Things look OK. Not sure what it is happening. In the cellrouter tutorial, there is an example of how to do this. Also, I did that as well for a project I was working on:

data <- as.data.frame(as.matrix([email protected])) data <- data[,rownames([email protected])] cellrouter <- CellRouter(rawdata=as.data.frame(data), min.cells=0, min.genes=0) cellrouter <- addInfo(cellrouter, metadata = [email protected], colname = 'seurat', metadata.column = 'res.0.6')

It should work. You need to make sure you have the rownames of your metadata table matching with the column names of your expression matrix.

Let me know if that works for you!

Thanks!

On Wed, Apr 3, 2019 at 11:38 AM ghoshal [email protected] wrote:

Sorry for the late response. Here are the outputs you requested. intestinal_organoids_corrected_metadata[1:5,] nGene nUMI orig.ident class treatment res.0.9 C1_Indepth_AAACCTGCACACCGAC 5888 33542 sample_C1_Indepth Day4_LP99 LP99 3 C1_Indepth_AAACCTGGTATTACCG 4065 15866 sample_C1_Indepth Day4_LP99 LP99 12 C1_Indepth_AAACCTGGTCTCTTAT 3541 12334 sample_C1_Indepth Day4_LP99 LP99 5 C1_Indepth_AAACCTGTCAACACCA 3400 11853 sample_C1_Indepth Day4_LP99 LP99 5 C1_Indepth_AAACCTGTCTCGCATC 3934 15885 sample_C1_Indepth Day4_LP99 LP99 4

cellrouter@sampTab[1:5,]

sample_id nGene nUMI conditions C1_Indepth_AAACCTGCACACCGAC C1_Indepth_AAACCTGCACACCGAC 5888 33542 C1_Indepth_AAACCTGCACACCGAC C1_Indepth_AAACCTGGTATTACCG C1_Indepth_AAACCTGGTATTACCG 4065 15866 C1_Indepth_AAACCTGGTATTACCG C1_Indepth_AAACCTGGTCTCTTAT C1_Indepth_AAACCTGGTCTCTTAT 3541 12334 C1_Indepth_AAACCTGGTCTCTTAT C1_Indepth_AAACCTGTCAACACCA C1_Indepth_AAACCTGTCAACACCA 3400 11853 C1_Indepth_AAACCTGTCAACACCA C1_Indepth_AAACCTGTCTCGCATC C1_Indepth_AAACCTGTCTCGCATC 3934 15885 C1_Indepth_AAACCTGTCTCGCATC res.0.9 res.0.9_color class class_color C1_Indepth_AAACCTGCACACCGAC 3 #FF7F00 Day4_LP99 #FF7F00 C1_Indepth_AAACCTGGTATTACCG 12 #FF7F00 Day4_LP99 #FF7F00 C1_Indepth_AAACCTGGTCTCTTAT 5 #FF7F00 Day4_LP99 #FF7F00 C1_Indepth_AAACCTGTCAACACCA 5 #FF7F00 Day4_LP99 #FF7F00 C1_Indepth_AAACCTGTCTCGCATC 4 #FF7F00 Day4_LP99 #FF7F00

cellrouter@ndata[1:5,1:5]

C1_Indepth_AAACCTGCACACCGAC C1_Indepth_AAACCTGGTATTACCG C1_Indepth_AAACCTGGTCTCTTAT RP11-34P13.7 0 0 0 RP11-34P13.8 0 0 0 FO538757.3 0 0 0 FO538757.2 1 0 0 AP006222.2 0 0 0 C1_Indepth_AAACCTGTCAACACCA C1_Indepth_AAACCTGTCTCGCATC RP11-34P13.7 0 0 RP11-34P13.8 0 0 FO538757.3 0 0 FO538757.2 0 1 AP006222.2 1 0

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/edroaldo/cellrouter/issues/22#issuecomment-479543361, or mute the thread https://github.com/notifications/unsubscribe-auth/AJqUR_cWDOo326PYa1n12JYnJItQj5Jgks5vdMr7gaJpZM4cTAWW .

-- Edroaldo

edroaldo avatar Apr 15 '19 11:04 edroaldo