Skip to content
Snippets Groups Projects
Commit ccf6d608 authored by Holger Brandl's avatar Holger Brandl
Browse files

fixed replicate extraction pattern

parent d0b89814
No related branches found
No related tags found
No related merge requests found
......@@ -87,7 +87,7 @@ genesAfter <- nrow(countMatrix)
#' [Moderated estimation of fold change and dispersion for RNA-seq data with DESeq2](http://genomebiology.com/2014/15/12/550/abstract)
get_sample_from_replicate <- function(repName) str_match(repName, "(.*)_[R]?[0-9]{1}$")[,2]
get_sample_from_replicate <- function(repName) str_match(repName, "(.*)_([R]|rep)?[0-9]{1}$")[,2]
# Define or load a contrasts matrix
if(!is.null(contrasts_file)){
......@@ -117,7 +117,13 @@ contrasts %>% kable()
colData <- data.frame(condition=colnames(countMatrix) %>% get_sample_from_replicate)
# valiadate that contrasts model is compatible with data
stopifnot(all((contrasts %>% gather %$% value %>% unique) %in% colData$condition))
if(!all((contrasts %>% gather %$% value %>% unique) %in% colData$condition)){
echo("column model: ",colData$condition)
echo("contrasts: ", contrasts %>% gather %$% value %>% unique)
stop("column model is not consistent with contrasts")
}
#stopifnot(all((contrasts %>% gather %$% value %>% unique) %in% colData$condition))
dds <- DESeqDataSetFromMatrix(countMatrix, colData, formula(~ condition))
dds <- estimateSizeFactors(dds)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment