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

error in bcRegressout #149

Open
Lukadon77 opened this issue Jan 31, 2024 · 2 comments
Open

error in bcRegressout #149

Lukadon77 opened this issue Jan 31, 2024 · 2 comments

Comments

@Lukadon77
Copy link

when I regressout the bc S4 object
bcRegressOut(bc, add.DSS = T,
vars.to.regress = c("nFeature_RNA"))
it stops with the following error:
#Error in rep(1, ncol(dist)) : nvalid 'times' argument.
How can I fix this bug?

@Jojojo-1990
Copy link

I met the same question!!! Do you figure out how to fix it? I actually don't really know what steps should be done to get the correct rds file as the input for beyondcell.

@SGMartin
Copy link
Contributor

@Lukadon77 @Jojojo-1990

Hey, sorry for the late reply

Unfortunately, this is a common issue caused by the imputation step of the regression. At the moment, we suggest just replacing the NaN values with 0s. See the following code snippet:

 # Do not allow NaNs
    bc@normalized[is.na(bc@normalized)] <- 0
    bc <- bcRecompute(bc, slot = "normalized")
    bc <- bcRegressOut(bc = bc, vars.to.regress = c("nFeature_RNA"))

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