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

Error in the graphfinder function #2

Open
GMaciag opened this issue Mar 13, 2020 · 2 comments
Open

Error in the graphfinder function #2

GMaciag opened this issue Mar 13, 2020 · 2 comments

Comments

@GMaciag
Copy link

GMaciag commented Mar 13, 2020

Thank you for the great work. I was trying to run tSpace on my dataset - 50 PCs of around 11000 cells. However, tSpace failed with error '"Error in -rem : invalid argument to unary operator"'. I debugged and traced the error to line 64 of the graphfinder function

temp <- temp[-rem,]

Turns out in my case 'rem' list is empty - it just contains 50 NULL objects. Because of this empty list the step mentioned above fails. The 'rem' object is created a few lines before in a parallel process I cannot debug further, so I'm not sure which line exactly is causing the problem.

Could you please assist me in solving this issue?

@hylasD
Copy link
Owner

hylasD commented Mar 13, 2020 via email

@GMaciag
Copy link
Author

GMaciag commented Mar 16, 2020

Hi Denis

I maybe should've mentioned that I'm preprocessing my data in scanpy before loading it into R. I checked and the error happens also with the pbmc3k dataset from scanpy's tutorial: https://icb-scanpy-tutorials.readthedocs-hosted.com/en/latest/pbmc3k.html

After following the tutorial (at least until creating the PCA reduction) I save the PC representation of the data to a .mtx file with
mmwrite(target = "pbmc3k_tSPACE.mtx", a = sparse.csr_matrix(adata.obsm['X_pca'].T))
Then I load it into R, transform it to a dataframe and run tSpace with:

data <- Matrix::readMM(file = "./pbmc3k_tSPACE.mtx")
df <- as.data.frame(as.matrix(data))
ts <- tSpace(df = df, K = 20, D = 'pearson_correlation', graph = 5, 
             trajectories = 100, wp = 15, dr = 'pca', core_no = 40,
             ground_truth = T)

You can find the file with pbmc3k data I'm trying to run with tSpace here:
https://drive.google.com/open?id=1CdCr3gNPSQeDgA3XmS42iE1b9PE-LumI

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

2 participants