Commit f3da2354 authored by Christian Arnold's avatar Christian Arnold

Made DESeq analysis compatible for older versions of DESeq that did not set row and column names

parent 43f598b5
......@@ -202,7 +202,13 @@ if (length(unique(sampleIDs)) != nrow(sampleData.df)) {
checkAndLogWarningsAndErrors(NULL, message, isWarning = FALSE)
}
if (length(sampleIDs) != ncol(coverageAll.m)) {
message = paste0("Mismatch between number of sample IDs (", length(sampleIDs), ") and number of columns in coverage file (", ncol(coverageAll.m), "). It appears that the number of samples been changed after running the pipeline the first time. Rerun the full pipeline from scratch.")
checkAndLogWarningsAndErrors(NULL, message, isWarning = FALSE)
}
colnames(coverageAll.m) = sampleIDs
rownames(coverageAll.m) = coverageAll.df$Geneid
......@@ -378,7 +384,13 @@ runPermutation <- function(permutationCur, sampleDataOrig.df, variableToPermute,
colData = sampleData.df,
design = designFormula)
# Recent versions of DeSeq seem to do this automatically, whereas older versions don't, so enforce it here
if (!identical(colnames(cds.peaks), colnames(coverageAll.m))) {
colnames(cds.peaks) = colnames(coverageAll.m)
}
if (!identical(rownames(cds.peaks), rownames(coverageAll.m))) {
rownames(cds.peaks) = rownames(coverageAll.m)
}
# Do a regular size factor normalization
if (!par.l$doCyclicLoess) {
......
......@@ -250,6 +250,15 @@ for (permutationCur in 0:par.l$nPermutations) {
colData = sampleData.df,
design = designFormula)
# Recent versions of DeSeq seem to do this automatically, whereas older versions don't, so enforce it here
if (!identical(colnames(TF.cds), colnames(TF.table.m))) {
colnames(TF.cds) = colnames(TF.table.m)
}
if (!identical(rownames(TF.cds), rownames(TF.table.m))) {
rownames(TF.cds) = rownames(TF.table.m)
}
TF.cds
}, error = function(e) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment