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

IntegrateLayers using FastMNN gives error: 'batch' must be specified if '...' has only one object #191

Open
yesitsjess opened this issue May 10, 2024 · 2 comments

Comments

@yesitsjess
Copy link

I'm trying to run FastMNN on a Seurat object from an existing analysis where I previously used Harmony integration but now I want the expression values to be batch corrected so I'm trying to use fastMNN instead.

This is my call:
int_obj1 <- IntegrateLayers(soup_obj, method=FastMNNIntegration, orig.reduction="pca", new.reduction="integrated.mnn", assay="SCT")

And I get the following error:

Converting layers to SingleCellExperiment
Running fastMNN
Error in .check_valid_batch(batches[[1]], batch = batch) : 
  'batch' must be specified if '...' has only one object

Each layer contains 1 batch - any advise on how to correct format it for use with FastMNNIntegration please?

@erzakiev
Copy link

erzakiev commented May 21, 2024

I am not the dev, but I obtain the same issue when I accidentally integrate layers before running the IntegrateLayers with the FastMNNIntegration. If I don't integrate layers, everything works ok. I think what happens in your case is that SCT-integrated assay gets treated as a single object rather than multiple separate layers, hence the error.

Alternatively, if you cannot un-integrate the object, I suggest you provide the batch argument to IntegrateLayers with the vector of group affiliations for each cell (e.g. batch = soup_obj$orig.ident), and it might work.

@callmekelvinn
Copy link

i have the same issue too

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

3 participants