I am getting an error when running the following code using the Ballgown package:
results_exons <- stattest(bg_data_filt_e, feature='exon', covariate='Condition' , meas='mcov')
The error is:
Error in solve.default(t(mod) %*% mod) :
system is computationally singular: reciprocal condition number = 1.31705e-16
From https://github.com/alyssafrazee/ballgown/issues/67 it Alyssa wrote:
'The "system is computationally singular" usually means that all samples have the same value (usually 0, or something very close to zero) for at least one transcript/gene. You can usually fix this by filtering by expression level (see ?exprfilter).'
In this case I am looking at differential exon usage and I have already filtered (or subset-ed) using:
bg_data_filt <- ballgown::subset(bg_data, "rowVars(texpr(bg_data)) > 1", genomesubset=TRUE)
bg_data_filt_e <- ballgown::subset(bg_data_filt, "rowVars(eexpr(bg_data_filt)) > 1", genomesubset=TRUE)
So I am already filtering out low variance transcripts and exons already. This approach works fine for the transcripts, genes and introns but not the exons...
I have also looked at filtering the initial ballgown object using an FPKM cutoff of 1 (using exprfilter) and tried changing the meas used for exon expression to mrcount, rcount or ucount. No luck.
I'm pretty new to this so can anyone advise on why stattest might be failing, or give me a few pointers?