edroaldo / cellrouter

Reconstruction of complex single-cell trajectories using CellRouter
45 stars 21 forks source link

Using seurat for cellrouter trajectory analysis #13

Open fereshtehizadi opened 6 years ago

fereshtehizadi commented 6 years ago

Hi,

I have already my cell clustered by seurat, now I want to use cell router for trajectory analysis? how that would be please? saying cellrouter@sampTab will help but I don't know how to use that for using my seurat clusters here

Thanks a lot for any help

edroaldo commented 6 years ago

Thanks for using CellRouter! This is very easy with CellRouter. You can use the addInfo function to include n cellrouter@sampTab your seurat clusters and then use the corresponding column for downstream analysis. For example, in the cellrouter tutourial at https://github.com/edroaldo/cellrouter/blob/master/Myeloid_Progenitors/CellRouter_Paul_Tutorial.md :

cellrouter <- addInfo(cellrouter, metadata = samples, colname = 'celltype', metadata.column='cell_type')

You could replace the line above by:

metadata <- seurat@meta.data cellrouter <- addInfo(cellrouter, metadata = metadata, colname = ' seuratClusters', metadata.column='res.0.6') #change res.0.6 for your case

Where res.0.6 is a column in the seurat metadata table with your cluster assignments. This is usually res.0.X depending on how you chose the parameter resolution in the Seurat's function FindClusters.

Then, we can use your Seurat clusters by simplying specyfing the seuratClusters column in your the cellrouter analysis, which will consist to replace "population" by "seuratClusters" in the CellRouter functions. For example (for visualization):

plotReducedDimension(cellrouter, reduction.type = 'tsne', dims.use = c(1,2), annotation = "seuratClusters", annotation.color = 'seuratClusters_color', showlabels = TRUE, 4.5, 3.5, filename='results/tsne_seurat_clusters.pdf')

and for trajectory analysis, you can do: cellrouter <- buildKNN(cellrouter, k = 10, column.ann = 'seuratClusters', num.pcs = 20, sim.type = 'jaccard') plotKNN(cellrouter, reduction.type = 'tsne', column.ann = 'seuratClusters', column.color = 'seuratClusters_color', width = 5, height = 4, filename='results/knn_tsne_original_clusters.pdf') cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths', sep='/'), method="graph")

As a rule of thumb, in the cellrouter tutorial above, simply replace "population" in the relevant functions by "seuratClusters" and the trajectory identification steps will use your seurat clusters for all downstream analysis.

I will be travelling in the next coulple of days so might be a little bit slower to reply but please let me know how it goes!

Thanks a lot!

2018-07-31 7:40 GMT-04:00 fereshtehizadi notifications@github.com:

Hi,

I have already my cell clustered by seurat, now I want to use cell router for trajectory analysis? how that would be please? saying cellrouter@sampTab will help but I don't know how to use that for using my seurat clusters here

Thanks a lot for any help

— 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/13, or mute the thread https://github.com/notifications/unsubscribe-auth/AJqUR1w1qBRjNAZE3AFiNdlgQkLNJ75Qks5uMEIkgaJpZM4VoF6T .

-- Edroaldo

fereshtehizadi commented 6 years ago

Excuse me I tried these

> cellrouter <- addInfo(cellrouter, metadata = metadata, colname = 'res.0.7')
 Show Traceback

 Rerun with Debug
 Error in `*tmp*`[[jj]] : subscript out of bounds In addition: Warning message:
In length(x[[j]]) <- nrows : length of NULL cannot be changed
> cellrouter <- addInfo(cellrouter, metadata = metadata, colname = res.0.7)
 Show Traceback

 Rerun with Debug
 Error in `[<-.data.frame`(`*tmp*`, rownames(metadata), colname, value = NULL) : 
  object 'res.0.7' not found > View(metadata)
> View(metadata)
> View(metadata)
> cellrouter <- addInfo(cellrouter, metadata = metadata, colname = 'res.0.7', metadata.column='res.0.7')
Error in rep(colors, times = replicate_row) : invalid 'times' argument
> cellrouter <- addInfo(cellrouter, metadata = metadata, metadata.column='res.0.7')
 Show Traceback

 Rerun with Debug
 Error in (function(x, i, exact) if (is.matrix(i)) as.matrix(x)[[i]] else .subset2(x,  : 
  argument "colname" is missing, with no default In addition: Warning messages:
1: In `[<-.factor`(`*tmp*`, iseq, value = c("0", "0", "0", "1", "1",  :
  invalid factor level, NA generated
2: In `[<-.factor`(`*tmp*`, iseq, value = c("0", "0", "0", "1", "1",  :
  invalid factor level, NA generated
> 
> cellrouter <- addInfo(cellrouter, colname = res.0.7, metadata.column = res.0.7)
Error in addInfo(cellrouter, colname = res.0.7, metadata.column = res.0.7) : 
  argument "metadata" is missing, with no default
> cellrouter <- addInfo(cellrouter, metadata=metadata, colname = res.0.7, metadata.column = res.0.7)
 Show Traceback

 Rerun with Debug
 Error in (function(x, i, exact) if (is.matrix(i)) as.matrix(x)[[i]] else .subset2(x,  : 
  object 'res.0.7' not found > cellrouter <- addInfo(cellrouter, metadata=metadata, colname = "res.0.7", metadata.column = "res.0.7")
Error in rep(colors, times = replicate_row) : invalid 'times' argument
> cellrouter <- addInfo(cellrouter, metadata=metadata, colname = 'res.0.7', metadata.column = 'res.0.7')
Error in rep(colors, times = replicate_row) : invalid 'times' argument
> View(metadata)
> 

my seurat metadata has 4 columns nGene, nUMI, orig.ident and res.0.7

edroaldo commented 6 years ago

You need to make sure that the dimensions of the raw data after creating the cellrouter object and the dimensions of the metadata table from seurat are the same. Please, try something like:

data <- as.data.frame(as.matrix(seurat@raw.data)) cellrouter <- CellRouter(rawdata=as.data.frame(data), min.cells=0, min.genes=0)

Please follow the steps in the previous email with the addInfo function and let me know how it goes...

Thanks!

2018-07-31 9:38 GMT-04:00 fereshtehizadi notifications@github.com:

Excuse me I tried these

cellrouter <- addInfo(cellrouter, metadata = metadata, colname = 'res.0.7') Show Traceback

Rerun with Debug Error in *tmp*[[jj]] : subscript out of bounds In addition: Warning message: In length(x[[j]]) <- nrows : length of NULL cannot be changed

cellrouter <- addInfo(cellrouter, metadata = metadata, colname = res.0.7) Show Traceback

Rerun with Debug Error in [<-.data.frame(*tmp*, rownames(metadata), colname, value = NULL) : object 'res.0.7' not found > View(metadata)

View(metadata) View(metadata) cellrouter <- addInfo(cellrouter, metadata = metadata, colname = 'res.0.7', metadata.column='res.0.7') Error in rep(colors, times = replicate_row) : invalid 'times' argument cellrouter <- addInfo(cellrouter, metadata = metadata, metadata.column='res.0.7') Show Traceback

Rerun with Debug Error in (function(x, i, exact) if (is.matrix(i)) as.matrix(x)[[i]] else .subset2(x, : argument "colname" is missing, with no default In addition: Warning messages: 1: In [<-.factor(*tmp*, iseq, value = c("0", "0", "0", "1", "1", : invalid factor level, NA generated 2: In [<-.factor(*tmp*, iseq, value = c("0", "0", "0", "1", "1", : invalid factor level, NA generated

my seurat metadata has 4 columns nGene, nUMI, orig.ident and res.0.7

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

-- Edroaldo

fereshtehizadi commented 6 years ago

Excuse me,

> data <- as.data.frame(as.matrix(seurat@raw.data))
> cellrouter <- CellRouter(rawdata=as.data.frame(data), min.cells=0,
+ min.genes=0)
[1] "Initializing CellRouter object"

> metadata <- seurat@meta.data
> cellrouter <- addInfo(cellrouter, metadata=metadata, colname = 'res.0.7', metadata.column = 'res.0.7')

> cellrouter <- buildKNN(cellrouter, k = 10, column.ann = 'seuratClusters', num.pcs = 20, sim.type = 'jaccard')
 Show Traceback

 Rerun with Debug
 Error in order(...) : argument 1 is not a vector > 
> cellrouter <- buildKNN(cellrouter, k = 10, column.ann = 'res.0.7', num.pcs = 20, sim.type = 'jaccard')
[1] "building k-nearest neighbors graph"
 Show Traceback

 Rerun with Debug
 Error in dist(matrix) : 
  Can only handle data frames, vectors, matrices, and lists! > 
edroaldo commented 6 years ago

You have to do either:

cellrouter <- addInfo(cellrouter, metadata=metadata, colname = 'res.0.7', metadata.column = 'res.0.7') or

cellrouter <- addInfo(cellrouter, metadata=metadata, colname = 'seuratClusters', metadata.column = 'res.0.7')

and

cellrouter <- buildKNN(cellrouter, k = 10, column.ann = 'res.0.7', num.pcs = 20, sim.type = 'jaccard')

cellrouter <- buildKNN(cellrouter, k = 10, column.ann = 'seuratClusters', num.pcs = 20, sim.type = 'jaccard')

column.ann need to match!

Let me know if it works!

Thanks!

2018-07-31 9:50 GMT-04:00 fereshtehizadi notifications@github.com:

Excuse me,

data <- as.data.frame(as.matrix(seurat@raw.data)) cellrouter <- CellRouter(rawdata=as.data.frame(data), min.cells=0,

  • min.genes=0) [1] "Initializing CellRouter object"

metadata <- seurat@meta.data cellrouter <- addInfo(cellrouter, metadata=metadata, colname = 'res.0.7', metadata.column = 'res.0.7')

cellrouter <- buildKNN(cellrouter, k = 10, column.ann = 'seuratClusters', num.pcs = 20, sim.type = 'jaccard') Show Traceback

Rerun with Debug Error in order(...) : argument 1 is not a vector >

cellrouter <- buildKNN(cellrouter, k = 10, column.ann = 'res.0.7', num.pcs = 20, sim.type = 'jaccard') [1] "building k-nearest neighbors graph" Show Traceback

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

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

-- Edroaldo

fereshtehizadi commented 6 years ago

Sorry,


> 
> cellrouter <- addInfo(cellrouter, metadata=metadata, colname ='res.0.7', metadata.column = 'res.0.7') 
> cellrouter <- buildKNN(cellrouter, k = 10, column.ann = 'res.0.7',num.pcs = 20, sim.type = 'jaccard')
[1] "building k-nearest neighbors graph"
 Show Traceback

 Rerun with Debug
 Error in dist(matrix) : 
  Can only handle data frames, vectors, matrices, and lists! 
edroaldo commented 6 years ago

Can you please try like this:

cellrouter <- addInfo(cellrouter, metadata=metadata, colname = 'seuratClusters', metadata.column = 'res.0.7')

cellrouter <- buildKNN(cellrouter, k = 10, column.ann = 'seuratClusters', num.pcs = 20, sim.type = 'jaccard')

please, send me:

class(cellrouter@ndata)

cellrouter@sampTab[1:5,]

I need to debug a little bit...

I have not seen this error message in this context before...

Thanks!

2018-07-31 9:57 GMT-04:00 fereshtehizadi notifications@github.com:

Sorry,

cellrouter <- addInfo(cellrouter, metadata=metadata, colname ='res.0.7', metadata.column = 'res.0.7') cellrouter <- buildKNN(cellrouter, k = 10, column.ann = 'res.0.7',num.pcs = 20, sim.type = 'jaccard') [1] "building k-nearest neighbors graph" Show Traceback

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

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

-- Edroaldo

edroaldo commented 6 years ago

Also, were you able to reproduce the tutorial with no errors? I am just checking if that could be some package missing on your side...

thanks!

2018-07-31 10:08 GMT-04:00 Edroaldo Lummertz da Rocha edroaldo@gmail.com:

Can you please try like this:

cellrouter <- addInfo(cellrouter, metadata=metadata, colname = 'seuratClusters', metadata.column = 'res.0.7')

cellrouter <- buildKNN(cellrouter, k = 10, column.ann = 'seuratClusters', num.pcs = 20, sim.type = 'jaccard')

please, send me:

class(cellrouter@ndata)

cellrouter@sampTab[1:5,]

I need to debug a little bit...

I have not seen this error message in this context before...

Thanks!

2018-07-31 9:57 GMT-04:00 fereshtehizadi notifications@github.com:

Sorry,

cellrouter <- addInfo(cellrouter, metadata=metadata, colname ='res.0.7', metadata.column = 'res.0.7') cellrouter <- buildKNN(cellrouter, k = 10, column.ann = 'res.0.7',num.pcs = 20, sim.type = 'jaccard') [1] "building k-nearest neighbors graph" Show Traceback

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

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

-- Edroaldo

-- Edroaldo

fereshtehizadi commented 6 years ago

Sorry , I have never been able to trace the tutorial without stopping by error that is why I am disturbing you


> cellrouter <- addInfo(cellrouter, metadata=metadata, colname ='seuratClusters', metadata.column = 'res.0.7')
> cellrouter <- buildKNN(cellrouter, k = 10, column.ann ='seuratClusters', num.pcs = 20, sim.type = 'jaccard')
[1] "building k-nearest neighbors graph"
 Show Traceback

 Rerun with Debug
 Error in dist(matrix) : 
  Can only handle data frames, vectors, matrices, and lists! 
> class(cellrouter@ndata)
[1] "data.frame"
> cellrouter@sampTab[1:5,]
     sample_id nGene    nUMI conditions res.0.7 res.0.7_color seuratClusters seuratClusters_color
s1.1      s1.1  4324  373695       s1.1       0       #FF7F00              0              #FF7F00
s1.2      s1.2  5595 1074542       s1.2       0       #FF7F00              0              #FF7F00
s1.3      s1.3  2061   49534       s1.3       0       #FF7F00              0              #FF7F00
s1.4      s1.4  4672  772376       s1.4       1       #FF7F00              1              #FF7F00
s1.5      s1.5  3873  272283       s1.5       1       #FF7F00              1              #FF7F00
> 
edroaldo commented 6 years ago

No problem.

Can you please check if you have the following packages: library('cccd') library('proxy')

I think this might be missing in your R installation. You can install this using:

source('https://bioconductor.org/biocLite.R') biocLite('cccd') biocLite('proxy')

I will include a more informative error message in the next release of CellRouter. Thanks for helping with that! Let me know if that works!

2018-07-31 10:12 GMT-04:00 fereshtehizadi notifications@github.com:

Sorry , I have never been able to trace the tutorial without stopping by error that is why I am disturbing you

cellrouter <- buildKNN(cellrouter, k = 10, column.ann ='seuratClusters', num.pcs = 20, sim.type = 'jaccard') [1] "building k-nearest neighbors graph" Show Traceback

Rerun with Debug Error in dist(matrix) : Can only handle data frames, vectors, matrices, and lists! > class(cellrouter@ndata) [1] "data.frame"

cellrouter@sampTab[1:5,] sample_id nGene nUMI conditions res.0.7 res.0.7_color seuratClusters seuratClusters_color s1.1 s1.1 4324 373695 s1.1 0 #FF7F00 0 #FF7F00 s1.2 s1.2 5595 1074542 s1.2 0 #FF7F00 0 #FF7F00 s1.3 s1.3 2061 49534 s1.3 0 #FF7F00 0 #FF7F00 s1.4 s1.4 4672 772376 s1.4 1 #FF7F00 1 #FF7F00 s1.5 s1.5 3873 272283 s1.5 1 #FF7F00 1 #FF7F00

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

-- Edroaldo

fereshtehizadi commented 6 years ago

Thank you,

Likely I have both already installed

> library('cccd')
> 
> library('proxy')
> 
fereshtehizadi commented 6 years ago

Sorry I am starting the tutorial but I am being stopped by this error firstly


> cellrouter <- computePCA(cellrouter, num.pcs = 50, seed=42) #build knn graph on the PCA/DC space

> cellrouter <- computePCA(cellrouter, num.pcs = 50, seed=42)
> plot(cellrouter@pca$sdev, xlab='PC', ylab='Standard d\
+ 

> plot(cellrouter@pca$sdev, xlab='PC', ylab='Standard deviation of PC')
> 
> cellrouter <- computeTSNE(cellrouter, num.pcs = 11, seed=42, max_iter = 1000)
> cellrouter <- customSpace(cellrouter, cellrouter@tsne$cell.embeddings)
> plotReducedDimension(cellrouter, reduction.type = 'tsne', dims.use = c(1,2), annotation = "celltype", annotation.color = 'celltype_color', showlabels = TRUE, 4.5, 3.5, filename='results/tSNE_1.pdf')
 Show Traceback

 Rerun with Debug
 Error in `$<-.data.frame`(`*tmp*`, "group", value = integer(0)) : 
  replacement has 0 rows, data has 209 > 
> getwd()
[1] "/Users/dicty/Downloads/fereshteh"
> plotReducedDimension(cellrouter, reduction.type = 'tsne', dims.use = c(1,2), annotation = "celltype", annotation.color = 'celltype_color', showlabels = TRUE, 4.5, 3.5, filename='/Users/dicty/Downloads/fereshteh/tSNE_1.pdf')
 Show Traceback

 Rerun with Debug
 Error in `$<-.data.frame`(`*tmp*`, "group", value = integer(0)) : 
  replacement has 0 rows, data has 209 > 
> plotReducedDimension(cellrouter, reduction.type = 'tsne', dims.use = c(1,2), annotation = "celltype", annotation.color = 'celltype_color', showlabels = TRUE, 4.5, 3.5, filename='/Users/dicty/Downloads/fereshteh/tSNE_1.pdf')
 Show Traceback

 Rerun with Debug
 Error in `$<-.data.frame`(`*tmp*`, "group", value = integer(0)) : 
  replacement has 0 rows, data has 209 
> 
edroaldo commented 6 years ago

Did you run the entire cellrouter workflow? Did you perform the PCA analysis with:

cellrouter <- computePCA(cellrouter, genes.use=rownames(cellrouter@ndata), num.pcs = 50, seed=42) #build knn graph on the PCA/DC space plot(cellrouter@pca$sdev)

please show me the content of: cellrouter@pca$cell.embeddings[,1:5]

Thanks!

2018-07-31 10:24 GMT-04:00 fereshtehizadi notifications@github.com:

Thank you,

Likely I have both already installed

library('cccd')

library('proxy')

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

-- Edroaldo

fereshtehizadi commented 6 years ago

Yes I think

> cellrouter@pca$cell.embeddings[,1:5]
                PC1          PC2           PC3          PC4          PC5
s1.1     2.84716006   12.0613450   -0.12453762  -5.80070894 -15.24746632
s1.2   -12.52056164    4.1915314    6.21418451 -13.29060438  -4.60329067
s1.3     4.87975344    8.7908584    1.74915206  -7.65141561   0.82223327
s1.4    -3.15807153   -7.9433323   -0.53798009   9.72349588  -5.07761420
s1.5   -10.38741782    3.4123047   -9.88982749   8.82482761  -4.73446601
s1.6     9.35890964   11.3499037   -2.51033278  -2.13914556  -5.82138161
s1.7    -2.95853470    3.7396515    7.88643418  -8.45253951   8.12064397
s1.8   -13.96040877    3.2134105   12.90013280 -18.47916977  -3.86694366
s1.9    12.62269026   14.2813837   -4.36467202  -3.14582589  -3.94570091
s1.10  -13.51189864   -8.4823601    4.70365933  -1.92896893  18.06708975
s1.11   10.77702898   16.6197034   -3.05938882  -8.92536947  -5.26345901
s1.12  -21.17873194  -10.3911632   -0.26966978  14.98706485  -6.79937542
s1.13  -20.15980988   -5.0841986   -0.85543028   4.89360734   0.94193886
s1.14    3.47725633   -6.7382506   19.63515527  -3.83208893 -14.66782094
s1.15   20.52214096  -31.5084043   31.97424872  15.95214823 -22.26402090
s1.16   -8.02909521   14.9779922   -8.11263284  -1.70123795 -30.78429250
s1.17  -18.70372356   -2.5036589    2.96402897  -2.89690107   3.64035918
s1.18   -4.77811741    1.8839173   10.76723951 -17.97996310  13.11135809
s1.19    1.60192010    1.0213783   -6.98422006  -4.27114213  23.35500280
s1.20  -25.55593195   -8.5166168    7.64440691  -5.55449656   4.49901862
s1.21   -1.09732097    4.4558594    5.74601070 -14.51698359   3.35351300
s1.22   -5.66364314   -9.8506360    5.23218102   2.00162861 -12.91758728
s1.23   33.66867866   10.2404249  -12.32877628  -3.30710044   8.88420970
s1.24   -5.75852681    1.1992403    3.02097505  -4.68470076   9.69171920
s1.25    7.85668122   10.7592090    0.62140464  -8.44352977  -2.18456986
s1.26  -22.53082458  -10.7173403    0.69519824  -0.81733015   4.37553340
s1.27   20.31880324  -12.8910271   10.97330766  12.86705283  -8.33655178
s1.28    3.91973882   15.2084319   -0.46358614  -8.08672594 -11.42885804
s1.29   -5.49483281    2.6777183    1.69576581  -2.66456990  -1.76273276
edroaldo commented 6 years ago

You need to run the entire workflow. Are you running the tutorial line by line? It is very weird to have an error in as.dist(matrix) unless "matrix" is empty. Also, getting erros at the very first beginning is not very usual...

Can you please send me: dim(cellrouter@rawdata) dim(cellrouter@ndata) dim(cellrouter@sampTab)

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

Something might look different with your input files... not sure what.... so I need more info...

2018-07-31 10:36 GMT-04:00 fereshtehizadi notifications@github.com:

Sorry I am starting the tutorial but I am being stopped by this error firstly

cellrouter <- computePCA(cellrouter, num.pcs = 50, seed=42) #build knn graph on the PCA/DC space

cellrouter <- computePCA(cellrouter, num.pcs = 50, seed=42) plot(cellrouter@pca$sdev, xlab='PC', ylab='Standard d\ +

plot(cellrouter@pca$sdev, xlab='PC', ylab='Standard deviation of PC')

cellrouter <- computeTSNE(cellrouter, num.pcs = 11, seed=42, max_iter = 1000) cellrouter <- customSpace(cellrouter, cellrouter@tsne$cell.embeddings) plotReducedDimension(cellrouter, reduction.type = 'tsne', dims.use = c(1,2), annotation = "celltype", annotation.color = 'celltype_color', showlabels = TRUE, 4.5, 3.5, filename='results/tSNE_1.pdf') Show Traceback

Rerun with Debug Error in $<-.data.frame(*tmp*, "group", value = integer(0)) : replacement has 0 rows, data has 209 >

getwd() [1] "/Users/dicty/Downloads/fereshteh" plotReducedDimension(cellrouter, reduction.type = 'tsne', dims.use = c(1,2), annotation = "celltype", annotation.color = 'celltype_color', showlabels = TRUE, 4.5, 3.5, filename='/Users/dicty/Downloads/fereshteh/tSNE_1.pdf') Show Traceback

Rerun with Debug Error in $<-.data.frame(*tmp*, "group", value = integer(0)) : replacement has 0 rows, data has 209 >

plotReducedDimension(cellrouter, reduction.type = 'tsne', dims.use = c(1,2), annotation = "celltype", annotation.color = 'celltype_color', showlabels = TRUE, 4.5, 3.5, filename='/Users/dicty/Downloads/fereshteh/tSNE_1.pdf') Show Traceback

Rerun with Debug Error in $<-.data.frame(*tmp*, "group", value = integer(0)) : replacement has 0 rows, data has 209

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

-- Edroaldo

fereshtehizadi commented 6 years ago

Thank you


> dim(cellrouter@rawdata)
[1] 12293   209
> dim(cellrouter@ndata)
[1] 12293   209
> dim(cellrouter@sampTab)
[1] 209   8
> cellrouter@ndata[1:5,1:5]
                   s1.1        s1.2 s1.3       s1.4 s1.5
DDB_G0267178 0.00000000 0.009263254    0 0.01286397    0
DDB_G0267180 0.00000000 0.000000000    0 0.00000000    0
DDB_G0267182 0.00000000 0.000000000    0 0.03810585    0
DDB_G0267184 0.00000000 0.000000000    0 0.00000000    0
DDB_G0267188 0.02640801 0.000000000    0 0.01286397    0
> 

Sorry I think I can not figure out how to come up with filename like filename='/Users/dicty/Downloads/fereshteh/tSNE_1.pdf' as I am placing my working directory

I run these steps successfully but I stopped when I have filename that is why I think perhaps errors come from there

> plot(cellrouter@pca$sdev)
> plot(cellrouter@pca$sdev, xlab='PC', ylab='Standard deviation of PC')
> cellrouter <- computeTSNE(cellrouter, num.pcs = 11, seed=42, max_iter = 1000)
> cellrouter <- customSpace(cellrouter, cellrouter@tsne$cell.embeddings)
> plotReducedDimension(cellrouter, reduction.type = 'tsne', dims.use = c(1,2), annotation = "celltype", annotation.color = 'celltype_color', showlabels = TRUE, 4.5, 3.5, filename='results/tSNE_1.pdf')
 Show Traceback

 Rerun with Debug
 Error in `$<-.data.frame`(`*tmp*`, "group", value = integer(0)) : 
  replacement has 0 rows, data has 209 
edroaldo commented 6 years ago

This looks fine... but an error in plotReducedDimension is very strange... it basically plots the output of computeTSNE...

Can you send me the info I asked for in the previous email as well? and also: cellrouter@tsne$cell.embeddings[1:5,]

Thanks!

2018-07-31 10:43 GMT-04:00 fereshtehizadi notifications@github.com:

Yes I think

cellrouter@pca$cell.embeddings[,1:5] PC1 PC2 PC3 PC4 PC5 s1.1 2.84716006 12.0613450 -0.12453762 -5.80070894 -15.24746632 s1.2 -12.52056164 4.1915314 6.21418451 -13.29060438 -4.60329067 s1.3 4.87975344 8.7908584 1.74915206 -7.65141561 0.82223327 s1.4 -3.15807153 -7.9433323 -0.53798009 9.72349588 -5.07761420 s1.5 -10.38741782 3.4123047 -9.88982749 8.82482761 -4.73446601 s1.6 9.35890964 11.3499037 -2.51033278 -2.13914556 -5.82138161 s1.7 -2.95853470 3.7396515 7.88643418 -8.45253951 8.12064397 s1.8 -13.96040877 3.2134105 12.90013280 -18.47916977 -3.86694366 s1.9 12.62269026 14.2813837 -4.36467202 -3.14582589 -3.94570091 s1.10 -13.51189864 -8.4823601 4.70365933 -1.92896893 18.06708975 s1.11 10.77702898 16.6197034 -3.05938882 -8.92536947 -5.26345901 s1.12 -21.17873194 -10.3911632 -0.26966978 14.98706485 -6.79937542 s1.13 -20.15980988 -5.0841986 -0.85543028 4.89360734 0.94193886 s1.14 3.47725633 -6.7382506 19.63515527 -3.83208893 -14.66782094 s1.15 20.52214096 -31.5084043 31.97424872 15.95214823 -22.26402090 s1.16 -8.02909521 14.9779922 -8.11263284 -1.70123795 -30.78429250 s1.17 -18.70372356 -2.5036589 2.96402897 -2.89690107 3.64035918 s1.18 -4.77811741 1.8839173 10.76723951 -17.97996310 13.11135809 s1.19 1.60192010 1.0213783 -6.98422006 -4.27114213 23.35500280 s1.20 -25.55593195 -8.5166168 7.64440691 -5.55449656 4.49901862 s1.21 -1.09732097 4.4558594 5.74601070 -14.51698359 3.35351300 s1.22 -5.66364314 -9.8506360 5.23218102 2.00162861 -12.91758728 s1.23 33.66867866 10.2404249 -12.32877628 -3.30710044 8.88420970 s1.24 -5.75852681 1.1992403 3.02097505 -4.68470076 9.69171920 s1.25 7.85668122 10.7592090 0.62140464 -8.44352977 -2.18456986 s1.26 -22.53082458 -10.7173403 0.69519824 -0.81733015 4.37553340 s1.27 20.31880324 -12.8910271 10.97330766 12.86705283 -8.33655178 s1.28 3.91973882 15.2084319 -0.46358614 -8.08672594 -11.42885804 s1.29 -5.49483281 2.6777183 1.69576581 -2.66456990 -1.76273276

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

-- Edroaldo

fereshtehizadi commented 6 years ago

Thanks


> dim(cellrouter@rawdata)
[1] 12293   209
> dim(cellrouter@ndata)
[1] 12293   209
> dim(cellrouter@sampTab)
[1] 209   8
> cellrouter@ndata[1:5,1:5]
                   s1.1        s1.2 s1.3       s1.4 s1.5
DDB_G0267178 0.00000000 0.009263254    0 0.01286397    0
DDB_G0267180 0.00000000 0.000000000    0 0.00000000    0
DDB_G0267182 0.00000000 0.000000000    0 0.03810585    0
DDB_G0267184 0.00000000 0.000000000    0 0.00000000    0
DDB_G0267188 0.02640801 0.000000000    0 0.01286397    0
> 

> cellrouter@tsne$cell.embeddings[1:5,]
         tSNE 1     tSNE 2
s1.1 -3.9703770  3.0987432
s1.2  1.1808994  4.4540186
s1.3 -1.9516066  1.3899315
s1.4  0.1912229  0.1931082
s1.5  1.7542882 -5.6374750
>
edroaldo commented 6 years ago

Everything look just fine... very strange...

You can try this to save in your local folder:

plotReducedDimension(cellrouter, reduction.type = 'tsne', dims.use = c(1,2), annotation = "celltype", annotation.color = 'celltype_color', showlabels = TRUE, 4.5, 3.5, filename='tSNE_1.pdf')

does it work?

2018-07-31 10:55 GMT-04:00 fereshtehizadi notifications@github.com:

Thanks

dim(cellrouter@rawdata) [1] 12293 209 dim(cellrouter@ndata) [1] 12293 209 dim(cellrouter@sampTab) [1] 209 8 cellrouter@ndata[1:5,1:5] s1.1 s1.2 s1.3 s1.4 s1.5 DDB_G0267178 0.00000000 0.009263254 0 0.01286397 0 DDB_G0267180 0.00000000 0.000000000 0 0.00000000 0 DDB_G0267182 0.00000000 0.000000000 0 0.03810585 0 DDB_G0267184 0.00000000 0.000000000 0 0.00000000 0 DDB_G0267188 0.02640801 0.000000000 0 0.01286397 0

cellrouter@tsne$cell.embeddings[1:5,] tSNE 1 tSNE 2 s1.1 -3.9703770 3.0987432 s1.2 1.1808994 4.4540186 s1.3 -1.9516066 1.3899315 s1.4 0.1912229 0.1931082 s1.5 1.7542882 -5.6374750

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

-- Edroaldo

fereshtehizadi commented 6 years ago

It worked thanks a lot for your time

I am eagerly going through the rest of tutorial

edroaldo commented 6 years ago

You seem to be mixing the tutorial with outr data without update information. If you are using your data, you should do:

plotReducedDimension(cellrouter, reduction.type = 'tsne', dims.use = c(1,2), annotation = "seuratClusters", annotation.color = 'seuratClusters_color', showlabels = TRUE, 4.5, 3.5, filename='tSNE_1.pdf')

You need to change the code to reflect your annotations. Please, try this and let me know...

2018-07-31 10:57 GMT-04:00 Edroaldo Lummertz da Rocha edroaldo@gmail.com:

Everything look just fine... very strange...

You can try this to save in your local folder:

plotReducedDimension(cellrouter, reduction.type = 'tsne', dims.use = c(1,2), annotation = "celltype", annotation.color = 'celltype_color', showlabels = TRUE, 4.5, 3.5, filename='tSNE_1.pdf')

does it work?

2018-07-31 10:55 GMT-04:00 fereshtehizadi notifications@github.com:

Thanks

dim(cellrouter@rawdata) [1] 12293 209 dim(cellrouter@ndata) [1] 12293 209 dim(cellrouter@sampTab) [1] 209 8 cellrouter@ndata[1:5,1:5] s1.1 s1.2 s1.3 s1.4 s1.5 DDB_G0267178 0.00000000 0.009263254 0 0.01286397 0 DDB_G0267180 0.00000000 0.000000000 0 0.00000000 0 DDB_G0267182 0.00000000 0.000000000 0 0.03810585 0 DDB_G0267184 0.00000000 0.000000000 0 0.00000000 0 DDB_G0267188 0.02640801 0.000000000 0 0.01286397 0

cellrouter@tsne$cell.embeddings[1:5,] tSNE 1 tSNE 2 s1.1 -3.9703770 3.0987432 s1.2 1.1808994 4.4540186 s1.3 -1.9516066 1.3899315 s1.4 0.1912229 0.1931082 s1.5 1.7542882 -5.6374750

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

-- Edroaldo

-- Edroaldo

edroaldo commented 6 years ago

You do not have " annotation = "celltype" " in your analysis, this is specific to the tutorial, where "celltype" was previously defined at the beginning of the analysis.

2018-07-31 10:59 GMT-04:00 Edroaldo Lummertz da Rocha edroaldo@gmail.com:

You seem to be mixing the tutorial with outr data without update information. If you are using your data, you should do:

plotReducedDimension(cellrouter, reduction.type = 'tsne', dims.use = c(1,2), annotation = "seuratClusters", annotation.color = 'seuratClusters_color', showlabels = TRUE, 4.5, 3.5, filename='tSNE_1.pdf')

You need to change the code to reflect your annotations. Please, try this and let me know...

2018-07-31 10:57 GMT-04:00 Edroaldo Lummertz da Rocha edroaldo@gmail.com :

Everything look just fine... very strange...

You can try this to save in your local folder:

plotReducedDimension(cellrouter, reduction.type = 'tsne', dims.use = c(1,2), annotation = "celltype", annotation.color = 'celltype_color', showlabels = TRUE, 4.5, 3.5, filename='tSNE_1.pdf')

does it work?

2018-07-31 10:55 GMT-04:00 fereshtehizadi notifications@github.com:

Thanks

dim(cellrouter@rawdata) [1] 12293 209 dim(cellrouter@ndata) [1] 12293 209 dim(cellrouter@sampTab) [1] 209 8 cellrouter@ndata[1:5,1:5] s1.1 s1.2 s1.3 s1.4 s1.5 DDB_G0267178 0.00000000 0.009263254 0 0.01286397 0 DDB_G0267180 0.00000000 0.000000000 0 0.00000000 0 DDB_G0267182 0.00000000 0.000000000 0 0.03810585 0 DDB_G0267184 0.00000000 0.000000000 0 0.00000000 0 DDB_G0267188 0.02640801 0.000000000 0 0.01286397 0

cellrouter@tsne$cell.embeddings[1:5,] tSNE 1 tSNE 2 s1.1 -3.9703770 3.0987432 s1.2 1.1808994 4.4540186 s1.3 -1.9516066 1.3899315 s1.4 0.1912229 0.1931082 s1.5 1.7542882 -5.6374750

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

-- Edroaldo

-- Edroaldo

-- Edroaldo

fereshtehizadi commented 6 years ago

Exactly the problem as you mentioned was annotation = "seuratClusters", annotation.color = 'seuratClusters_color',

edroaldo commented 6 years ago

Awesome! That's great! Just need to be careful changing which metadata column if you want to use (seuratClusters, potentially "celltype" if you further annotate your clusters, things like that). This was designed to be very flexible but it requires chaning some parameters to select the relevant metadata.

Thanks!

2018-07-31 11:02 GMT-04:00 fereshtehizadi notifications@github.com:

It worked thanks a lot for your time

I am eagerly going through the rest of tutorial

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

-- Edroaldo

edroaldo commented 6 years ago

Fantastic! Glad it is working! Let me know if you have other issues or suggestions to further improve CellRouter!

Thanks!

2018-07-31 11:04 GMT-04:00 fereshtehizadi notifications@github.com:

Exactly the problem as you mentioned was annotation = "seuratClusters", annotation.color = 'seuratClusters_color',

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

-- Edroaldo

fereshtehizadi commented 6 years ago

Thanks a lot for your time

edroaldo commented 6 years ago

You are most welcome!

2018-07-31 11:10 GMT-04:00 fereshtehizadi notifications@github.com:

Thanks a lot for your time

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

-- Edroaldo

fereshtehizadi commented 6 years ago

I am really sorry, but I am most interested in trajectory analysis, I have done the tutorial until this step that I stopped by an error

> cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'Users/dicty/Downloads/fereshteh', sep='/'), method="graph")
 Show Traceback

 Rerun with Debug
 Error in base::order(..., na.last = na.last, decreasing = decreasing) : 
  argument 1 is not a vector > 
> cellrouter <- findPaths(cellrouter, column='seuratClusters',paste(getwd(), 'Users/dicty/Downloads/fereshteh', sep='/'), method="graph")
 Show Traceback

 Rerun with Debug
 Error in base::order(..., na.last = na.last, decreasing = decreasing) : 
  argument 1 is not a vector > 
> ranks <- c('path_cost', 'path_flow', 'rank', 'length')
> 
> cellrouter <- processTrajectories(cellrouter, rownames(cellrouter@ndata), path.rank=ranks[3], num.cells = 3, neighs = 3,column.ann = 'seuratClusters', column.color = 'seuratClusters_color')
[1] "parsing trajectory information"
 Show Traceback

 Rerun with Debug
 Error in complete.cases(paths) : 
  no input has determined the number of cases 
edroaldo commented 6 years ago

I strongly recommend you to create a folder "results" in your working directory and then a folder "paths" inside your folder results, to make the working directory as "clean" as possible. In the lines bellow:

filename <- "results/paths/cell_edge_weighted_network.txt" write.table(cellrouter@graph$edges, file=filename, sep='\t', row.names=FALSE, col.names = FALSE, quote=FALSE) #input network

Where are you saving cell_edge_weighted_network.txt. I need to know the code you are running otherwise I cannot debug it. Please, provide me all your commands before the error message, starting at, for example, cellrouter <- buildKNN(cellrouter, k = 10, column.ann = 'seuratClusters', num.pcs = 20, sim.type = 'jaccard')

Thanks!

2018-07-31 11:32 GMT-04:00 fereshtehizadi notifications@github.com:

I am really sorry, but I am most interested in trajectory analysis, I have done the tutorial until this step that I stopped by an error

cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'Users/dicty/Downloads/fereshteh', sep='/'), method="graph") Show Traceback

Rerun with Debug Error in base::order(..., na.last = na.last, decreasing = decreasing) : argument 1 is not a vector >

cellrouter <- findPaths(cellrouter, column='seuratClusters',paste(getwd(), 'Users/dicty/Downloads/fereshteh', sep='/'), method="graph") Show Traceback

Rerun with Debug Error in base::order(..., na.last = na.last, decreasing = decreasing) : argument 1 is not a vector >

ranks <- c('path_cost', 'path_flow', 'rank', 'length')

cellrouter <- processTrajectories(cellrouter, rownames(cellrouter@ndata), path.rank=ranks[3], num.cells = 3, neighs = 3,column.ann = 'seuratClusters', column.color = 'seuratClusters_color') [1] "parsing trajectory information" Show Traceback

Rerun with Debug Error in complete.cases(paths) : no input has determined the number of cases

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

-- Edroaldo

fereshtehizadi commented 6 years ago

I started from trajectory analysis between clusters identified by CellRouter not Paul study

> cellrouter <- buildKNN(cellrouter, k = 10, column.ann = 'seuratClusters',num.pcs = 20, sim.type = 'jaccard')
[1] "building k-nearest neighbors graph"
[1] "updating CellRouter object"
Warning message:
In write.graph.gml(graph, file, ...) :
  At foreign.c:2616 :A boolean graph attribute was converted to numeric
> plotKNN(cellrouter, reduction.type = 'tsne', column.ann = 'seuratClusters', column.color = 'seuratClusters_color', width = 5, height = 4, filename='results/knn_tsne_CellRouter_clusters.pdf') #increase legend size
> 
> plotReducedDimension(cellrouter, reduction.type = 'tsne', annotation="seuratClusters", annotation.color = 'seuratClusters_color',showlabels = TRUE, width = 4.5, height = 3.5, filename='results/tSNE_graphClustering_clusters.pdf')
> 
> filename <- "results/paths/cell_edge_weighted_network.txt"
> 
> write.table(cellrouter@graph$edges, file=filename, sep='\t', row.names=FALSE, col.names = FALSE, quote=FALSE) #input network
> 
> sources <- c('0')
> targets <- setdiff(as.vector(cellrouter@sampTab$population), sources)
> 
> methods <- c("euclidean", "maximum", "manhattan","canberra","binary", 'graph') #graph for distances in KNN
> 
> cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths', sep='/'), method="graph")
 Show Traceback

 Rerun with Debug
 Error in base::order(..., na.last = na.last, decreasing = decreasing) : 
  argument 1 is not a vector > 
> 

I guess maybe problem comes from libdir that I did not figure out how to define

libdir <- '~/path/to/library/folder/CellRouter/'

libdir <- '~/Documents/Projects/cellrouter-master/CellRouter/'

However I have already downloaded six .jar files from lib file and put them in my working directory

edroaldo commented 6 years ago

You need to change this line in your code:

targets <- setdiff(as.vector(cellrouter@sampTab$population), sources)

to:

targets <- setdiff(as.vector(cellrouter@sampTab$seuratClusters), sources)

Please, remember to change the commands to your case/annotations. I will need to be offline soon and I will no longer be able to reply emails until next weekend. Let me know if it works.

Thanks!

2018-07-31 11:48 GMT-04:00 fereshtehizadi notifications@github.com:

I started from trajectory analysis between clusters identified by CellRouter not Paul study

cellrouter <- buildKNN(cellrouter, k = 10, column.ann = 'seuratClusters',num.pcs = 20, sim.type = 'jaccard') [1] "building k-nearest neighbors graph" [1] "updating CellRouter object" Warning message: In write.graph.gml(graph, file, ...) : At foreign.c:2616 :A boolean graph attribute was converted to numeric plotKNN(cellrouter, reduction.type = 'tsne', column.ann = 'seuratClusters', column.color = 'seuratClusters_color', width = 5, height = 4, filename='results/knn_tsne_CellRouter_clusters.pdf') #increase legend size

plotReducedDimension(cellrouter, reduction.type = 'tsne', annotation="seuratClusters", annotation.color = 'seuratClusters_color',showlabels = TRUE, width = 4.5, height = 3.5, filename='results/tSNE_graphClustering_clusters.pdf')

filename <- "results/paths/cell_edge_weighted_network.txt"

write.table(cellrouter@graph$edges, file=filename, sep='\t', row.names=FALSE, col.names = FALSE, quote=FALSE) #input network

sources <- c('0') targets <- setdiff(as.vector(cellrouter@sampTab$population), sources)

methods <- c("euclidean", "maximum", "manhattan","canberra","binary", 'graph') #graph for distances in KNN

cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths', sep='/'), method="graph") Show Traceback

Rerun with Debug Error in base::order(..., na.last = na.last, decreasing = decreasing) : argument 1 is not a vector >

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

-- Edroaldo

fereshtehizadi commented 6 years ago

Thank you

> targets <- setdiff(as.vector(cellrouter@sampTab$seuratClusters), sources)
> 
> methods <- c("euclidean", "maximum", "manhattan","canberra","binary", 'graph') #graph for distances in KNN
> cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths', sep='/'), method="graph")
-------------------Transition: 0.1  -----------------------
 Show Traceback

 Rerun with Debug
 Error in eval(quote(list(...)), env) : object 'libdir' not found > cellrouter <- findPaths(cellrouter, column='seuratClusters', paste(getwd(), 'results/paths', sep='/'), method="graph")
 Show Traceback

 Rerun with Debug
 Error in file.path(maindir, dir) : 
  argument "maindir" is missing, with no default 
edroaldo commented 6 years ago

Please, follow the tutorial. Instructions to set libdir are provided just above the buildKNN function in the tutorial webpage

libdir <- '~/path/to/library/folder/CellRouter/'

Thanks

On Tue, Jul 31, 2018, 12:11 PM fereshtehizadi notifications@github.com wrote:

Thank you

targets <- setdiff(as.vector(cellrouter@sampTab$seuratClusters), sources)

methods <- c("euclidean", "maximum", "manhattan","canberra","binary", 'graph') #graph for distances in KNN cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths', sep='/'), method="graph") -------------------Transition: 0.1 ----------------------- Show Traceback

Rerun with Debug Error in eval(quote(list(...)), env) : object 'libdir' not found > cellrouter <- findPaths(cellrouter, column='seuratClusters', paste(getwd(), 'results/paths', sep='/'), method="graph") Show Traceback

Rerun with Debug Error in file.path(maindir, dir) : argument "maindir" is missing, with no default

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

fereshtehizadi commented 6 years ago

Sorry where is the path in libdir <- '~/path/to/library/folder/CellRouter/' ??

I set that to my working directory but not working

> libdir="/Users/dicty/Downloads/fereshteh"
> cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths', sep='/'), method="graph")
 Show Traceback

 Rerun with Debug
 Error in setwd(file.path(maindir, dir)) : cannot change working directory chmod: /Users/dicty/Downloads/fereshteh/results/paths/0.1/results/paths/0.1: No such file or directory
> 
edroaldo commented 6 years ago

Did you clone the CellRouter repository right? In the github webpage there is a folder named CellRouter and in this folder you have some jar libraries that are required. Libdir should point to this folder not to your working directory... Let me know if you can find the folder...

Thanks!

On Tue, Jul 31, 2018, 12:19 PM fereshtehizadi notifications@github.com wrote:

Sorry where is the path in libdir <- '~/path/to/library/folder/CellRouter/' ??

I set that to my working directory but not working

libdir="/Users/dicty/Downloads/fereshteh" cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths', sep='/'), method="graph") Show Traceback

Rerun with Debug Error in setwd(file.path(maindir, dir)) : cannot change working directory chmod: /Users/dicty/Downloads/fereshteh/results/paths/0.1/results/paths/0.1: No such file or directory

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

edroaldo commented 6 years ago

From the github webpage:

Then, source the CellRouter class and make sure you provide the correct directory for the Java libraries inside the folder "CellRouter", as specified by the variable 'libdir'.

source('path/to/CellRouter_Class.R') libdir <- 'path/to/CellRouter/'

On Tue, Jul 31, 2018, 12:23 PM Edroaldo Lummertz da Rocha < edroaldo@gmail.com> wrote:

Did you clone the CellRouter repository right? In the github webpage there is a folder named CellRouter and in this folder you have some jar libraries that are required. Libdir should point to this folder not to your working directory... Let me know if you can find the folder...

Thanks!

On Tue, Jul 31, 2018, 12:19 PM fereshtehizadi notifications@github.com wrote:

Sorry where is the path in libdir <- '~/path/to/library/folder/CellRouter/' ??

I set that to my working directory but not working

libdir="/Users/dicty/Downloads/fereshteh" cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths', sep='/'), method="graph") Show Traceback

Rerun with Debug Error in setwd(file.path(maindir, dir)) : cannot change working directory chmod: /Users/dicty/Downloads/fereshteh/results/paths/0.1/results/paths/0.1: No such file or directory

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

edroaldo commented 6 years ago

I also would recommend to restart your R session at this point as it has generated too many errors...

On Tue, Jul 31, 2018, 12:24 PM Edroaldo Lummertz da Rocha < edroaldo@gmail.com> wrote:

From the github webpage:

Then, source the CellRouter class and make sure you provide the correct directory for the Java libraries inside the folder "CellRouter", as specified by the variable 'libdir'.

source('path/to/CellRouter_Class.R') libdir <- 'path/to/CellRouter/'

On Tue, Jul 31, 2018, 12:23 PM Edroaldo Lummertz da Rocha < edroaldo@gmail.com> wrote:

Did you clone the CellRouter repository right? In the github webpage there is a folder named CellRouter and in this folder you have some jar libraries that are required. Libdir should point to this folder not to your working directory... Let me know if you can find the folder...

Thanks!

On Tue, Jul 31, 2018, 12:19 PM fereshtehizadi notifications@github.com wrote:

Sorry where is the path in libdir <- '~/path/to/library/folder/CellRouter/' ??

I set that to my working directory but not working

libdir="/Users/dicty/Downloads/fereshteh" cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths', sep='/'), method="graph") Show Traceback

Rerun with Debug Error in setwd(file.path(maindir, dir)) : cannot change working directory chmod: /Users/dicty/Downloads/fereshteh/results/paths/0.1/results/paths/0.1: No such file or directory

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

fereshtehizadi commented 6 years ago

Sorry I have made a folder named CellRouter and I put CellRouter_Class.R and six jar files downloaded from "https://github.com/edroaldo/cellrouter/tree/master/CellRouter/lib" in that but when I am running


> libdir <- 'CellRouter'
> 
> cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths', sep='/'), method="graph")
chmod: /Users/dicty/Downloads/fereshteh/results/paths/results/paths/0.1: No such file or directory
 Show Traceback

 Rerun with Debug
 Error in setwd(file.path(maindir, dir)) : cannot change working directory 
edroaldo commented 6 years ago

Please,restart your Rstudio and start the analysis again from the beginning to make sure everything is fine. Or set your working directory again using setwd(). When findPaths crashes, is often required to set the working directory again.

Let me know if that works. Almost there!

On Tue, Jul 31, 2018, 12:32 PM fereshtehizadi notifications@github.com wrote:

Sorry I have made a folder named CellRouter and I put CellRouter_Class.R and six jar files downloaded from " https://github.com/edroaldo/cellrouter/tree/master/CellRouter/lib" in that but when I am running

libdir <- 'CellRouter'

cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths', sep='/'), method="graph") chmod: /Users/dicty/Downloads/fereshteh/results/paths/results/paths/0.1: No such file or directory Show Traceback

Rerun with Debug Error in setwd(file.path(maindir, dir)) : cannot change working directory

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

fereshtehizadi commented 6 years ago

Thank you I sat my working directory but

> setwd("/Users/dicty/Downloads/fereshteh/results/paths/CellRouter/")
> 

> 
> 
> cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir), method="graph")
Error: unexpected ',' in "cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir),"
> cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths/CellRouter', sep='/'), method="graph")
chmod: /Users/dicty/Downloads/fereshteh/results/paths/CellRouter/results/paths/CellRouter/0.1: No such file or directory
 Show Traceback

 Rerun with Debug
 Error in setwd(file.path(maindir, dir)) : cannot change working directory 
> 

However thank you

edroaldo commented 6 years ago

You can clearly see that the directory is incorrect. With these settings, your working directory should be:

setwd("/Users/dicty/Downloads/fereshteh")

Please try again after using the sets command above...

On Tue, Jul 31, 2018, 12:42 PM fereshtehizadi notifications@github.com wrote:

Thank you I sat my working directory but

setwd("/Users/dicty/Downloads/fereshteh/results/paths/CellRouter/")

cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir), method="graph") Error: unexpected ',' in "cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir)," cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths/CellRouter', sep='/'), method="graph") chmod: /Users/dicty/Downloads/fereshteh/results/paths/CellRouter/results/paths/CellRouter/0.1: No such file or directory Show Traceback

Rerun with Debug Error in setwd(file.path(maindir, dir)) : cannot change working directory

However thank you

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

fereshtehizadi commented 6 years ago

You right the error gone and another one arose :(

> setwd("/Users/dicty/Downloads/fereshteh")
> libdir='CellRouter'
> cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths/', sep='/'), method="graph")
1) Computing flow network
Error: Could not find or load main class cellrouter.CellRouter
1) Computing flow network
Error: Could not find or load main class cellrouter.CellRouter
> 
edroaldo commented 6 years ago

Do you have java installed at all?

On Tue, Jul 31, 2018, 12:55 PM fereshtehizadi notifications@github.com wrote:

You right the error gone and another one arose :(

setwd("/Users/dicty/Downloads/fereshteh") libdir='CellRouter' cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths/', sep='/'), method="graph") 1) Computing flow network Error: Could not find or load main class cellrouter.CellRouter 1) Computing flow network Error: Could not find or load main class cellrouter.CellRouter

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

fereshtehizadi commented 6 years ago

Sorry I don't know , I am with mac OS right now I downloaded and likely installed java 8 update 181 for Mac os X

edroaldo commented 6 years ago

Please try to follow instructions in the main github webpage to install java.

Thanks!

On Tue, Jul 31, 2018, 1:03 PM fereshtehizadi notifications@github.com wrote:

Sorry I don't know , I am with mac OS

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

edroaldo commented 6 years ago

Sorry,try to google it how to install the Oracle jdk... Thanks!

On Tue, Jul 31, 2018, 1:03 PM fereshtehizadi notifications@github.com wrote:

Sorry I don't know , I am with mac OS

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

fereshtehizadi commented 6 years ago

Thank you, I installed java but error changed to

> cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths/', sep='/'), method="graph")
1) Computing flow network
Error: Could not find or load main class cellrouter.CellRouter
Caused by: java.lang.ClassNotFoundException: cellrouter.CellRouter
1) Computing flow network
Error: Could not find or load main class cellrouter.CellRouter
Caused by: java.lang.ClassNotFoundException: cellrouter.CellRouter
edroaldo commented 6 years ago

Please specify the full path to your CellRouter folder in libdir. This has to work. Again, send me all relevant code starting from libdir...

Thanks

On Tue, Jul 31, 2018, 1:30 PM fereshtehizadi notifications@github.com wrote:

Thank you, I installed java but error changed to

cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths/', sep='/'), method="graph") 1) Computing flow network Error: Could not find or load main class cellrouter.CellRouter Caused by: java.lang.ClassNotFoundException: cellrouter.CellRouter 1) Computing flow network Error: Could not find or load main class cellrouter.CellRouter Caused by: java.lang.ClassNotFoundException: cellrouter.CellRouter

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

fereshtehizadi commented 6 years ago

I am really so sorry for your time but I don't know how to solve this error

> setwd("/Users/dicty/Downloads/fereshteh")
> 
> 
> libdir='CellRouter'
> cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths/', sep='/'), method="graph")
1) Computing flow network
Error: Could not find or load main class cellrouter.CellRouter
Caused by: java.lang.ClassNotFoundException: cellrouter.CellRouter
1) Computing flow network
Error: Could not find or load main class cellrouter.CellRouter
Caused by: java.lang.ClassNotFoundException: cellrouter.CellRouter
> libdir='/Users/dicty/Downloads/fereshteh/CellRouter'
> cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths/', sep='/'), method="graph")
1) Computing flow network
Error: Could not find or load main class cellrouter.CellRouter
Caused by: java.lang.ClassNotFoundException: cellrouter.CellRouter
1) Computing flow network
Error: Could not find or load main class cellrouter.CellRouter
Caused by: java.lang.ClassNotFoundException: cellrouter.CellRouter
> 

All I have done

> filename <- "results/paths/cell_edge_weighted_network.txt"
> 
> write.table(cellrouter@graph$edges, file=filename, sep='\t', row.names=FALSE, col.names = FALSE, quote=FALSE) #input network
> 
> sources <- c('6')
> 
> targets <- setdiff(as.vector(cellrouter@sampTab$*seuratClusters*), sources)
Error: unexpected '*' in "targets <- setdiff(as.vector(cellrouter@sampTab$*"
> 
> targets <- setdiff(as.vector(cellrouter@sampTab$
+                                  seuratClusters), sources)
> 
> methods <- c("euclidean", "maximum", "manhattan","canberra","binary", 'graph') #graph for distances in KNN
> 
> cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths/', sep='/'), method="graph")
 Show Traceback

 Rerun with Debug
 Error in `$<-.data.frame`(`*tmp*`, "population1", value = "6") : 
  replacement has 1 row, data has 0 > libdir='/Users/dicty/Downloads/fereshteh/CellRouter'
> cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths/', sep='/'), method="graph")
 Show Traceback

 Rerun with Debug
 Error in `$<-.data.frame`(`*tmp*`, "population1", value = "6") : 
  replacement has 1 row, data has 0 > libdir='CellRouter'
> cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths/', sep='/'), method="graph")
 Show Traceback

 Rerun with Debug
 Error in `$<-.data.frame`(`*tmp*`, "population1", value = "6") : 
  replacement has 1 row, data has 0 > sources <- c('1')
> targets <- setdiff(as.vector(cellrouter@sampTab$*seuratClusters*), sources)
Error: unexpected '*' in "targets <- setdiff(as.vector(cellrouter@sampTab$*"
> targets <- setdiff(as.vector(cellrouter@sampTab$seuratClusters), sources)
> methods <- c("euclidean", "maximum", "manhattan","canberra","binary", 'graph') #graph for distances in KNN
> cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths/', sep='/'), method="graph")
1) Computing flow network
Error: Could not find or load main class cellrouter.CellRouter
Caused by: java.lang.ClassNotFoundException: cellrouter.CellRouter
1) Computing flow network
Error: Could not find or load main class cellrouter.CellRouter
Caused by: java.lang.ClassNotFoundException: cellrouter.CellRouter
> 
edroaldo commented 6 years ago

Please, provide the full path to libdir!

Instead of this, libdir='CellRouter'

provided this (but change to your directory structure): libdir <- '~/Documents/Projects/cellrouter-master/CellRouter/' #FULL PATH

let me know if it works...

2018-07-31 13:49 GMT-04:00 fereshtehizadi notifications@github.com:

setwd("/Users/dicty/Downloads/fereshteh")

libdir='CellRouter' cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths/', sep='/'), method="graph") 1) Computing flow network Error: Could not find or load main class cellrouter.CellRouter Caused by: java.lang.ClassNotFoundException: cellrouter.CellRouter 1) Computing flow network Error: Could not find or load main class cellrouter.CellRouter Caused by: java.lang.ClassNotFoundException: cellrouter.CellRouter libdir='/Users/dicty/Downloads/fereshteh/CellRouter' cellrouter <- findPaths(cellrouter, column='seuratClusters', libdir, paste(getwd(), 'results/paths/', sep='/'), method="graph") 1) Computing flow network Error: Could not find or load main class cellrouter.CellRouter Caused by: java.lang.ClassNotFoundException: cellrouter.CellRouter 1) Computing flow network Error: Could not find or load main class cellrouter.CellRouter Caused by: java.lang.ClassNotFoundException: cellrouter.CellRouter

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

-- Edroaldo