-
Notifications
You must be signed in to change notification settings - Fork 15
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 design of voom object #15
Comments
I will this this tomorrow, but in the meantime the issue is due to the fact that your formula is really a string. If you remove the quotes it should work |
Fixed in v1.19.7. Confirm? |
The outcome is the same with both an unquoted and a quoted formula.
I'm working in R 4.0.2. |
This error is still a problem in
|
In The
|
This error is intended, but not that informative. I have updated it to read: The issue is that that metadata <- tibble::tribble(
~samples, ~sex, ~batch, ~age, ~RIN, ~diagnosis,
"S567", "F", "1", "68", "7.5", "dx",
"S453", "F", "2", "60", "7", "dx",
"S231", "M", "2", "54", "7", "dx",
"S444", "M", "2", "55", "7", "dx",
"S555", "F", "1", "68", "7.5", "dx",
"S304", "F", "2", "60", "7", "ct",
"S232", "M", "2", "54", "7.5", "ct",
"S447", "M", "2", "55", "7.5", "ct"
)
metadata <- tibble::column_to_rownames(metadata, var = "samples")
counts <- tibble::tribble(
~geneId, ~S567, ~S453,~S231, ~S444, ~S555, ~S304, ~S232, ~S447,
"ENSG1", 0, 0, 500, 0, 10, 43, 432, 45,
"ENSG2", 23, 25, 29, 30, 56, 89, 73, 70,
"ENSG3", 84, 82, 0, 0, 98, 80, 200, 201,
"ENSG4", 0, 204, 350, 790, 353, 456, 555, 890,
"ENSG5", 0, 0, 0, 70, 0, 0, 0, 70
)
counts <- tibble::column_to_rownames(counts, var = "geneId")
counts <- as.matrix(counts)
# code from before: running calcNormFactors on counts directly is not what you want.
# gene_expression <- edgeR::DGEList(counts)
# gene_expression <- edgeR::calcNormFactors(counts)
# correct code that avoids this error
DGE <- edgeR::DGEList(counts)
gene_expression <- edgeR::calcNormFactors(DGE)
form = ~ diagnosis + (1|batch)
voom_gene_expression <- variancePartition::voomWithDreamWeights(counts = gene_expression,
formula = form,
data = metadata,
quiet = TRUE)
voom_gene_expression$design |
Oops that was a typo! Thanks for updating the error message. However, when I copy and paste the above I still get the error:
Running |
Wow, this is a mysterious one! Can you send Also are you running in a fresh R session? |
This works in a fresh R session. 💯 |
I'm running
varianceParition
1.19.6. To repro the error fromvoomWithDreamWeights
:Error:
The text was updated successfully, but these errors were encountered: