Introduction

The goal here is to make some nice coverage plots.

library("rtracklayer")
library("AnnotationHub")
library("Rsamtools")
library("ensembldb")
ah <- AnnotationHub()
## snapshotDate(): 2020-04-27
query(ah, "EnsDb.Mmusculus.v98")
## AnnotationHub with 1 record
## # snapshotDate(): 2020-04-27
## # names(): AH75036
## # $dataprovider: Ensembl
## # $species: Mus musculus
## # $rdataclass: EnsDb
## # $rdatadateadded: 2019-05-02
## # $title: Ensembl 98 EnsDb for Mus musculus
## # $description: Gene and protein annotations for Mus musculus based on Ensem...
## # $taxonomyid: 10090
## # $genome: GRCm38
## # $sourcetype: ensembl
## # $sourceurl: http://www.ensembl.org
## # $sourcesize: NA
## # $tags: c("98", "AHEnsDbs", "Annotation", "EnsDb", "Ensembl", "Gene",
## #   "Protein", "Transcript") 
## # retrieve record with 'object[["AH75036"]]'
edb <- ah[["AH75036"]]
## loading from cache
myexons <- exons(edb,columns="symbol")
mygenes <- genes(edb,columns="symbol")

Here are some functions. Fillplot is a nice way to turn line graphs into filled plots. Mysubset extracts bedgraph data to a plottabl format.

# fillplot
fillplot <- function(x,y,...) {
plot(x,y,bty="n",...)
xx <- c(x, rev(x))
yy <- c(rep(0, length(x)), rev(y))
polygon(xx, yy,border=NA,...)
}

# subset granges to a plottable format
mysubset <- function(bdg,q){
  ol <- subsetByOverlaps(bdg,q)
  ol <- as.data.frame(ol)
  ol <- t(matrix((apply(ol,1,function(x) {
      x1<-x[c(1,2,6,1,3,6)]  
    } )),nrow=3))
  ol <- as.data.frame(ol)
  colnames(ol) <- c("chr","pos","score")
  ol$pos <- as.integer(ol$pos)
  ol$score <- as.integer(ol$score)
  ol
}

exonlines <- function(gr){
  gr<-exon_roi
  gr <- as.data.frame(gr)
  gr$score <- 0
  gr <- t(matrix((apply(gr,1,function(x) {
      x1<-x[c(1,2,8,1,3,8)]
    } )),nrow=3))
  gr <- as.data.frame(gr)
  colnames(gr) <- c("chr","pos","score")
  gr$pos <- as.integer(gr$pos)
  gr$score <- as.integer(gr$score)
  head(gr)
}

Library size normalisation

counts <- read.table("kevinwatt_YAP_gnames_filt.mx",row.names=1,header=TRUE)
counts <- colSums(counts)

Here I'm loading bedgraph from MACS2 callpeak. These bedgraph files were compressd with bgzip and indexed with tabix.

bdgc1 <- rtracklayer::import("Control_01_C81U4ANXX_CAGATC_L007_R1.fastq.STAR.bam.bdg.gz", format="bedGraph")
bdgc2 <- rtracklayer::import("Control_02_C81U4ANXX_GATCAG_L007_R1.fastq.STAR.bam.bdg.gz", format="bedGraph")
bdgc3 <- rtracklayer::import("Control_03_C81U4ANXX_GGCTAC_L007_R1.fastq.STAR.bam.bdg.gz", format="bedGraph")
bdgy1 <- rtracklayer::import("YAP_01_C81U4ANXX_ACTTGA_L007_R1.fastq.STAR.bam.bdg.gz", format="bedGraph")
bdgy2 <- rtracklayer::import("YAP_02_C81U4ANXX_TAGCTT_L007_R1.fastq.STAR.bam.bdg.gz", format="bedGraph")
bdgy3 <- rtracklayer::import("YAP_03_C81U4ANXX_CTTGTA_L007_R1.fastq.STAR.bam.bdg.gz", format="bedGraph")

Yap1

myname="Yap1"

reg1 <- mygenes[which(mygenes$symbol==myname),]

olc1 <- mysubset(bdgc1,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': JH584301.1, GL456379.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456378.1, GL456389.1, GL456370.1, GL456382.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456381.1, GL456385.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
olc1$score <- olc1$score/counts[1]*1e6

olc2 <- mysubset(bdgc2,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': JH584301.1, JH584300.1, JH584302.1, GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456389.1, GL456370.1, GL456390.1, GL456394.1, GL456392.1, GL456382.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456239.1, GL456381.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
olc2$score <- olc2$score/counts[2]*1e6

olc3 <- mysubset(bdgc3,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': GL456379.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456370.1, GL456390.1, GL456382.1, GL456359.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456239.1, GL456381.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
olc3$score <- olc3$score/counts[3]*1e6

oly1 <- mysubset(bdgy1,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456370.1, GL456394.1, GL456392.1, GL456382.1, GL456359.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456219.1, GL456381.1, GL456385.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
oly1$score <- oly1$score/counts[4]*1e6

oly2 <- mysubset(bdgy2,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456389.1, GL456370.1, GL456390.1, GL456392.1, GL456382.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456381.1, GL456385.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
oly2$score <- oly2$score/counts[5]*1e6

oly3 <- mysubset(bdgy3,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': JH584301.1, JH584302.1, GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456389.1, GL456370.1, GL456390.1, GL456382.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456219.1, GL456239.1, GL456381.1, JH584292.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
oly3$score <- oly3$score/counts[6]*1e6

exon_roi <- myexons[which(myexons$symbol==myname),]

XMIN=min(start(exon_roi))-500
XMAX=max(end(exon_roi))+500
YMAX=max( max(olc1$score), max(olc2$score), max(olc3$score), max(oly1$score), max(oly2$score),max(oly3$score) )
YMIN=0
YMINUS=YMAX/10*-1

par(mfrow=c(6,1))
par(mar=c(2,4,1,1))

df <- as.data.frame(exon_roi)
myrect <- function(df){
  apply(df,1,function(x) {
    start <- x[2]
    end <- x[3]
    rect(start, YMINUS, end,0,col="gray",lwd=2)
  })
}

fillplot(olc1$pos,olc1$score,type="l",xlab="chr",ylab="C1",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="blue",xaxt='n'); grid() ; myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(olc2$pos,olc2$score,type="l",xlab="chr",ylab="C2",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="blue",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(olc3$pos,olc3$score,type="l",xlab="chr",ylab="C3",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="blue",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(oly1$pos,oly1$score,type="l",xlab="chr",ylab="Y1",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="red",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(oly2$pos,oly2$score,type="l",xlab="chr",ylab="Y2",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="red",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(oly3$pos,oly3$score,type="l",xlab="chr",ylab="Y3",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="red"); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
mtext(myname)

Amotl2

myname="Amotl2"

reg1 <- mygenes[which(mygenes$symbol==myname),]

olc1 <- mysubset(bdgc1,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': JH584301.1, GL456379.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456378.1, GL456389.1, GL456370.1, GL456382.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456381.1, GL456385.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
olc1$score <- olc1$score/counts[1]*1e6

olc2 <- mysubset(bdgc2,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': JH584301.1, JH584300.1, JH584302.1, GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456389.1, GL456370.1, GL456390.1, GL456394.1, GL456392.1, GL456382.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456239.1, GL456381.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
olc2$score <- olc2$score/counts[2]*1e6

olc3 <- mysubset(bdgc3,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': GL456379.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456370.1, GL456390.1, GL456382.1, GL456359.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456239.1, GL456381.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
olc3$score <- olc3$score/counts[3]*1e6

oly1 <- mysubset(bdgy1,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456370.1, GL456394.1, GL456392.1, GL456382.1, GL456359.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456219.1, GL456381.1, GL456385.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
oly1$score <- oly1$score/counts[4]*1e6

oly2 <- mysubset(bdgy2,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456389.1, GL456370.1, GL456390.1, GL456392.1, GL456382.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456381.1, GL456385.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
oly2$score <- oly2$score/counts[5]*1e6

oly3 <- mysubset(bdgy3,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': JH584301.1, JH584302.1, GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456389.1, GL456370.1, GL456390.1, GL456382.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456219.1, GL456239.1, GL456381.1, JH584292.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
oly3$score <- oly3$score/counts[6]*1e6

exon_roi <- myexons[which(myexons$symbol==myname),]

XMIN=min(start(exon_roi))-500
XMAX=max(end(exon_roi))+500
YMAX=max( max(olc1$score), max(olc2$score), max(olc3$score), max(oly1$score), max(oly2$score),max(oly3$score) )
YMIN=0
YMINUS=YMAX/10*-1

par(mfrow=c(6,1))
par(mar=c(2,4,1,1))

df <- as.data.frame(exon_roi)
myrect <- function(df){
  apply(df,1,function(x) {
    start <- x[2]
    end <- x[3]
    rect(start, YMINUS, end,0,col="gray",lwd=2)
  })
}

fillplot(olc1$pos,olc1$score,type="l",xlab="chr",ylab="C1",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="blue",xaxt='n'); grid() ; myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(olc2$pos,olc2$score,type="l",xlab="chr",ylab="C2",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="blue",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(olc3$pos,olc3$score,type="l",xlab="chr",ylab="C3",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="blue",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(oly1$pos,oly1$score,type="l",xlab="chr",ylab="Y1",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="red",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(oly2$pos,oly2$score,type="l",xlab="chr",ylab="Y2",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="red",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(oly3$pos,oly3$score,type="l",xlab="chr",ylab="Y3",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="red"); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
mtext(myname)

Glul

myname="Glul"

reg1 <- mygenes[which(mygenes$symbol==myname),]

olc1 <- mysubset(bdgc1,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': JH584301.1, GL456379.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456378.1, GL456389.1, GL456370.1, GL456382.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456381.1, GL456385.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
olc1$score <- olc1$score/counts[1]*1e6

olc2 <- mysubset(bdgc2,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': JH584301.1, JH584300.1, JH584302.1, GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456389.1, GL456370.1, GL456390.1, GL456394.1, GL456392.1, GL456382.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456239.1, GL456381.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
olc2$score <- olc2$score/counts[2]*1e6

olc3 <- mysubset(bdgc3,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': GL456379.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456370.1, GL456390.1, GL456382.1, GL456359.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456239.1, GL456381.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
olc3$score <- olc3$score/counts[3]*1e6

oly1 <- mysubset(bdgy1,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456370.1, GL456394.1, GL456392.1, GL456382.1, GL456359.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456219.1, GL456381.1, GL456385.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
oly1$score <- oly1$score/counts[4]*1e6

oly2 <- mysubset(bdgy2,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456389.1, GL456370.1, GL456390.1, GL456392.1, GL456382.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456381.1, GL456385.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
oly2$score <- oly2$score/counts[5]*1e6

oly3 <- mysubset(bdgy3,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': JH584301.1, JH584302.1, GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456389.1, GL456370.1, GL456390.1, GL456382.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456219.1, GL456239.1, GL456381.1, JH584292.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
oly3$score <- oly3$score/counts[6]*1e6

exon_roi <- myexons[which(myexons$symbol==myname),]

XMIN=min(start(exon_roi))-500
XMAX=max(end(exon_roi))+500
YMAX=max( max(olc1$score), max(olc2$score), max(olc3$score), max(oly1$score), max(oly2$score),max(oly3$score) )
YMIN=0
YMINUS=YMAX/10*-1

par(mfrow=c(6,1))
par(mar=c(2,4,1,1))

df <- as.data.frame(exon_roi)
myrect <- function(df){
  apply(df,1,function(x) {
    start <- x[2]
    end <- x[3]
    rect(start, YMINUS, end,0,col="gray",lwd=2)
  })
}

fillplot(olc1$pos,olc1$score,type="l",xlab="chr",ylab="C1",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="blue",xaxt='n'); grid() ; myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(olc2$pos,olc2$score,type="l",xlab="chr",ylab="C2",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="blue",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(olc3$pos,olc3$score,type="l",xlab="chr",ylab="C3",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="blue",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(oly1$pos,oly1$score,type="l",xlab="chr",ylab="Y1",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="red",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(oly2$pos,oly2$score,type="l",xlab="chr",ylab="Y2",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="red",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(oly3$pos,oly3$score,type="l",xlab="chr",ylab="Y3",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="red"); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
mtext(myname)

Rrad

I want to throw this one is as a sanity check, this is #3 in the DEG list so it should look like an obvious change.

myname="Rrad"
reg1 <- mygenes[which(mygenes$symbol==myname),]

olc1 <- mysubset(bdgc1,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': JH584301.1, GL456379.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456378.1, GL456389.1, GL456370.1, GL456382.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456381.1, GL456385.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
olc1$score <- olc1$score/counts[1]*1e6

olc2 <- mysubset(bdgc2,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': JH584301.1, JH584300.1, JH584302.1, GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456389.1, GL456370.1, GL456390.1, GL456394.1, GL456392.1, GL456382.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456239.1, GL456381.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
olc2$score <- olc2$score/counts[2]*1e6

olc3 <- mysubset(bdgc3,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': GL456379.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456370.1, GL456390.1, GL456382.1, GL456359.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456239.1, GL456381.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
olc3$score <- olc3$score/counts[3]*1e6

oly1 <- mysubset(bdgy1,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456370.1, GL456394.1, GL456392.1, GL456382.1, GL456359.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456219.1, GL456381.1, GL456385.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
oly1$score <- oly1$score/counts[4]*1e6

oly2 <- mysubset(bdgy2,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456389.1, GL456370.1, GL456390.1, GL456392.1, GL456382.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456381.1, GL456385.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
oly2$score <- oly2$score/counts[5]*1e6

oly3 <- mysubset(bdgy3,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': JH584301.1, JH584302.1, GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456389.1, GL456370.1, GL456390.1, GL456382.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456219.1, GL456239.1, GL456381.1, JH584292.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
oly3$score <- oly3$score/counts[6]*1e6

exon_roi <- myexons[which(myexons$symbol==myname),]

XMIN=min(start(exon_roi))-500
XMAX=max(end(exon_roi))+500
YMAX=max( max(olc1$score), max(olc2$score), max(olc3$score), max(oly1$score), max(oly2$score),max(oly3$score) )
YMIN=0
YMINUS=YMAX/10*-1

par(mfrow=c(6,1))
par(mar=c(2,4,1,1))

df <- as.data.frame(exon_roi)
myrect <- function(df){
  apply(df,1,function(x) {
    start <- x[2]
    end <- x[3]
    rect(start, YMINUS, end,0,col="gray",lwd=2)
  })
}

fillplot(olc1$pos,olc1$score,type="l",xlab="chr",ylab="C1",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="blue",xaxt='n'); grid() ; myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(olc2$pos,olc2$score,type="l",xlab="chr",ylab="C2",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="blue",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(olc3$pos,olc3$score,type="l",xlab="chr",ylab="C3",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="blue",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(oly1$pos,oly1$score,type="l",xlab="chr",ylab="Y1",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="red",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(oly2$pos,oly2$score,type="l",xlab="chr",ylab="Y2",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="red",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(oly3$pos,oly3$score,type="l",xlab="chr",ylab="Y3",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="red"); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
mtext(myname)

Dkk3

I want to throw this one is as a sanity check, this is #3 in the DEG list so it should look like an obvious change.

myname="Dkk3"
reg1 <- mygenes[which(mygenes$symbol==myname),]

olc1 <- mysubset(bdgc1,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': JH584301.1, GL456379.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456378.1, GL456389.1, GL456370.1, GL456382.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456381.1, GL456385.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
olc1$score <- olc1$score/counts[1]*1e6

olc2 <- mysubset(bdgc2,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': JH584301.1, JH584300.1, JH584302.1, GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456389.1, GL456370.1, GL456390.1, GL456394.1, GL456392.1, GL456382.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456239.1, GL456381.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
olc2$score <- olc2$score/counts[2]*1e6

olc3 <- mysubset(bdgc3,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': GL456379.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456370.1, GL456390.1, GL456382.1, GL456359.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456239.1, GL456381.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
olc3$score <- olc3$score/counts[3]*1e6

oly1 <- mysubset(bdgy1,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456370.1, GL456394.1, GL456392.1, GL456382.1, GL456359.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456219.1, GL456381.1, GL456385.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
oly1$score <- oly1$score/counts[4]*1e6

oly2 <- mysubset(bdgy2,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456389.1, GL456370.1, GL456390.1, GL456392.1, GL456382.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456381.1, GL456385.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
oly2$score <- oly2$score/counts[5]*1e6

oly3 <- mysubset(bdgy3,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': JH584301.1, JH584302.1, GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456389.1, GL456370.1, GL456390.1, GL456382.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456219.1, GL456239.1, GL456381.1, JH584292.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
oly3$score <- oly3$score/counts[6]*1e6

exon_roi <- myexons[which(myexons$symbol==myname),]

XMIN=min(start(exon_roi))-500
XMAX=max(end(exon_roi))+500
YMAX=max( max(olc1$score), max(olc2$score), max(olc3$score), max(oly1$score), max(oly2$score),max(oly3$score) )
YMIN=0
YMINUS=YMAX/10*-1

par(mfrow=c(6,1))
par(mar=c(2,4,1,1))

df <- as.data.frame(exon_roi)
myrect <- function(df){
  apply(df,1,function(x) {
    start <- x[2]
    end <- x[3]
    rect(start, YMINUS, end,0,col="gray",lwd=2)
  })
}

fillplot(olc1$pos,olc1$score,type="l",xlab="chr",ylab="C1",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="blue",xaxt='n'); grid() ; myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(olc2$pos,olc2$score,type="l",xlab="chr",ylab="C2",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="blue",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(olc3$pos,olc3$score,type="l",xlab="chr",ylab="C3",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="blue",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(oly1$pos,oly1$score,type="l",xlab="chr",ylab="Y1",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="red",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(oly2$pos,oly2$score,type="l",xlab="chr",ylab="Y2",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="red",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(oly3$pos,oly3$score,type="l",xlab="chr",ylab="Y3",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="red"); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
mtext(myname)

Gpt2

myname="Gpt2"
reg1 <- mygenes[which(mygenes$symbol==myname),]

olc1 <- mysubset(bdgc1,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': JH584301.1, GL456379.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456378.1, GL456389.1, GL456370.1, GL456382.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456381.1, GL456385.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
olc1$score <- olc1$score/counts[1]*1e6

olc2 <- mysubset(bdgc2,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': JH584301.1, JH584300.1, JH584302.1, GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456389.1, GL456370.1, GL456390.1, GL456394.1, GL456392.1, GL456382.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456239.1, GL456381.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
olc2$score <- olc2$score/counts[2]*1e6

olc3 <- mysubset(bdgc3,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': GL456379.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456370.1, GL456390.1, GL456382.1, GL456359.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456239.1, GL456381.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
olc3$score <- olc3$score/counts[3]*1e6

oly1 <- mysubset(bdgy1,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456370.1, GL456394.1, GL456392.1, GL456382.1, GL456359.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456219.1, GL456381.1, GL456385.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
oly1$score <- oly1$score/counts[4]*1e6

oly2 <- mysubset(bdgy2,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456389.1, GL456370.1, GL456390.1, GL456392.1, GL456382.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456381.1, GL456385.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
oly2$score <- oly2$score/counts[5]*1e6

oly3 <- mysubset(bdgy3,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': JH584301.1, JH584302.1, GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456389.1, GL456370.1, GL456390.1, GL456382.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456219.1, GL456239.1, GL456381.1, JH584292.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
oly3$score <- oly3$score/counts[6]*1e6

exon_roi <- myexons[which(myexons$symbol==myname),]

XMIN=min(start(exon_roi))-500
XMAX=max(end(exon_roi))+500
YMAX=max( max(olc1$score), max(olc2$score), max(olc3$score), max(oly1$score), max(oly2$score),max(oly3$score) )
YMIN=0
YMINUS=YMAX/10*-1

par(mfrow=c(6,1))
par(mar=c(2,4,1,1))

df <- as.data.frame(exon_roi)
myrect <- function(df){
  apply(df,1,function(x) {
    start <- x[2]
    end <- x[3]
    rect(start, YMINUS, end,0,col="gray",lwd=2)
  })
}

fillplot(olc1$pos,olc1$score,type="l",xlab="chr",ylab="C1",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="blue",xaxt='n'); grid() ; myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(olc2$pos,olc2$score,type="l",xlab="chr",ylab="C2",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="blue",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(olc3$pos,olc3$score,type="l",xlab="chr",ylab="C3",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="blue",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(oly1$pos,oly1$score,type="l",xlab="chr",ylab="Y1",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="red",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(oly2$pos,oly2$score,type="l",xlab="chr",ylab="Y2",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="red",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(oly3$pos,oly3$score,type="l",xlab="chr",ylab="Y3",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="red"); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
mtext(myname)

Idh2

myname="Idh2"
reg1 <- mygenes[which(mygenes$symbol==myname),]

olc1 <- mysubset(bdgc1,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': JH584301.1, GL456379.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456378.1, GL456389.1, GL456370.1, GL456382.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456381.1, GL456385.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
olc1$score <- olc1$score/counts[1]*1e6

olc2 <- mysubset(bdgc2,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': JH584301.1, JH584300.1, JH584302.1, GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456389.1, GL456370.1, GL456390.1, GL456394.1, GL456392.1, GL456382.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456239.1, GL456381.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
olc2$score <- olc2$score/counts[2]*1e6

olc3 <- mysubset(bdgc3,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': GL456379.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456370.1, GL456390.1, GL456382.1, GL456359.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456239.1, GL456381.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
olc3$score <- olc3$score/counts[3]*1e6

oly1 <- mysubset(bdgy1,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456370.1, GL456394.1, GL456392.1, GL456382.1, GL456359.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456219.1, GL456381.1, GL456385.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
oly1$score <- oly1$score/counts[4]*1e6

oly2 <- mysubset(bdgy2,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456389.1, GL456370.1, GL456390.1, GL456392.1, GL456382.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456381.1, GL456385.1, JH584292.1, JH584303.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
oly2$score <- oly2$score/counts[5]*1e6

oly3 <- mysubset(bdgy3,reg1)
## Warning in .Seqinfo.mergexy(x, y): Each of the 2 combined objects has sequence levels not in the other:
##   - in 'x': JH584301.1, JH584302.1, GL456379.1, GL456393.1, GL456366.1, GL456367.1, GL456213.1, GL456383.1, GL456360.1, GL456378.1, GL456389.1, GL456370.1, GL456390.1, GL456382.1, GL456396.1, GL456368.1
##   - in 'y': CHR_CAST_EI_MMCHR11_CTG4, CHR_CAST_EI_MMCHR11_CTG5, CHR_MG104_PATCH, CHR_MG117_PATCH, CHR_MG132_PATCH, CHR_MG153_PATCH, CHR_MG171_PATCH, CHR_MG184_PATCH, CHR_MG190_MG3751_PATCH, CHR_MG191_PATCH, CHR_MG209_PATCH, CHR_MG3172_PATCH, CHR_MG3231_PATCH, CHR_MG3251_PATCH, CHR_MG3490_PATCH, CHR_MG3496_PATCH, CHR_MG3530_PATCH, CHR_MG3561_PATCH, CHR_MG3562_PATCH, CHR_MG3609_PATCH, CHR_MG3618_PATCH, CHR_MG3627_PATCH, CHR_MG3648_PATCH, CHR_MG3656_PATCH, CHR_MG3683_PATCH, CHR_MG3686_PATCH, CHR_MG3699_PATCH, CHR_MG3700_PATCH, CHR_MG3712_PATCH, CHR_MG3714_PATCH, CHR_MG3829_PATCH, CHR_MG3833_MG4220_PATCH, CHR_MG3835_PATCH, CHR_MG3836_PATCH, CHR_MG3999_PATCH, CHR_MG4136_PATCH, CHR_MG4138_PATCH, CHR_MG4151_PATCH, CHR_MG4162_PATCH, CHR_MG4180_PATCH, CHR_MG4198_PATCH, CHR_MG4200_PATCH, CHR_MG4209_PATCH, CHR_MG4211_PATCH, CHR_MG4212_PATCH, CHR_MG4213_PATCH, CHR_MG4214_PATCH, CHR_MG4222_MG3908_PATCH, CHR_MG4243_PATCH, CHR_MG4248_PATCH, CHR_MG4249_PATCH, CHR_MG4254_PATCH, CHR_MG4255_PATCH, CHR_MG4259_PATCH, CHR_MG4261_PATCH, CHR_MG4264_PATCH, CHR_MG4265_PATCH, CHR_MG4266_PATCH, CHR_MG4281_PATCH, CHR_MG4288_PATCH, CHR_MG4308_PATCH, CHR_MG4310_MG4311_PATCH, CHR_MG51_PATCH, CHR_MG65_PATCH, CHR_MG74_PATCH, CHR_MG89_PATCH, CHR_MMCHR1_CHORI29_IDD5_1, CHR_PWK_PHJ_MMCHR11_CTG1, CHR_PWK_PHJ_MMCHR11_CTG2, CHR_PWK_PHJ_MMCHR11_CTG3, CHR_WSB_EIJ_MMCHR11_CTG1, CHR_WSB_EIJ_MMCHR11_CTG2, CHR_WSB_EIJ_MMCHR11_CTG3, GL456219.1, GL456239.1, GL456381.1, JH584292.1
##   Make sure to always combine/compare objects based on the same reference
##   genome (use suppressWarnings() to suppress this warning).
oly3$score <- oly3$score/counts[6]*1e6

exon_roi <- myexons[which(myexons$symbol==myname),]

XMIN=min(start(exon_roi))-500
XMAX=max(end(exon_roi))+500
YMAX=max( max(olc1$score), max(olc2$score), max(olc3$score), max(oly1$score), max(oly2$score),max(oly3$score) )
YMIN=0
YMINUS=YMAX/10*-1

par(mfrow=c(6,1))
par(mar=c(2,4,1,1))

df <- as.data.frame(exon_roi)
myrect <- function(df){
  apply(df,1,function(x) {
    start <- x[2]
    end <- x[3]
    rect(start, YMINUS, end,0,col="gray",lwd=2)
  })
}

fillplot(olc1$pos,olc1$score,type="l",xlab="chr",ylab="C1",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="blue",xaxt='n'); grid() ; myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(olc2$pos,olc2$score,type="l",xlab="chr",ylab="C2",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="blue",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(olc3$pos,olc3$score,type="l",xlab="chr",ylab="C3",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="blue",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(oly1$pos,oly1$score,type="l",xlab="chr",ylab="Y1",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="red",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(oly2$pos,oly2$score,type="l",xlab="chr",ylab="Y2",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="red",xaxt='n'); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
fillplot(oly3$pos,oly3$score,type="l",xlab="chr",ylab="Y3",ylim=c(YMINUS,YMAX),xlim=c(XMIN,XMAX),bty="n",col="red"); grid(); myrect(df)
## Warning in polygon(xx, yy, border = NA, ...): graphical parameter "type" is
## obsolete
## NULL
mtext(myname)

Session Info

sessionInfo()
## R version 4.0.2 (2020-06-22)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 18.04.5 LTS
## 
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] parallel  stats4    stats     graphics  grDevices utils     datasets 
## [8] methods   base     
## 
## other attached packages:
##  [1] ensembldb_2.12.1            AnnotationFilter_1.12.0    
##  [3] GenomicFeatures_1.40.1      AnnotationDbi_1.50.3       
##  [5] Rsamtools_2.4.0             Biostrings_2.56.0          
##  [7] XVector_0.28.0              AnnotationHub_2.20.2       
##  [9] BiocFileCache_1.12.1        dbplyr_1.4.4               
## [11] rtracklayer_1.48.0          eulerr_6.1.0               
## [13] DESeq2_1.28.1               SummarizedExperiment_1.18.2
## [15] DelayedArray_0.14.1         matrixStats_0.57.0         
## [17] Biobase_2.48.0              GenomicRanges_1.40.0       
## [19] GenomeInfoDb_1.24.2         IRanges_2.22.2             
## [21] S4Vectors_0.26.1            BiocGenerics_0.34.0        
## [23] edgeR_3.30.3                limma_3.44.3               
## 
## loaded via a namespace (and not attached):
##  [1] ProtGenerics_1.20.0           bitops_1.0-6                 
##  [3] bit64_4.0.5                   RColorBrewer_1.1-2           
##  [5] progress_1.2.2                httr_1.4.2                   
##  [7] tools_4.0.2                   R6_2.4.1                     
##  [9] lazyeval_0.2.2                DBI_1.1.0                    
## [11] colorspace_1.4-1              tidyselect_1.1.0             
## [13] prettyunits_1.1.1             bit_4.0.4                    
## [15] curl_4.3                      compiler_4.0.2               
## [17] scales_1.1.1                  genefilter_1.70.0            
## [19] askpass_1.1                   rappdirs_0.3.1               
## [21] stringr_1.4.0                 digest_0.6.25                
## [23] rmarkdown_2.4                 pkgconfig_2.0.3              
## [25] htmltools_0.5.0               fastmap_1.0.1                
## [27] rlang_0.4.7                   RSQLite_2.2.1                
## [29] shiny_1.5.0                   generics_0.0.2               
## [31] BiocParallel_1.22.0           dplyr_1.0.2                  
## [33] RCurl_1.98-1.2                magrittr_1.5                 
## [35] GenomeInfoDbData_1.2.3        Matrix_1.2-18                
## [37] Rcpp_1.0.5                    munsell_0.5.0                
## [39] lifecycle_0.2.0               stringi_1.5.3                
## [41] yaml_2.2.1                    zlibbioc_1.34.0              
## [43] grid_4.0.2                    blob_1.2.1                   
## [45] promises_1.1.1                crayon_1.3.4                 
## [47] lattice_0.20-41               splines_4.0.2                
## [49] annotate_1.66.0               hms_0.5.3                    
## [51] polylabelr_0.2.0              locfit_1.5-9.4               
## [53] knitr_1.30                    pillar_1.4.6                 
## [55] geneplotter_1.66.0            biomaRt_2.44.1               
## [57] XML_3.99-0.5                  glue_1.4.2                   
## [59] BiocVersion_3.11.1            evaluate_0.14                
## [61] BiocManager_1.30.10           vctrs_0.3.4                  
## [63] httpuv_1.5.4                  gtable_0.3.0                 
## [65] openssl_1.4.3                 purrr_0.3.4                  
## [67] polyclip_1.10-0               assertthat_0.2.1             
## [69] ggplot2_3.3.2                 xfun_0.18                    
## [71] mime_0.9                      xtable_1.8-4                 
## [73] later_1.1.0.1                 survival_3.2-7               
## [75] tibble_3.0.3                  GenomicAlignments_1.24.0     
## [77] memoise_1.1.0                 ellipsis_0.3.1               
## [79] interactiveDisplayBase_1.26.3