I am getting a warning for estimateDisp : "In estimateDisp(x, Design) : No residual df: setting dispersion to NA"
Then followed by an error in glmFit(x, Design) : Error in qr.coef(qr(design), matrix(beta.mean, nrow= nlibs, ncol = ngenes
'qr' and 'y' must have same number of genes
Phenotype <- c("biopsy_carcinoma", "biopsy_carcinoma", "biopsy_carcinoma", "biopsy_carcinoma", "fecal_carcinoma", "fecal_carcinoma", "fecal_carcinoma", "fecal_carcinoma", "fecal_carcinoma")
Pair_factor <- c("WFB5", "WFB4", "WFB2", "WFB3", "WFB2", "WFB4", "WFB5", "WFB3", "WFB1")
design = model.matrix(~Pair_factor + Phenotype)
colnames(design)
x = DGElist(counts = x, group = Phenotype, genes = gene_table, remove.zeros = TRUE)
where dim(x) = 894 10
dim(gene_table) = 894 7
then,
x = calcNormFactors(x, method = "RLE")
x = estimateDisp(x, design) which is when I get the warning
fit = glmFit(x, design) which is when I get the error
Any idea what might be going wrong? Any inputs will be much appreciated,
Thanks a tonne,
Manasi Shah, MS
PhD Epidemiology Candidate, UTSPH
Further edit:
I cleared my environment and realized there were some old objects it was calling. Now I get a new error
Error in as.vector(x, mode) :
cannot coerce type 'closure' to vector of type 'any' in the estimateDisp(x, design) step
how did my x become of type closure?
Even further edit, I seemed to have fixed the coerce error, I took the exact same code for a similar study that worked and used it for another subset
Got a new error and this seems to be the final one:
Error in lfproc(x, y, weights = weights, cens = cens, base = base, geth = geth, :
newsplit: out of vertex space
Any idea what causes this?
Thanks,
Manasi
You should quit R, and restart using
R --vanilla
to make sure you aren't loading up a bunch of cruft from whatever .RData file you have floating around in that directory. As an aside, I never save my R workspace - I might save one or two objects, but when I quit R, it's automatically set to not save anything. In my opinion there is no profit in having stuff get automatically loaded into an R session - it often takes a long time to load, and then there are all these objects that I don't remember creating that can wreak havoc on the analysis.
Once you have reloaded a clean R session, try running your code again.
I have tried to keep my R session clean with more discipline (and developed more faith on the reproducibility of my code and results) since this post :) since this post. Thank you