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

Batch normalised proportions #7

Open
ConDem94 opened this issue Aug 6, 2023 · 1 comment
Open

Batch normalised proportions #7

ConDem94 opened this issue Aug 6, 2023 · 1 comment

Comments

@ConDem94
Copy link

ConDem94 commented Aug 6, 2023

Is it possible to obtain batch normalized proportions using the propeller package? I have multiple samples from 5 different studies which are integrated using scvi. I would like to perform de novo clustering based on the proportions of 50-60 cell types. Is it possible to retrieve transformed proportions by regressing out the batch effects from the studies?

Thank you!

Best wishes,
Constantinos

@bphipson
Copy link
Contributor

Hi Constantinos

One way of doing this is to use the limma removeBatchEffect function. What I would do is get the transformed proportions by running the getTransformedProps function in speckle:

props <- getTransformedProps(sce$cluster, sce$sample, transform="logit")

and then passing the transformed proportions to removeBatchEffect

props.nobatch <- limma::removeBatchEffect(props$TransformedProps, batch=batch, design=design)

Have a read of the help for the removeBatchEffect function. The design matrix should include the covariates of interest, and exclude the batch variable.

?limma::removeBatchEffect

Then you could cluster props.nobatch.

Hope that helps.

Cheers,
Belinda

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