Hi,
I am trying to plot mutations from multiple individuals on the same track of circular plot.
I have GRanges object that looks like this:
GRanges object with 26 ranges and 4 metadata columns:
seqnames ranges strand | id var val buu
|
[1] 1 [32417, 32427] * | jcf7180000862659 A 1 32417
[2] 1 [58621, 58631] * | jcf7180000753913 B 1 58621
[3] 2 [25622, 25632] * | jcf7180000860774 C 1 25622
[4] 2 [44180, 44190] * | jcf7180001643718 D 1 44180
[5] 2 [66003, 66013] * | jcf7180001638671 E 1 66003
I would like to color mutations by var. I am able to plot them as points but not as rect.
cols <- RColorBrewer::brewer.pal(6,"Paired")
names(cols) <- c("A,"B","C","D", "E", "F")
p <- p + circle(lost, geom = "point", aes(fill=var, color=var, shape=0)) + scale_color_manual(values = cols) + scale_fill_manual(values = cols) + scale_shape_identity()
That works for geom point, but I would like geom rect. If I change geom to rect and use aes(fill=var, color=var), all lines are black. It looks like it does not accept the color assignment.
Also, does not work with autoplot(lost, layout="circle", aes(fill=var, color=var)),
layout_circle(lost, aes(fill=var, color=var))
But works with autoplot(lost, layout="karyogram", aes(fill=var, color=var)) and
layout_karyogram(lost, aes(fill=var, color=var))
Is that a bug by any chance or am I doing something wrong?
Best wishes,
Agnieszka
> sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252 LC_MONETARY=English_Australia.1252
[4] LC_NUMERIC=C LC_TIME=English_Australia.1252
attached base packages:
[1] stats4 parallel stats graphics grDevices utils datasets methods base
other attached packages:
[1] GenomicRanges_1.18.4 GenomeInfoDb_1.2.4 IRanges_2.0.1 S4Vectors_0.4.0 ggbio_1.14.0
[6] BiocGenerics_0.12.1 ggplot2_1.0.0
loaded via a namespace (and not attached):
[1] acepack_1.3-3.3 AnnotationDbi_1.28.1 base64enc_0.1-2 BatchJobs_1.5
[5] BBmisc_1.9 Biobase_2.26.0 BiocParallel_1.0.3 biomaRt_2.22.0
[9] Biostrings_2.34.1 biovizBase_1.14.1 bitops_1.0-6 brew_1.0-6
[13] BSgenome_1.34.1 checkmate_1.5.1 cluster_1.15.3 codetools_0.2-9
[17] colorspace_1.2-4 DBI_0.3.1 dichromat_2.0-0 digest_0.6.8
[21] fail_1.2 foreach_1.4.2 foreign_0.8-61 Formula_1.2-0
[25] GenomicAlignments_1.2.1 GenomicFeatures_1.18.3 GGally_0.5.0 graph_1.44.1
[29] grid_3.1.2 gridExtra_0.9.1 gtable_0.1.2 Hmisc_3.15-0
[33] iterators_1.0.7 labeling_0.3 lattice_0.20-29 latticeExtra_0.6-26
[37] MASS_7.3-35 munsell_0.4.2 nnet_7.3-8 OrganismDbi_1.8.0
[41] plyr_1.8.1 proto_0.3-10 RBGL_1.42.0 RColorBrewer_1.1-2
[45] Rcpp_0.11.4 RCurl_1.95-4.5 reshape_0.8.5 reshape2_1.4.1
[49] rpart_4.1-8 Rsamtools_1.18.2 RSQLite_1.0.0 rtracklayer_1.26.2
[53] scales_0.2.4 sendmailR_1.2-1 splines_3.1.2 stringr_0.6.2
[57] survival_2.37-7 tools_3.1.2 VariantAnnotation_1.12.9 XML_3.98-1.1
[61] XVector_0.6.0 zlibbioc_1.12.0
>