YuLab-SMU / ChIPseeker

:dart: ChIP peak Annotation, Comparison and Visualization
https://onlinelibrary.wiley.com/share/author/GYJGUBYCTRMYJFN2JFZZ?target=10.1002/cpz1.585
224 stars 74 forks source link

Change color scheme #151

Closed MingLi-929 closed 3 years ago

MingLi-929 commented 3 years ago

This pull request is to change color scheme of plotAnnoBar(). The issues are mentioned in https://github.com/YuLab-SMU/ChIPseeker/issues/83#issuecomment-481520275 and https://github.com/YuLab-SMU/ChIPseeker/issues/83#issuecomment-848871641. Using different kinds of txdb files will return different amount of categories. for example:

library(ChIPseeker)
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
library(TxDb.Hsapiens.UCSC.hg38.knownGene)

txdb = TxDb.Hsapiens.UCSC.hg19.knownGene
txdb1=TxDb.Hsapiens.UCSC.hg38.knownGene

files <- getSampleFiles()

peakAnnoList1 <- lapply(files, annotatePeak, 
                       TxDb=txdb1,tssRegion=c(-3000, 3000))
peakAnnoList <- lapply(files, annotatePeak, 
                        TxDb=txdb,tssRegion=c(-3000, 3000))

## get the first barplot with TxDb.Hsapiens.UCSC.hg19.knownGene
plotAnnoBar(peakAnnoList)

1

## get the second barplot with TxDb.Hsapiens.UCSC.hg38.knownGene
plotAnnoBar(peakAnnoList1)

3

using different kinds of txdb files will return different amounts of categories which will lead to different color scheme.

This update is to simply change the color scheme which may sacrifice the diversity of color. But since the color is immoblized we can see the difference between different txdb files annotating the same peaks.

## using new color scheme to get the first barplot
plotAnnoBar(peakAnnoList)

change_hg19

## using new color scheme to get the second barplot
plotAnnoBar(peakAnnoList1)

change_hg38

As it shown, we can clearly see the difference between txdb files.

vlad-md commented 2 years ago

Hey. I have updated from github source. It did in fact change the color scheme, however it is still inconsistent between different annotation lists. image image