BioinformaticsFMRP / TCGAbiolinks

TCGAbiolinks
http://bioconductor.org/packages/devel/bioc/vignettes/TCGAbiolinks/inst/doc/index.html
286 stars 109 forks source link

No upregulated genes in TCGAvisualize_starburst plot and empty csv #567

Open genomics-kl opened 1 year ago

genomics-kl commented 1 year ago

I tested on v2.24.3, but I checked the code in d8ea98103154787e7cc268b67e0940629ae965f6 and the issue seems to remain though the format of the code has been changed slightly.

  1. Up-regulated genes regardless of methylation status are not colored in the starburst plot. See figure below.

image

This appears to be caused by the following portions of the TCGAvisualize_starburst function. For variables a, e and g, corresponding to genes with up-regulated expression, geFDR2 > exp.upperthr & logFC > logFC.cut is never true if logFC.cut = 0 because every value in logFC is negative after the geFDR2 > exp.upperthr filter.

a <- volcano %>% dplyr::filter(geFDR2 > exp.upperthr & logFC > 
                                 logFC.cut & meFDR2 < met.lowerthr & abs(!!as.name(diffcol)) > 
                                 diffmean.cut)
e <- volcano %>% dplyr::filter(geFDR2 > exp.upperthr & meFDR2 < 
                                 met.upperthr & meFDR2 > met.lowerthr & logFC > logFC.cut)
g <- volcano %>% dplyr::filter(geFDR2 > exp.upperthr & logFC > 
                                 logFC.cut & meFDR2 > met.upperthr & abs(!!as.name(diffcol)) > 
                                 diffmean.cut)
  1. The output csv file is always empty.

This appears to be caused by the following code, which filters volcano before writing to a csv file. 'geFDR' and 'meFDR' are all positive, so they will never be lower than the thresholds, which are negative. Should probably be filtering on 'geFDR2' and 'meFDR2'.

volcano <- dplyr::filter(volcano, volcano$geFDR <= exp.lowerthr & 
                           volcano$meFDR <= met.lowerthr)