Question: PlotMA Filters for DeSEQ2 ; adjusting script
0
3.4 years ago by
sjs02820
sjs02820 wrote:

I'm trying to get a mean expression plot, where only genes that are + - 0.6 LFC, and have a padj <0.001 to be in red. I have tried the following 2-3 things, but don't know how to get a plot where only the genes that are greater than 0.6 LFC and less than padj<0.001 to be in red. I''ve checked different forums and versions of DeSEQ2 vignettes.

## how to add a filter for LFC +- 0.6 to to this script: plot(log10(res$baseMean),res$log2FoldChange,xlab="mean expression",ylab="log fold change",pch=3,cex=0.5)
filt <- res$pvalue < 0.001 points(log10(res$baseMean)[filt],res$log2FoldChange[filt],col=2,pch=3,cex=0.5) abline(h=0,col=4) ##or fix this script plotMA(res, res$padj < 0.01 & res$log2FoldChangee > 0.5, main= "Differentially Expressed Genes", ylim=c(-1.5, 1.5)) rnaseq deseq deseq2 rna-seq plotma • 2.7k views ADD COMMENTlink modified 3.4 years ago by Michael Love24k • written 3.4 years ago by sjs02820 Answer: PlotMA Filters for DeSEQ2 ; adjusting script 0 3.4 years ago by EMBL European Molecular Biology Laboratory Wolfgang Huber13k wrote: sjs0282 If you're only interested in genes with a minimal absolute fold-change, you should insert that already in your null hypothesis. Have a look at Section 3.9 of the DESeq2 vignette: Tests of log2 fold change above or below a threshold Best wishes Wolfgang ADD COMMENTlink written 3.4 years ago by Wolfgang Huber13k Answer: PlotMA Filters for DeSEQ2 ; adjusting script 0 3.4 years ago by Michael Love24k United States Michael Love24k wrote: First, see Wolfgang's answer which is our preferred way to test LFC greater than a threshold. ~~~ However, if you still want to test a null of LFC = 0, but you want to customize the plot, if you do: library(DESeq2) ?plotMA You should get a set of options: Choose one 1: Generate an MA plot {geneplotter} 2: MA-plot from base means and log fold changes {DESeq2} 3: MA-plot: plot differences versus averages for high-throughput data {BiocGenerics} Note that (2) is the DESeq2 method which works on results tables. This method itself creates a data.frame and calls (1). See the manual page for (1) for ideas on how to customize. The x is res$baseMean, the y is res$log2FoldChange, and the third column is res$padj < alpha, except to deal with NA (from filtering) you can use:

ifelse( is.na( res$padj ), FALSE, res$padj < alpha )

plotMA-methods           package:geneplotter           R Documentation

Generate an MA plot

Description:

Generate a plot of log fold change versus mean expression (MA
plot)

Usage:

## S4 method for signature 'data.frame'
plotMA( object, ylim = NULL,
colNonSig = "gray32", colSig = "red3", colLine = "#ff000080",
log = "x", cex=0.45, xlab="mean expression", ylab="log fold change", ... )

Arguments:

object: A ‘data.frame’ with (at least) three columns, the first
containing the mean expression values (for the x-axis), the
second the logarithmic fold change (for the-y axis) and the
third a logical vector indicating significance (for the
colouring of the dots).

...