I'm trying to run the exon level analysis RNA-seq data according to: https://www.bioconductor.org/help/course-materials/2014/BioC2014/BioC2014_edgeR_voom.html#/38. . However for some reason after running the diffSplice it gives me the error: Error in exon.genes[o, , drop = FALSE] : incorrect number of dimensions. No idea where that might come from. Both geneid and exonid vectors are character vectors as they are supposed to be. Could anyone help with this. The code is shown below:
dge <- DGEList(counts=countdata_merged, samples = coldata, group = coldata$CASE_CONTROL)
dge$genes$GeneID <- GeneID
#Lets do the model matrix
x <- model.matrix(~ CASE_CONTROL + PRE_MID_POST + CASE_CONTROL:subject.nested + CASE_CONTROL:PRE_MID_POST, coldata)
all.zero <- apply(x, 2, function(x) all(x==0))
all.zero
idx <- which(all.zero)
full <- x[,-idx]
design <- full
design
#Lets do some prefiltering if we want to
A <- rowSums(dge$counts)
dge <- dge[A>10, ,keep.lib.sizes=FALSE]
#Lets calculate the calcNormFactors
dge <- calcNormFactors(dge)
#Linear modelling
v <- voom(dge,design,plot=TRUE)
fit <- lmFit(v,design)
# 1) DiffSplice
ex <- diffSplice(fit, geneid= "GeneID", exonid = "ExonID", verbose=TRUE)
Error in exon.genes[o, , drop = FALSE] : incorrect number of dimensions
Adding to the previous answer you should make sure that the
dge$genes
is adata.frame
(and not a character vector) that includes the two columnsGeneID
andExonID
.I added code markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:
Was this solved, I have a similar issue?