Hello, I am working with a gene expression dataset. In the image below, you can see the structure of my dataset. I am attempting to straightforwardly use the Limma package on my dataset. I am using a CSV reader to read my file, and then I am using an R snippet with the following code to run the Limma package. However, I am encountering different errors, with the error below being the most persistent. Should I be performing more data transformation steps before feeding my data into the R snippet with the limma package? If someone could tell me where I am making a mistake and how I can fix it, it would be great. Or if someone already has an existing limma node for knime for Windows that would be great as well.
code
"
Convert the âclassâ column to a factor
kIn$class â factor(kIn$class)
Create a design matrix
design â model.matrix(~0 + kIn$class)
Extract the expression data
exprs_data â as.matrix(kIn[, -1]) # Convert to a matrix
Load the limma package
if (!requireNamespace(âBiocManagerâ, quietly = TRUE))
install.packages(âBiocManagerâ)
BiocManager::install(âlimmaâ)
library(limma)
Fit the linear model
fit â lmFit(exprs_data, design)
Apply empirical Bayes moderation
fit â eBayes(fit)
Extract the results
results â topTable(fit, coef=âkIn$classposâ, number=nrow(exprs_data))"
This is the error
âERROR R Snippet 5:489 Execute failed: Failed to evaluate the script:
Error : Error in lmFit(exprs_data, design) :
row dimension of design doesnât match column dimension of data objectâ