How to superimpose barplots in karyotype graphic using the chromPlot Bioconductor package? I have a data frame containing 4 columns:


Chrom: chromosome name of the feature
Start: starting base of the feature 
End: end base of the feature
Name: name of the feature, e.g. 5S ribosomal RNA


The head of the data frame is shown below:

      Chrom    Start      End                        Name
    1     1 15390242 15390720 16S ribosomal RNA (partial)
    2     1 15390900 15391794 16S ribosomal RNA (partial)
    3     1 15392798 15396046           23S ribosomal RNA
    4     1 15397439 15397917 16S ribosomal RNA (partial)
    5     1 15398097 15398991 16S ribosomal RNA (partial)
    6     1 15399995 15403243           23S ribosomal RNA


I want to plot these features on the karyotype of C. elegans. I am using the chromPlot package from Bioconductor.

I am using the following code:


Subsetting the original data frame to get a data frame for each feature type: 5S, 16S and 23S rRNAs

annot1 &lt;- dplyr::filter(cel, Name == '5S ribosomal RNA')
annot2 &lt;- dplyr::filter(cel, Name == '23S ribosomal RNA')
annot3 &lt;- dplyr::filter(cel, Name == '16S ribosomal RNA (partial)')


and then plot:

chromPlot(gaps = cel, figCols = 2, annot1 = annot1, annot2 = annot2)




This is OK because the two features are far away in the genome. However, if I try:

chromPlot(gaps = cel_gap, figCols = 2, annot1 = annot1, annot2 = annot2,
          annot3 = annot3)




one of the features masks the other because they are close to each other in the genome. How can I make the green bar stack on top of the yellow one instead of covering it?
chromPlot(gaps = cel_gap, figCols = 2, annot1 = annot1, annot2 = annot3, annot3 = annot2,
          chrSide=c(1, 1, -1, 1, -1, 1, -1, 1))


The chrSide argument decides on which side the histogram goes, so it can be used to solve my problem. The bars are not stacked but the result is the same: more accurate visualisation. 

Thanks to Llopis for the guidance.