TrackViewer Change Color of Lollipops in Lolliplot
0
0
Entering edit mode
4.6 years ago
j.lunger18 ▴ 30

I'm trying to make a lollipop chart to show variants on a gene of interest. I have gotten so far as plotting them along the coding regions, and coloring the features of the gene, but I am having trouble coloring the lollipops to indicate the type of mutation (missense, synonymous, etc.). I made a new column called "snpEff_ann_colors" in my data.frame that lists the color and associates it with the type of mutation:

> Gene_exonic_SNPs$snpEff_ann_colors

[1] aquamarine       azure            darkseagreen1    darkseagreen1    azure           
  [6] azure            darkseagreen1    azure            azure            darkseagreen1   
 [11] azure            azure            darkseagreen1    darkseagreen1    darkseagreen1

I then did:

gene.gr$color <- Gene_exonic_SNPs$snpEff_ann_colors

When I plotted, the colors were not correct:

lolliplotgene.gr, domains, ranges = GRanges("chrX", IRanges(1, 239)))

I noticed that they did this differently in TrackViewer documentation:

sample.gr$color <- sample.int(6, length(SNP), replace=TRUE)

When I did the same in my console, when I print sample.gr$color, it is a list of numbers... However, I would like to have mine be the list that I give it... is there a way to do this?

TrackViewer R • 1.4k views
ADD COMMENT
0
Entering edit mode

Did you tried to change your color into character but not factor? You may also try to convert it into hex color.

ADD REPLY
0
Entering edit mode

You're asking a follow up question, not answering the top level question. Please use Add Comment, not Add Answer.

ADD REPLY
0
Entering edit mode

Hi! I stuck with the same problem. Have u figured out yet how to set the color for lollipop node?

ADD REPLY

Login before adding your answer.

Traffic: 1599 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6