hylasD/tSpace

How to convert seurat object to ts file?

Opened this issue · 0 comments

hi team, I try to build a ts file by
ts <- tSpace(df = your_data, K = 20, L = 15, D = 'pearson_correlation', graph = 5, trajectories = 200, wp = 15, dr = 'pca', core_no = 2)
However, how to create the "your_data" from a seurat object? I try the following two ways:

  1. data.table<- as.matrix(GetAssayData(seurat_object, slot = "data"))

ts <- tSpace(df = data.table,

  •          K = 20, L = 15, 
    
  •          D = 'pearson_correlation', 
    
  •          graph = 5, 
    
  •          trajectories = 200, 
    
  •          wp = 15, dr = 'pca', core_no = 8)
    

Step 1:Finding graphError in graph.adjacency.sparse(adjmatrix, mode = mode, weighted = weighted, :
not a square matrix

  1. data.table<- as.matrix(GetAssayData(seurat_object, slot = "data"))
    data.table <- as(data.table, 'sparseMatrix')

ts <- tSpace(df = data.table,

  •          K = 20, L = 15, 
    
  •          D = 'pearson_correlation', 
    
  •          graph = 5, 
    
  •          trajectories = 200, 
    
  •          wp = 15, dr = 'pca', core_no = 8)
    

Step 1:Finding graphError in { :
task 1 failed - "unable to find an inherited method for function ‘[’ for signature ‘"dgCMatrix"’"

How to create an eligible "your_data" file? Thanks a lot!