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 predLoess(object$y, object$x, newx = if (is.null(newdata)) object$x else if (is.data.frame(newdata)) as.matrix(model.frame(delete.response(terms(object)), : NA/NaN/Inf in foreign function call (arg 5) #10

Open
Dana11T opened this issue Sep 2, 2023 · 3 comments

Comments

@Dana11T
Copy link

Dana11T commented Sep 2, 2023

I encountered an error when running this line of code, rogue.res <- rogue(expr, labels = meta$Tcluster, samples = meta$source, platform = "UMI", span = 0.6)
Error in predLoess(object$y, object$x, newx = if (is.null(newdata)) object$x else if (is.data.frame(newdata)) as.matrix(model.frame(delete.response(terms(object)), :
NA/NaN/Inf in foreign function call (arg 5)
In addition: There were 50 or more warnings (use warnings() to see the first 50)
Through tracing, I found that there was a problem during the calculation of prd <- predict(fit, .x$mean.expr) in SE_fun(), specifically in the ROGUE::entropy_fit step.
Here's what my data looks like, and I'm not quite sure where the problem is occurring. Can you provide some insights.
fit
Call:
loess(formula = entropy ~ mean.expr, data = tmp, span = span)

Number of Observations: 3379
Equivalent Number of Parameters: NaN
Residual Standard Error: NaN

.x$mean.expr
NOC2L ISG15 C1orf159 TNFRSF4 SDF4 B3GALT6 PUSL1
0.08004271 0.22314355 0.08004271 0.08004271 0.08004271 0.08004271 0.08004271
AURKAIP1 CCNL2 MRPL20 SSU72 MIB2 GNB1 FAAP20
0.08004271 0.08004271 0.28768207 0.08004271 0.08004271 0.08004271 0.15415068
RER1 TNFRSF14 RPL22 TNFRSF25 CAMTA1 VAMP3 UTS2 prd <- predict(fit, .x$mean.expr)
Error in predLoess(object$y, object$x, newx = if (is.null(newdata)) object$x else if (is.data.frame(newdata)) as.matrix(model.frame(delete.response(terms(object)), :
NA/NaN/Inf in foreign function call (arg 5)

@Crorazon
Copy link

Crorazon commented Sep 7, 2023

I also encountered a similar issue

@Crorazon
Copy link

Crorazon commented Sep 7, 2023

rogue.res <- rogue(expr, labels = meta$leiden_0.8, samples = meta$Treatment, platform = "UMI", span = 0.9) @Dana11T

@nictru
Copy link

nictru commented Jan 18, 2024

Incrementally increasing the span parameter solved it for me

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