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

data requirement for getLineages #36

Closed
jimlin1668478052 opened this issue May 5, 2019 · 3 comments
Closed

data requirement for getLineages #36

jimlin1668478052 opened this issue May 5, 2019 · 3 comments

Comments

@jimlin1668478052
Copy link

An error is reported when I try to use the function "getLineages":

spangler.sce <- getLineages(spangler.sce, cl)
Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘getLineages’ for signature ‘"SingleCellExperiment", "factor"’

spangler.sce is a SingleCellExperiment data converted from Seurat
cl is a list of factor (including numbers 0-9 in the form of characters)

The same problem occurs when I change cl into a vector:

spangler.sce <- getLineages(spangler.sce, c("0","1","2","3","4","5","6","7","8","9"))
Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘getLineages’ for signature ‘"SingleCellExperiment", "character"’

The function slingshot can work very well with the same SingleCellExperiment data:
spangler.sce <- slingshot(spangler.sce,clusterLabels = "seurat_clusters", reducedDim = "PCA")

@kstreet13
Copy link
Owner

Thanks for the report! I agree that this is strange behavior and I will add functionality to handle it in the next update.

Originally, I thought of slingshot() as being the main function and getLineages and getCurves as being low-level helpers that most people wouldn't interact with, so I didn't think it was necessary to add a method for this case. But it seems like a few people have had this issue, especially with larger datasets where getCurves can be slow.

@kstreet13
Copy link
Owner

Oh, sorry, I also should have mentioned that you can work around this by extracting the relevant parts of the SingleCellExperiment object and directly inputting them to getLineages. In your case, I think that would look like this:

getLineages(reducedDims(spangler.sce)$PCA, clusterLabels = cl)

Which will return a SlingshotDataSet object that can be used with getCurves.

@kstreet13
Copy link
Owner

Sorry for the delay. This is now implemented in the master branch here and in the devel branch of Bioconductor (slingshot version >= 1.3.1). Specifically, getLineages() and getCurves() now accept SingleCellExperiment objects as input. Thanks for the report!

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