I was wondering whether there is a way in R to plot the genes in a genomic region in the same plot as a previously created regional Manhattan plot, in the way LocusZoom does, but I would like to create my own Manhattan plots above and then just add the gene plots. I have also been looking at GenomeGraphs but it doesn't seem like I can add the plots below my own plots, but maybe I am missing something.
For example I have this regional plot of a chromosome, say chr 1 (This is all made up data)
pval<-runif(6000, 0, 1) logPval<--log(pval,base=10) pos=1:6000 rsID<-paste("rs",1:6000,sep="") data<-as.data.frame(cbind(pos,rsID,pval,logPval)) plot(x=as.numeric(data$pos),y=as.numeric(as.character(data$logPval)))
And I would like to add at the bottom boxplots showing the genomic position of the following genes, so showing the range these genes span and the names of these genes on top of their non-overlapping boxes (just like in LocusZoom):
genes <- c( "NFIA", "KANK4", "DOCK7", "L1TD1") gene.start<- c(4, 350, 1000, 2100) gene.end<- c(3004, 3350, 4000, 5010) genes.pos<- as.data.frame(cbind(genes, gene.start, gene.end))
Any help or suggestions are greatly appreciated!
Thank you! Fra