This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Software/R package to plot thousands of stacked bars in a barplot (each bar=allele frequencies of one site)?

Hello,

the title is pretty much the whole question.

I have identified potential selective sweep regions and I want to plot the allele frequencies of each site in this region using a stacked barplot (or something that looks like one). The regions contain 20-30 thousand sites, so I need to plot many bars. I tried R's standard barplot function and ggplot2 but there are so many bars that everything is just black.

I wonder if anyone knows a way to make such a plot. Best would be a R solution, but I'm also open for another software or python (although I just started to learn python, so R would be better).

Thank in advance.

r

Another option is to make your data in a form that can be rendered as a "stacked" or overlay view of Wiggle data in a UCSC Genome Browser, where scores are frequencies. This blog post goes into more detail about this view type: http://blog.openhelix.eu/?p=19029

1 answer

1) You could do something similar to a manhattan plot, used for GWAS data. On the X you plot the position, on the Y you plot the allele frequency 2) You could work in windows, and plot the average MAF in a window of X Kb ofr Y SNPs.

Log in to answer this question.