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

More informative error message for mismatching numbers of rows #46

Open
LTLA opened this issue Oct 19, 2020 · 0 comments
Open

More informative error message for mismatching numbers of rows #46

LTLA opened this issue Oct 19, 2020 · 0 comments

Comments

@LTLA
Copy link
Contributor

LTLA commented Oct 19, 2020

Consider the following example:

library(SummarizedExperiment)
se <- SummarizedExperiment(assays=list(X=cbind(1:10)))
cbind(se, se[1:5,])
## Error in cbind(...) : number of rows of matrices must match (see arg 2)

Okay, that's pretty helpful. But the following is more obscure:

se <- SummarizedExperiment(rowData=DataFrame(X=1:10))
cbind(se, se[1:5,])
## Error in FUN(X[[i]], ...) :
##   column(s) 'X' in ‘mcols’ are duplicated and the data do not match

Of course, I know why this happens, but it would be a lot nicer if it could just say "number of rows don't match". This is especially important because I use SE's cbind internally in some SCE methods; currently, the user ends up with a message about some column they never actually created themselves, while the real error has to do with a mismatching number of rows.

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

1 participant