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

plotAnnoBar in 0.14.0 not respecting sort order of list? #73

Closed
endrebak opened this issue Feb 20, 2018 · 1 comment
Closed

plotAnnoBar in 0.14.0 not respecting sort order of list? #73

endrebak opened this issue Feb 20, 2018 · 1 comment

Comments

@endrebak
Copy link

Sorry for not using 0.14.1, but I have trouble installing it. If this is fixed in 0.14.1 feel free to close.

I have the following script, which creates a plotAnnoBar for multiple files:

library(ChIPseeker)
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene

files = getSampleFiles()
sort_order = rev(names(files))
# [1] "CBX7_BF"    "CBX6_BF"    "ARmo_100nM" "ARmo_1nM"   "ARmo_0M"
sorted_files = files[sort_order]

peakAnnoList <- lapply(sorted_files, annotatePeak, TxDb=txdb, tssRegion=c(-500, 500), verbose=FALSE)

pdf("not_desired_order.pdf")
plotAnnoBar(peakAnnoList)
dev.off()

This gives the plot:

screen shot 2018-02-20 at 09 46 52

There you see that the sort order of the list is not respected. For that example it might not matter much, but for my original graph it matters a lot:

I want the sort order to be:

 [1] "H3K4me3_0h"              "H3K4me3_3h"
 [3] "H3K4me3_6h"              "H3K4me3_9h"
 [5] "H3K4me3_12h"             "H3K4me3_15h"
 [7] "H3K4me3_18h"             "H3K4me3_21h"
 [9] "H3K4me3_24h"             "H3K4me3_Unsynchronized"
[11] "H3K27me3_0h"             "H3K27me3_3h"
[13] "H3K27me3_6h"             "H3K27me3_9h"
[15] "H3K27me3_12h"            "H3K27me3_15h"
[17] "H3K27me3_18h"            "H3K27me3_21h"
[19] "H3K27me3_24h"            "H3K27me3_Unsynchronized"
[21] "PolII_0h"                "PolII_3h"
[23] "PolII_6h"                "PolII_9h"
[25] "PolII_12h"               "PolII_15h"
[27] "PolII_18h"               "PolII_21h"
[29] "PolII_24h"               "PolII_Unsynchronized"

but it is

screen shot 2018-02-20 at 09 47 19

I think the reviewers will complain about that sort order, so I would really appreciate if you could fix this :)

Thanks again for ChIPseeker by the way. I love it!

@GuangchuangYu
Copy link
Member

v >= 1.14.2 will keep the order of input files.

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

No branches or pull requests

2 participants