speckle icon indicating copy to clipboard operation
speckle copied to clipboard

Batch normalised proportions

Open ConDem94 opened this issue 2 years ago • 1 comments

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

ConDem94 avatar Aug 06 '23 13:08 ConDem94

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

bphipson avatar Aug 10 '23 04:08 bphipson