Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make labCol order consistent with selectLabs #108

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

TianyiShi2001
Copy link

@TianyiShi2001 TianyiShi2001 commented Dec 13, 2022

Currently, when we have selectLab and labCol with multiple values, the order of the colors is not consistent with selectLab. An example (extended from the first example in the vignette):

library('DESeq2')
library(EnhancedVolcano)
library(airway)
data(airway)

dds <- DESeqDataSet(airway, design = ~ cell + dex)
dds <- DESeq(dds, betaPrior=FALSE)
res <- results(dds,
               contrast = c('dex','trt','untrt'))
res <- lfcShrink(dds,
                 contrast = c('dex','trt','untrt'), res=res, type = 'normal')

EnhancedVolcano(res,
                lab = rownames(res),
                x = 'log2FoldChange',
                y = 'pvalue', selectLab = c('ENSG00000125148', 'ENSG00000000419'),
                labCol = c('brown', 'gray'))

スクリーンショット 2022-12-13 14 57 00

This PR resolves this issue by reordering the toptable subset according to the order of selectLab before plotting the labels.

Also I did some refactoring to minimize repetitions.

by reordering the toptable subset according to the order of selectLab, when labCol has multiple values, its order is now consistent with selectLab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant