This is a test version of Biostars. For the public version, visit https://www.biostars.org.
diffSplice: Error in exon.genes[o, , drop = FALSE] : incorrect number of dimensions

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

diffsplice edger voom exon

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:

101010 Button

Was this solved, I have a similar issue?

Adding to the previous answer you should make sure that the dge$genes is a data.frame (and not a character vector) that includes the two columns GeneID and ExonID.

1 answer

diffSplice has been used many times and is pretty robust. I am unable to reproduce the error you report even by deliberating giving incorrect input to the function.

I have to assume that there is something wrong with your input data or, possibly, that you have an ancient version of the software. The error would have to arise from manipulating the ID vectors GeneID and ExonID but you don't show us any values for either of them. Can you show the output from head(fit$genes)? That would at least reassure us that the column ExonID exists.

Log in to answer this question.