From 63e0fe6524b70ed81d95ac6cbf05c390fcbc506b Mon Sep 17 00:00:00 2001 From: Sarah Griffiths Date: Wed, 10 Apr 2024 08:09:23 +0000 Subject: [PATCH] change significance level to mark on MA plot --- CHANGELOG.md | 4 ++++ bin/de_analysis.R | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f46e5e6..1a0e3b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [unreleased] +### Changed +- MA plot in the `results_dge.pdf` has been updated to match the MA plot in the report. + ## [v1.1.1] ### Changed - Improved handling of different annotation file types (eg. `.gtf/.gff/.gff3`) in `de_analysis` mode. diff --git a/bin/de_analysis.R b/bin/de_analysis.R index 4aae056..b76c106 100755 --- a/bin/de_analysis.R +++ b/bin/de_analysis.R @@ -123,7 +123,18 @@ qlf <- glmQLFTest(fit) edger_res <- topTags(qlf, n=nrow(y), sort.by="PValue")[[1]] pdf("de_analysis/results_dge.pdf") -plotMD(qlf) + +# create status vector +status <- ifelse( + qlf$PValue<0.01 & qlf$logFC>0, + 'up', + ifelse( + qlf$PValue<0.01 & qlf$logFC<=0, + 'down', + 'notsig' + ) +) +plotMD(qlf, status=status, values=c("up","down","notsig"), hl.col=c("red","blue","black")) abline(h=c(-1,1), col="blue") plotQLDisp(fit)