constantAmateur / SoupX

R package to quantify and remove cell free mRNAs from droplet based scRNA-seq data
253 stars 34 forks source link

Error with CreateCleanedSeurat function #17

Closed immune-sc closed 4 years ago

immune-sc commented 4 years ago

I get the following error when I try to create cleaned seurat object

Error in createCleanedSeurat(scl) : no slot of name "calc.params" for this object of class "Seurat"

erikagucciardo commented 4 years ago

Yes, I just got the same error while following the example in the vignette.

Zanvine-gitcode commented 4 years ago

Hi,

I ran into this issue but I think I've found a manual way around it.

in your scl list, you'll have your assay from Staincells() as scl$strainedExp or adjustCounts as scl$atoc

Just do. newcounts <- scl$atoc this will be a dgMatrix, then new.so <- CreateSeuratObject(newcounts, project= 'NAME', min.cells = X, min.features = Y)

Not sure what else createCleanedSeurat does, perhaps normalises and adds extra metadata?

juliaszusz commented 4 years ago

This is because the code for CreateCleanedSeurat() creates a version 2 seurat object, and you have version 3 installed. I worked around this by uninstalling Seurat, installing an older version, running this code and then reinstalling Seurat v3 and running UpdateSeuratObject().

I would like to request an update by the authors to make the CreateCleanedSeurat() section of the code compatible with version 3.

Thanks!

sbridgett commented 4 years ago

I was looking into the source code a bit:

The source code for the SoupX "createCleanedSeurat" function is: https://github.com/constantAmateur/SoupX/blob/master/R/createCleanedSeurat.R

A comments states that: calc.params was "Pulled from Seurat:::SetCalcParams"

In Seurat 2, the "calc.params" slot is: "..Named list to store all calculation-related parameter choices": https://github.com/satijalab/seurat/blob/fc4a4f5203227832477a576bfe01bc6efeb23f51/R/objects.R

In Seurat 3 the "CreateSeuratObject" fuction doesn't create "calc.params": https://github.com/satijalab/seurat/blob/master/R/objects.R (line 689)

And in Seurat 3 that "SetCalcParams" function seems to only be in the file "R/unknown.old": https://github.com/satijalab/seurat/blob/25b830b0dd6f12538516f0faf9a3b3ddfd0ce6d8/R/unknown.old

So maybe for Seurat 3 it's a case of using the "createCleanedSeurat" code, changing the "calc.params" steps: https://github.com/co1nstantAmateur/SoupX/blob/master/R/createCleanedSeurat.R

May can use the "scale.data" slot instead?

There some info here about "Integrating result with Scanpy" (and Seurat): https://github.com/constantAmateur/SoupX/issues/6

constantAmateur commented 4 years ago

This function has now been removed as it was really beyond the scope of this package. The adjustCounts function will now return a decontaminated count matrix that you can pass directly to Seurat as desired.

sbridgett commented 4 years ago

Hi Mathew,

Thank you for your reply about this issue, and for updating the adjustCounts function to return the decontaminated count matrix to pass to Seurat.

Stephen.

On Mon, 25 Nov 2019 at 09:43, Matthew D. Young notifications@github.com wrote:

This function has now been removed as it was really beyond the scope of this package. The adjustCounts function will now return a decontaminated count matrix that you can pass directly to Seurat as desired.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/constantAmateur/SoupX/issues/17?email_source=notifications&email_token=AAQP74AUUPCOKGCJVYKVBGDQVOM5TA5CNFSM4I6JUXAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFBYPOA#issuecomment-558073784, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQP74FJD64GM4PCC6D7N3TQVOM5TANCNFSM4I6JUXAA .