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

How to convert seurat object to ts file? #6

Open
Roger-GOAT opened this issue Feb 2, 2021 · 0 comments
Open

How to convert seurat object to ts file? #6

Roger-GOAT opened this issue Feb 2, 2021 · 0 comments

Comments

@Roger-GOAT
Copy link

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!

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

1 participant