omarwagih/ggseqlogo

Change numbers on the x-axis of logos

maximus-sci opened this issue · 3 comments

I'm trying to plot some sequences upstream of a start codon. The more intuitive way to number these sequences would be starting from -10 on the left ending at -1 on the right side.

Is there any way to get this packages to accept a vector specifying custom numbering below the logos?

Thanks for responding and for the link. I tried:

ggseqlogo(upstreamSeqList) +
scale_x_discrete(labels = seq(from = -10,to = -1, by = 1))

and also tried coercing the labels to a character vector. In both cases the numbers just disappear from the plots entirely. And I get the message:

Scale for 'x' is already present. Adding another scale for 'x', which will replace the existing scale.

From that error I'd expect to see the new labels appear, but instead I get no labels at all...so I was thinking that the scale was being set some other way inside the ggseqlogo function.

Assuming p is the ggplot2 object plotted with ggseqlogo:

p$scales$scales[[1]]$labels <- new_labels