rna-seq-star-deseq2 icon indicating copy to clipboard operation
rna-seq-star-deseq2 copied to clipboard

DESeq2 Plots Incorrectly Displayed

Open tjbencomo opened this issue 5 years ago • 6 comments

The MA and PCA plots produced by DESeq2 lack any text labels. These labels are replaced by empty rectangles. The same issue occurs with JPEG and SVG files (only included JPEG because GitHub prevents SVG uploads).

pca

The issue occurs whether I'm using the deseq2.yaml environment provided in this repo or an updated environment using newer versions of the software packages.

tjbencomo avatar Feb 23 '20 00:02 tjbencomo

This doesn´t look like a bug caused by the pipeline. The Rscript to provide the PCA should be working fine. I guess it might be due to intgroup trying to get colData(x). Take a look at your sample.tsv there might be some weird encoding or something going on that causes this behavior.

Jukre111 avatar Feb 23 '20 01:02 Jukre111

I looked at the data frame returned by pcaPlot(counts, ..., returnData=TRUE) and the data doesn't seem to have any formatting problems:

              PC1        PC2  group condition    name
sample1 -3.704292  1.6779008 mutant    mutant sample1
sample2 -1.798926 -2.6809379 mutant    mutant sample2
sample3 -1.005645  0.3627278 mutant    mutant sample3
sample4  3.347792 -1.4281310     wt        wt sample4
sample5  3.161071  2.0684403     wt        wt sample5

If the issue was my data being formatted incorrectly, would the axis labels still show up as boxes? That would suggest to me it's a formatting issue with the graphics package that draws the text?

tjbencomo avatar Feb 23 '20 03:02 tjbencomo

Yeah I´m pretty sure it would still show up. Most likely it is. Haven´t had problems with the plotPCA in this pipeline, but I can´t really see how the issue would be cause by this repository rather than Deseq2 or ggplot (which is used to create the plot), since the code here is just a standard code for the plotPCA-function. You could as well try to open the .tsv and save it with standard encoding like UTF-8 and rerun (if you haven´t done already).

Jukre111 avatar Feb 23 '20 04:02 Jukre111

When you run the pipeline are you using both conda and singularity? After running some tests, it seems the error occurs when I run the pipeline with conda and singularity together (--use-conda --use-singularity) but not when I run the pipeline only with conda environments enabled (--use-conda).

This leads me to suspect that the singularity container may be missing a library needed to draw text. I've created a self contained repo here that reproduces the graph issue on a different dataset. The repo uses the same deseq2.yaml conda environment as this pipeline and the same singularity container. When I run the pipeline with --use-conda --use-singularity the graph shows the same issue but when run with only --use-conda the graph is formatted properly.

Do you know if it's possible to check the plots produced by the Travis CI tests using --use-conda --use-singularity to see if the issue occurs there as well?

tjbencomo avatar Feb 24 '20 07:02 tjbencomo

No I´ve been using --use-conda only, totally forgot about singularity. Yeah this could be the problem. I´d like to test it, but I don´t have to much time right now.

Do you know if it's possible to check the plots produced by the Travis CI tests using --use-conda --use-singularity to see if the issue occurs there as well?

I think the deploy option for the travis.yaml might be what you´re looking for. Travis Deployment

Jukre111 avatar Feb 24 '20 16:02 Jukre111

I posted about this issue on StackOverflow and adding mscorefonts to the conda environment fixes the issue and creates plots with normal text.

I've added mscorefonts to deseq2.yaml on my local machine and the updated conda environment builds without any issues. @johanneskoester would you be interested if I created a pull request with an updated deseq2.yaml that includes mscorefonts?

tjbencomo avatar Feb 26 '20 01:02 tjbencomo

Thanks for digging into this and providing the link to the StackOverflow question. This seems to be resolved for newer versions of r-base, especially those that pull in any version of pango >= 1.48 at build number >=1. With the recent update of the deseq2 version in deseq2.yaml, this should at least be pango >=1.50, so the fonts should always be there from now on.

dlaehnemann avatar Apr 12 '23 13:04 dlaehnemann