diff --git a/DESCRIPTION b/DESCRIPTION index c1791343536172517a4ff7aae82268912b5cb252..5441fb4fe1a7bea560f44572cbc187591c484d6d 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: ChIPuanaR Type: Package Title: Differential analysis of ChIP-Seq data Version: 0.99.0 -Date: 2020-01-13 +Date: 2020-04-06 Author: Marie-Agnes Dillies, Hugo Varet and Maëlle Daunesse Maintainer: Maëlle Daunesse <maelle.daunesse@pasteur.fr> Depends: R (>= 3.4.0), DESeq2, limma, kableExtra, knitr, ggplot2 diff --git a/R/run.DESeq2.r b/R/run.DESeq2.r index 823f9975a62a9a33a95b7140a06a5817ab034496..e36ec136c3d4aa688cf69669630497bd18b7bc0b 100755 --- a/R/run.DESeq2.r +++ b/R/run.DESeq2.r @@ -44,7 +44,11 @@ run.DESeq2 <- function(counts, conditions, batch=NULL, pAdjustMethod="BH", spike colnames(counts.norm) <- paste0("norm.",colnames(counts)) res <- results(dds, contrast=c("conditions", levelTest, levelRef), pAdjustMethod=pAdjustMethod, cooksCutoff=TRUE, independentFiltering=FALSE) - res <- res[, c("baseMean", "log2FoldChange", "pvalue", "padj", "lfcSE", "stat")] + res <- res[, c("baseMean", "log2FoldChange", "lfcSE", "stat", "pvalue", "padj")] + res$baseMean <- round(res$baseMean, 2) + res$log2FoldChange <- round(res$log2FoldChange, 2) + res$lfcSE <- round(res$lfcSE, 2) + res$stat <- round(res$stat, 2) resAnDif <- data.frame(counts, counts.norm, res) results[[paste0(levelTest,"_vs_",levelRef)]] <- resAnDif cat(paste("Comparison", levelTest, "vs", levelRef, "done\n")) diff --git a/R/run.Limma.r b/R/run.Limma.r index 865733014c59942d2eb9b0b98fcb50bddc630a49..9a4dc8039ea02aeb3d9caa515813d263dc0cd4df 100644 --- a/R/run.Limma.r +++ b/R/run.Limma.r @@ -51,9 +51,10 @@ run.Limma <- function(counts, conditions, normalize.method="quantile", spikes=NU fit2 <- contrasts.fit(fit=fit, contrasts=cont.matrix) efit <- eBayes(fit=fit2) colnames(v$E) <- paste0("norm.", colnames(counts)) - resAnDif <- data.frame(counts,v$E, - baseMean=efit$Amean, - log2FoldChange=as.numeric(efit$coefficients), + resAnDif <- data.frame(counts, + round(v$E, 2), + baseMean=round(efit$Amean, 2), + log2FoldChange=round(as.numeric(efit$coefficients), 2), pvalue=as.numeric(efit$p.val), padj=p.adjust(efit$p.value, method=pAdjustMethod)) results[[paste0(levelTest,"_vs_",levelRef)]] <- resAnDif