csaw version: csaw_1.10.0
The call to combineTests below fails:
> tabcom <- combineTests(merged$id, results$table) Error: length(ids) == nrow(tab) is not TRUE > length(merged$id) [1] 14051634 > nrow(results$table) [1] 120695
When I get this error, what might the possible causes be?
My code is the following (and it works on many datasets, but fails on one particular for some reason):
data = readRDS(snakemake@input[["data"]]) design = read.table(snakemake@input[["design"]]) normfacs = unlist(read.table(snakemake@input[["normfacs"]])) y = readRDS(snakemake@input[["estimate_disp"]]) library(csaw) library(edgeR) library(IRanges) contrast = as.numeric(makeContrasts(snakemake@wildcards[["contrast"]], levels=colnames(design))) fit <- glmQLFit(y, design, contrast=contrast, robust=TRUE) results <- glmQLFTest(fit, contrast=contrast) # correct for multiple testing print("correct for multiple testing") merged <- mergeWindows(rowRanges(data), tol=1000L) tabcom <- combineTests(merged$id, results$table) print("writing output file") df = as.data.frame(merged$region) row.names = with(df, paste0(seqnames, "_", start, "_", end)) rownames(tabcom) = row.names write.table(tabcom, snakemake@output[[1]])
Many thanks for your help!
If having the data available for running the code yourself might help debugging I can upload it to dropbox.
Brilliant, I'll wager this is it. Thanks.