scale_x_continuous(labels = scales::comma,limits=c(svmp.reg.start,svmp.reg.end),expand=c(0,0)) +
ylab('') +
xlab('') +
ggtitle('b) svmp\n\nTandem Array with Gene Expression at 1DPE') +
scale_fill_viridis_c(option = 'B') +
theme_classic(base_size = 14) + theme(panel.grid = element_blank(),axis.line = element_blank(),
plot.title.position = 'plot',plot.title = element_text(color='black',face='bold',size = 14),axis.title.x = element_blank())
ggplot(svmp.dummy,aes(x = start, xend = end, y = molecule, yend=molecule)) +
geom_segment(lwd=1,color='grey70') +
geom_diagonal(data=svmp.vpers,aes(x=prom_start,xend=start,y='mi1',yend='vPERs',alpha = stat(index)),strength = -0.2,show.legend = F) +
geom_gene_arrow(data=svmp.info,aes(xmin = start, xmax = end, y = molecule, forward = direction, fill = log10avg1DPE),arrowhead_height = unit(5, "mm"), arrowhead_width = unit(2, "mm"),show.legend = F) +
geom_point(inherit.aes = F, data=svmp.vpers, aes(x=(start+end)/2, y='vPERs'),size=2) +
# geom_segment(inherit.aes = F, data=svmp.tes.all %>% filter(type=='Promoter'), aes(x=(X2+X3)/2,xend=(X2+X3)/2,y='Promoter',yend='mi2',color=type),alpha=0.5) +
geom_segment(inherit.aes = F, data=svmp.teOverlaps, aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Enhancer',yend='vPERs',color=te_id),alpha=0.5) +
geom_point(inherit.aes = F, data=svmp.teOverlaps, aes(x=(te_start+te_end)/2, y='Enhancer',color=te_id),size=5,pch=18) +
# scale_color_manual(values = c('Promoter'='#2C8790','Enhancer'='#82B47A','Other'='grey40')) +
scale_x_continuous(labels = scales::comma,limits=c(svmp.reg.start,svmp.reg.end),expand=c(0,0)) +
ylab('') +
xlab('') +
# ggtitle('b) svmp\n\nTandem Array with Gene Expression at 1DPE') +
scale_fill_viridis_c(option = 'B') +
theme_classic(base_size = 14) + theme(panel.grid = element_blank(),axis.line = element_blank(),
plot.title.position = 'plot',plot.title = element_text(color='black',face='bold',size = 14),axis.title.x = element_blank())
ggplot(svmp.dummy,aes(x = start, xend = end, y = molecule, yend=molecule)) +
geom_segment(lwd=1,color='grey70') +
geom_diagonal(data=svmp.vpers,aes(x=prom_start,xend=start,y='mi1',yend='vPERs',alpha = stat(index)),strength = -0.2,show.legend = F) +
geom_gene_arrow(data=svmp.info,aes(xmin = start, xmax = end, y = molecule, forward = direction, fill = log10avg1DPE),arrowhead_height = unit(5, "mm"), arrowhead_width = unit(2, "mm"),show.legend = F) +
geom_point(inherit.aes = F, data=svmp.vpers, aes(x=(start+end)/2, y='vPERs'),size=2) +
# geom_segment(inherit.aes = F, data=svmp.tes.all %>% filter(type=='Promoter'), aes(x=(X2+X3)/2,xend=(X2+X3)/2,y='Promoter',yend='mi2',color=type),alpha=0.5) +
geom_segment(inherit.aes = F, data=svmp.teOverlaps, aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Enhancer',yend='vPERs',color=te_id),alpha=0.5) +
geom_point(inherit.aes = F, data=svmp.teOverlaps, aes(x=(te_start+te_end)/2, y='Enhancer',color=te_id),size=5,pch=18) +
# scale_color_manual(values = c('Promoter'='#2C8790','Enhancer'='#82B47A','Other'='grey40')) +
scale_x_continuous(labels = scales::comma,limits=c(svmp.reg.start,svmp.reg.end),expand=c(0,0)) +
ylab('') +
xlab('') +
ggtitle('SVMP Tandem Array with Gene Expression at 1DPE') +
scale_fill_viridis_c(option = 'B') +
theme_classic(base_size = 14) + theme(panel.grid = element_blank(),axis.line = element_blank(),
plot.title.position = 'plot',plot.title = element_text(color='black',face='bold',size = 14),axis.title.x = element_blank())
pri_venom_genes <- read_tsv('data/venom_annotation/PriorityVenomGenes_08.02.21.txt',col_names = F)
exp <- read_tsv('analysis/1_gene_expression/norm_counts/AllGenes_AvgMedianTPM_1DPE_08.02.21.tsv') %>%
mutate(gene = str_replace_all(txid,'_',' ')) %>%
mutate(log10avg1DPE = log10(Median1DPE + 1))
all_info <- read_tsv('data/annotation/CroVir_rnd1.all.maker.final.homologIDs.updatedNov2019.GeneEntriesOnly.gff',col_names = F) %>%
filter(str_detect(X9,'trnascan',negate = T)) %>%
mutate(tx_id = str_split_fixed(X9,';',4)[,3]) %>%
mutate(tx_id = str_remove_all(tx_id,'Crovir_Transcript_ID=')) %>%
filter(tx_id %in% pri_venom_genes$X6) %>%
left_join(pri_venom_genes,by=c('tx_id' = 'X6')) %>%
select(molecule = 1, gene = 16, start = 4, end = 5, strand = 7,tx_id) %>%
mutate(strand = ifelse(strand == '+','forward','reverse')) %>%
mutate(direction = ifelse(strand == 'forward',1,-1)) %>%
mutate(gene = str_replace_all(gene,'_',' ')) %>%
left_join(exp,by=c('tx_id'='txid')) %>%
mutate(prom_start = ifelse(strand=='forward',start,end))
pla2.info <- all_info %>%
filter(str_detect(tx_id,'pla2')) %>%
mutate(molecule = str_remove(molecule,'scaffold-')) %>%
mutate(molecule = factor(molecule,levels=c('Promoter','mi7','vPERs','Enhancer','Other')))
pla2.reg.start <- min(pla2.info$start)-100000
pla2.reg.end <- max(pla2.info$end)+100000
pla2.reg.length <- paste(c(round((pla2.reg.end-pla2.reg.start)/1000,digits = 2),'kb'),collapse = ' ')
pla2.vpers <- read_tsv('analysis/6_ABC_Enhancers/ABC_output/_reformat/pla2_EnhancerPredictionsFull_VenomGenes_simple_newID_08.18.21.bed',col_names = F) %>%
select(molecule=1,start=2,end=3,id=4) %>%
mutate(gene = str_split_fixed(id, '_',2)[,2]) %>%
mutate(gene = str_split(gene,'\\.')) %>%
unnest(gene) %>%
mutate(gene = str_replace(gene,'\\_',' ')) %>%
left_join(pla2.info,by=c('gene'='gene.x')) %>%
mutate(type=' vPERs') %>%
select(molecule=1,start=2,end=3,id,gene,gene.start=7,gene.end=8,type,prom_start) %>%
mutate(molecule = str_remove(molecule,'scaffold-')) %>%
mutate(molecule = factor(molecule,levels=c('Promoter','mi7','vPERs','Enhancer','Other')))
pla2.dummy <-  tribble(
~molecule, ~start,  ~end,
"Promoter", pla2.reg.start, pla2.reg.end,
"mi7", pla2.reg.start, pla2.reg.end,
"vPERs", pla2.reg.start, pla2.reg.end,
"Enhancer", pla2.reg.start, pla2.reg.end,
"Other", pla2.reg.start, pla2.reg.end,
) %>%
mutate(molecule = factor(molecule,levels=rev(c('Promoter','mi7','vPERs','Enhancer','Other'))))
ggplot(pla2.dummy,aes(x = start, xend = end, y = molecule, yend=molecule)) +
geom_segment(lwd=1,color='grey70') +
geom_diagonal(data=pla2.vpers,aes(x=prom_start,xend=start,y='mi7',yend='vPERs',alpha = stat(index)),strength = -0.2,show.legend = F) +
geom_gene_arrow(data=pla2.info,aes(xmin = start, xmax = end, y = molecule, forward = direction, fill = log10avg1DPE),arrowhead_height = unit(5, "mm"), arrowhead_width = unit(2, "mm"),show.legend = F) +
geom_point(inherit.aes = F, data=pla2.vpers, aes(x=(start+end)/2, y='vPERs'),size=2) +
# geom_segment(inherit.aes = F, data=pla2.tes.all %>% filter(type=='Promoter'), aes(x=(X2+X3)/2,xend=(X2+X3)/2,y='Promoter',yend='mi2',color=type),alpha=0.5) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps, aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Enhancer',yend='vPERs',color=te_id),alpha=0.5) +
geom_point(inherit.aes = F, data=pla2.teOverlaps, aes(x=(te_start+te_end)/2, y='Enhancer',color=te_id),size=5,pch=18) +
# scale_color_manual(values = c('Promoter'='#2C8790','Enhancer'='#82B47A','Other'='grey40')) +
scale_x_continuous(labels = scales::comma,limits=c(pla2.reg.start,pla2.reg.end),expand=c(0,0)) +
ylab('') +
xlab('') +
ggtitle('pla2 Tandem Array with Gene Expression at 1DPE') +
scale_fill_viridis_c(option = 'B') +
theme_classic(base_size = 14) + theme(panel.grid = element_blank(),axis.line = element_blank(),
plot.title.position = 'plot',plot.title = element_text(color='black',face='bold',size = 14),axis.title.x = element_blank())
pla2.info <- all_info %>%
filter(str_detect(tx_id,'PLA2')) %>%
mutate(molecule = str_remove(molecule,'scaffold-')) %>%
mutate(molecule = factor(molecule,levels=c('Promoter','mi7','vPERs','Enhancer','Other')))
pla2.reg.start <- min(pla2.info$start)-100000
pla2.reg.end <- max(pla2.info$end)+100000
pla2.reg.length <- paste(c(round((pla2.reg.end-pla2.reg.start)/1000,digits = 2),'kb'),collapse = ' ')
pla2.vpers <- read_tsv('analysis/6_ABC_Enhancers/ABC_output/_reformat/pla2_EnhancerPredictionsFull_VenomGenes_simple_newID_08.18.21.bed',col_names = F) %>%
select(molecule=1,start=2,end=3,id=4) %>%
mutate(gene = str_split_fixed(id, '_',2)[,2]) %>%
mutate(gene = str_split(gene,'\\.')) %>%
unnest(gene) %>%
mutate(gene = str_replace(gene,'\\_',' ')) %>%
left_join(pla2.info,by=c('gene'='gene.x')) %>%
mutate(type=' vPERs') %>%
select(molecule=1,start=2,end=3,id,gene,gene.start=7,gene.end=8,type,prom_start) %>%
mutate(molecule = str_remove(molecule,'scaffold-')) %>%
mutate(molecule = factor(molecule,levels=c('Promoter','mi7','vPERs','Enhancer','Other')))
pla2.dummy <-  tribble(
~molecule, ~start,  ~end,
"Promoter", pla2.reg.start, pla2.reg.end,
"mi7", pla2.reg.start, pla2.reg.end,
"vPERs", pla2.reg.start, pla2.reg.end,
"Enhancer", pla2.reg.start, pla2.reg.end,
"Other", pla2.reg.start, pla2.reg.end,
) %>%
mutate(molecule = factor(molecule,levels=rev(c('Promoter','mi7','vPERs','Enhancer','Other'))))
ggplot(pla2.dummy,aes(x = start, xend = end, y = molecule, yend=molecule)) +
geom_segment(lwd=1,color='grey70') +
geom_diagonal(data=pla2.vpers,aes(x=prom_start,xend=start,y='mi7',yend='vPERs',alpha = stat(index)),strength = -0.2,show.legend = F) +
geom_gene_arrow(data=pla2.info,aes(xmin = start, xmax = end, y = molecule, forward = direction, fill = log10avg1DPE),arrowhead_height = unit(5, "mm"), arrowhead_width = unit(2, "mm"),show.legend = F) +
geom_point(inherit.aes = F, data=pla2.vpers, aes(x=(start+end)/2, y='vPERs'),size=2) +
# geom_segment(inherit.aes = F, data=pla2.tes.all %>% filter(type=='Promoter'), aes(x=(X2+X3)/2,xend=(X2+X3)/2,y='Promoter',yend='mi2',color=type),alpha=0.5) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps, aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Enhancer',yend='vPERs',color=te_id),alpha=0.5) +
geom_point(inherit.aes = F, data=pla2.teOverlaps, aes(x=(te_start+te_end)/2, y='Enhancer',color=te_id),size=5,pch=18) +
# scale_color_manual(values = c('Promoter'='#2C8790','Enhancer'='#82B47A','Other'='grey40')) +
scale_x_continuous(labels = scales::comma,limits=c(pla2.reg.start,pla2.reg.end),expand=c(0,0)) +
ylab('') +
xlab('') +
ggtitle('pla2 Tandem Array with Gene Expression at 1DPE') +
scale_fill_viridis_c(option = 'B') +
theme_classic(base_size = 14) + theme(panel.grid = element_blank(),axis.line = element_blank(),
plot.title.position = 'plot',plot.title = element_text(color='black',face='bold',size = 14),axis.title.x = element_blank())
pla2.reg.start <- min(pla2.info$start)-50000
pla2.reg.end <- max(pla2.info$end)+50000
pla2.reg.length <- paste(c(round((pla2.reg.end-pla2.reg.start)/1000,digits = 2),'kb'),collapse = ' ')
pla2.vpers <- read_tsv('analysis/6_ABC_Enhancers/ABC_output/_reformat/pla2_EnhancerPredictionsFull_VenomGenes_simple_newID_08.18.21.bed',col_names = F) %>%
select(molecule=1,start=2,end=3,id=4) %>%
mutate(gene = str_split_fixed(id, '_',2)[,2]) %>%
mutate(gene = str_split(gene,'\\.')) %>%
unnest(gene) %>%
mutate(gene = str_replace(gene,'\\_',' ')) %>%
left_join(pla2.info,by=c('gene'='gene.x')) %>%
mutate(type=' vPERs') %>%
select(molecule=1,start=2,end=3,id,gene,gene.start=7,gene.end=8,type,prom_start) %>%
mutate(molecule = str_remove(molecule,'scaffold-')) %>%
mutate(molecule = factor(molecule,levels=c('Promoter','mi7','vPERs','Enhancer','Other')))
pla2.dummy <-  tribble(
~molecule, ~start,  ~end,
"Promoter", pla2.reg.start, pla2.reg.end,
"mi7", pla2.reg.start, pla2.reg.end,
"vPERs", pla2.reg.start, pla2.reg.end,
"Enhancer", pla2.reg.start, pla2.reg.end,
"Other", pla2.reg.start, pla2.reg.end,
) %>%
mutate(molecule = factor(molecule,levels=rev(c('Promoter','mi7','vPERs','Enhancer','Other'))))
ggplot(pla2.dummy,aes(x = start, xend = end, y = molecule, yend=molecule)) +
geom_segment(lwd=1,color='grey70') +
geom_diagonal(data=pla2.vpers,aes(x=prom_start,xend=start,y='mi7',yend='vPERs',alpha = stat(index)),strength = -0.2,show.legend = F) +
geom_gene_arrow(data=pla2.info,aes(xmin = start, xmax = end, y = molecule, forward = direction, fill = log10avg1DPE),arrowhead_height = unit(5, "mm"), arrowhead_width = unit(2, "mm"),show.legend = F) +
geom_point(inherit.aes = F, data=pla2.vpers, aes(x=(start+end)/2, y='vPERs'),size=2) +
# geom_segment(inherit.aes = F, data=pla2.tes.all %>% filter(type=='Promoter'), aes(x=(X2+X3)/2,xend=(X2+X3)/2,y='Promoter',yend='mi2',color=type),alpha=0.5) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps, aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Enhancer',yend='vPERs',color=te_id),alpha=0.5) +
geom_point(inherit.aes = F, data=pla2.teOverlaps, aes(x=(te_start+te_end)/2, y='Enhancer',color=te_id),size=5,pch=18) +
# scale_color_manual(values = c('Promoter'='#2C8790','Enhancer'='#82B47A','Other'='grey40')) +
scale_x_continuous(labels = scales::comma,limits=c(pla2.reg.start,pla2.reg.end),expand=c(0,0)) +
ylab('') +
xlab('') +
ggtitle('pla2 Tandem Array with Gene Expression at 1DPE') +
scale_fill_viridis_c(option = 'B') +
theme_classic(base_size = 14) + theme(panel.grid = element_blank(),axis.line = element_blank(),
plot.title.position = 'plot',plot.title = element_text(color='black',face='bold',size = 14),axis.title.x = element_blank())
pla2.reg.start <- min(pla2.info$start)-5000
pla2.reg.end <- max(pla2.info$end)+5000
pla2.reg.length <- paste(c(round((pla2.reg.end-pla2.reg.start)/1000,digits = 2),'kb'),collapse = ' ')
pla2.vpers <- read_tsv('analysis/6_ABC_Enhancers/ABC_output/_reformat/pla2_EnhancerPredictionsFull_VenomGenes_simple_newID_08.18.21.bed',col_names = F) %>%
select(molecule=1,start=2,end=3,id=4) %>%
mutate(gene = str_split_fixed(id, '_',2)[,2]) %>%
mutate(gene = str_split(gene,'\\.')) %>%
unnest(gene) %>%
mutate(gene = str_replace(gene,'\\_',' ')) %>%
left_join(pla2.info,by=c('gene'='gene.x')) %>%
mutate(type=' vPERs') %>%
select(molecule=1,start=2,end=3,id,gene,gene.start=7,gene.end=8,type,prom_start) %>%
mutate(molecule = str_remove(molecule,'scaffold-')) %>%
mutate(molecule = factor(molecule,levels=c('Promoter','mi7','vPERs','Enhancer','Other')))
pla2.dummy <-  tribble(
~molecule, ~start,  ~end,
"Promoter", pla2.reg.start, pla2.reg.end,
"mi7", pla2.reg.start, pla2.reg.end,
"vPERs", pla2.reg.start, pla2.reg.end,
"Enhancer", pla2.reg.start, pla2.reg.end,
"Other", pla2.reg.start, pla2.reg.end,
) %>%
mutate(molecule = factor(molecule,levels=rev(c('Promoter','mi7','vPERs','Enhancer','Other'))))
ggplot(pla2.dummy,aes(x = start, xend = end, y = molecule, yend=molecule)) +
geom_segment(lwd=1,color='grey70') +
geom_diagonal(data=pla2.vpers,aes(x=prom_start,xend=start,y='mi7',yend='vPERs',alpha = stat(index)),strength = -0.2,show.legend = F) +
geom_gene_arrow(data=pla2.info,aes(xmin = start, xmax = end, y = molecule, forward = direction, fill = log10avg1DPE),arrowhead_height = unit(5, "mm"), arrowhead_width = unit(2, "mm"),show.legend = F) +
geom_point(inherit.aes = F, data=pla2.vpers, aes(x=(start+end)/2, y='vPERs'),size=2) +
# geom_segment(inherit.aes = F, data=pla2.tes.all %>% filter(type=='Promoter'), aes(x=(X2+X3)/2,xend=(X2+X3)/2,y='Promoter',yend='mi2',color=type),alpha=0.5) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps, aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Enhancer',yend='vPERs',color=te_id),alpha=0.5) +
geom_point(inherit.aes = F, data=pla2.teOverlaps, aes(x=(te_start+te_end)/2, y='Enhancer',color=te_id),size=5,pch=18) +
# scale_color_manual(values = c('Promoter'='#2C8790','Enhancer'='#82B47A','Other'='grey40')) +
scale_x_continuous(labels = scales::comma,limits=c(pla2.reg.start,pla2.reg.end),expand=c(0,0)) +
ylab('') +
xlab('') +
ggtitle('pla2 Tandem Array with Gene Expression at 1DPE') +
scale_fill_viridis_c(option = 'B') +
theme_classic(base_size = 14) + theme(panel.grid = element_blank(),axis.line = element_blank(),
plot.title.position = 'plot',plot.title = element_text(color='black',face='bold',size = 14),axis.title.x = element_blank())
pla2.teOverlaps <- read_tsv('_ms/__GR_Reviews_R1/TE_revisionAnalyses/PLA2.TEoverlap.txt',col_names = F) %>%
filter(X5 != '.') %>%
select(chr=1,reg_start=2,reg_end=3,reg_id=4,te_start=6,te_end=7,te_id=8,te_family=9,overlap_bases=11) %>%
filter(te_id %in% pla2.giggle.sig$TE)  %>%
filter(str_detect(reg_id,'PLA2_gIIE',negate = T))
pri_venom_genes <- read_tsv('data/venom_annotation/PriorityVenomGenes_08.02.21.txt',col_names = F)
exp <- read_tsv('analysis/1_gene_expression/norm_counts/AllGenes_AvgMedianTPM_1DPE_08.02.21.tsv') %>%
mutate(gene = str_replace_all(txid,'_',' ')) %>%
mutate(log10avg1DPE = log10(Median1DPE + 1))
all_info <- read_tsv('data/annotation/CroVir_rnd1.all.maker.final.homologIDs.updatedNov2019.GeneEntriesOnly.gff',col_names = F) %>%
filter(str_detect(X9,'trnascan',negate = T)) %>%
mutate(tx_id = str_split_fixed(X9,';',4)[,3]) %>%
mutate(tx_id = str_remove_all(tx_id,'Crovir_Transcript_ID=')) %>%
filter(tx_id %in% pri_venom_genes$X6) %>%
left_join(pri_venom_genes,by=c('tx_id' = 'X6')) %>%
select(molecule = 1, gene = 16, start = 4, end = 5, strand = 7,tx_id) %>%
mutate(strand = ifelse(strand == '+','forward','reverse')) %>%
mutate(direction = ifelse(strand == 'forward',1,-1)) %>%
mutate(gene = str_replace_all(gene,'_',' ')) %>%
left_join(exp,by=c('tx_id'='txid')) %>%
mutate(prom_start = ifelse(strand=='forward',start,end))
pla2.info <- all_info %>%
filter(str_detect(tx_id,'PLA2')) %>%
mutate(molecule = str_remove(molecule,'scaffold-')) %>%
mutate(molecule = factor(molecule,levels=c('Promoter','mi7','vPERs','Enhancer','Other')))
pla2.reg.start <- min(pla2.info$start)-5000
pla2.reg.end <- max(pla2.info$end)+5000
pla2.reg.length <- paste(c(round((pla2.reg.end-pla2.reg.start)/1000,digits = 2),'kb'),collapse = ' ')
pla2.vpers <- read_tsv('analysis/6_ABC_Enhancers/ABC_output/_reformat/pla2_EnhancerPredictionsFull_VenomGenes_simple_newID_08.18.21.bed',col_names = F) %>%
select(molecule=1,start=2,end=3,id=4) %>%
mutate(gene = str_split_fixed(id, '_',2)[,2]) %>%
mutate(gene = str_split(gene,'\\.')) %>%
unnest(gene) %>%
mutate(gene = str_replace(gene,'\\_',' ')) %>%
left_join(pla2.info,by=c('gene'='gene.x')) %>%
mutate(type=' vPERs') %>%
select(molecule=1,start=2,end=3,id,gene,gene.start=7,gene.end=8,type,prom_start) %>%
mutate(molecule = str_remove(molecule,'scaffold-')) %>%
mutate(molecule = factor(molecule,levels=c('Promoter','mi7','vPERs','Enhancer','Other')))
pla2.dummy <-  tribble(
~molecule, ~start,  ~end,
"Promoter", pla2.reg.start, pla2.reg.end,
"mi7", pla2.reg.start, pla2.reg.end,
"vPERs", pla2.reg.start, pla2.reg.end,
"Enhancer", pla2.reg.start, pla2.reg.end,
"Other", pla2.reg.start, pla2.reg.end,
) %>%
mutate(molecule = factor(molecule,levels=rev(c('Promoter','mi7','vPERs','Enhancer','Other'))))
ggplot(pla2.dummy,aes(x = start, xend = end, y = molecule, yend=molecule)) +
geom_segment(lwd=1,color='grey70') +
geom_diagonal(data=pla2.vpers,aes(x=prom_start,xend=start,y='mi7',yend='vPERs',alpha = stat(index)),strength = -0.2,show.legend = F) +
geom_gene_arrow(data=pla2.info,aes(xmin = start, xmax = end, y = molecule, forward = direction, fill = log10avg1DPE),arrowhead_height = unit(5, "mm"), arrowhead_width = unit(2, "mm"),show.legend = F) +
geom_point(inherit.aes = F, data=pla2.vpers, aes(x=(start+end)/2, y='vPERs'),size=2) +
# geom_segment(inherit.aes = F, data=pla2.tes.all %>% filter(type=='Promoter'), aes(x=(X2+X3)/2,xend=(X2+X3)/2,y='Promoter',yend='mi2',color=type),alpha=0.5) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps, aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Enhancer',yend='vPERs',color=te_id),alpha=0.5) +
geom_point(inherit.aes = F, data=pla2.teOverlaps, aes(x=(te_start+te_end)/2, y='Enhancer',color=te_id),size=5,pch=18) +
# scale_color_manual(values = c('Promoter'='#2C8790','Enhancer'='#82B47A','Other'='grey40')) +
scale_x_continuous(labels = scales::comma,limits=c(pla2.reg.start,pla2.reg.end),expand=c(0,0)) +
ylab('') +
xlab('') +
ggtitle('pla2 Tandem Array with Gene Expression at 1DPE') +
scale_fill_viridis_c(option = 'B') +
theme_classic(base_size = 14) + theme(panel.grid = element_blank(),axis.line = element_blank(),
plot.title.position = 'plot',plot.title = element_text(color='black',face='bold',size = 14),axis.title.x = element_blank())
ggplot(pla2.dummy,aes(x = start, xend = end, y = molecule, yend=molecule)) +
geom_segment(lwd=1,color='grey70') +
geom_diagonal(data=pla2.vpers,aes(x=prom_start,xend=start,y='mi7',yend='vPERs',alpha = stat(index)),strength = -0.2,show.legend = F) +
geom_gene_arrow(data=pla2.info,aes(xmin = start, xmax = end, y = molecule, forward = direction, fill = log10avg1DPE),arrowhead_height = unit(5, "mm"), arrowhead_width = unit(2, "mm"),show.legend = F) +
geom_point(inherit.aes = F, data=pla2.vpers, aes(x=(start+end)/2, y='vPERs'),size=2) +
geom_segment(inherit.aes = F, data=pla2.tes.all %>% filter(str_detect(reg_id,'Promoter')), aes(x=(X2+X3)/2,xend=(X2+X3)/2,y='Promoter',yend='mi2',color=type),alpha=0.5) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps, aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Enhancer',yend='vPERs',color=te_id),alpha=0.5) +
geom_point(inherit.aes = F, data=pla2.teOverlaps, aes(x=(te_start+te_end)/2, y='Enhancer',color=te_id),size=5,pch=18) +
# scale_color_manual(values = c('Promoter'='#2C8790','Enhancer'='#82B47A','Other'='grey40')) +
scale_x_continuous(labels = scales::comma,limits=c(pla2.reg.start,pla2.reg.end),expand=c(0,0)) +
ylab('') +
xlab('') +
ggtitle('pla2 Tandem Array with Gene Expression at 1DPE') +
scale_fill_viridis_c(option = 'B') +
theme_classic(base_size = 14) + theme(panel.grid = element_blank(),axis.line = element_blank(),
plot.title.position = 'plot',plot.title = element_text(color='black',face='bold',size = 14),axis.title.x = element_blank())
ggplot(pla2.dummy,aes(x = start, xend = end, y = molecule, yend=molecule)) +
geom_segment(lwd=1,color='grey70') +
geom_diagonal(data=pla2.vpers,aes(x=prom_start,xend=start,y='mi7',yend='vPERs',alpha = stat(index)),strength = -0.2,show.legend = F) +
geom_gene_arrow(data=pla2.info,aes(xmin = start, xmax = end, y = molecule, forward = direction, fill = log10avg1DPE),arrowhead_height = unit(5, "mm"), arrowhead_width = unit(2, "mm"),show.legend = F) +
geom_point(inherit.aes = F, data=pla2.vpers, aes(x=(start+end)/2, y='vPERs'),size=2) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PROMOTER')), aes(x=(X2+X3)/2,xend=(X2+X3)/2,y='Promoter',yend='mi2',color=type),alpha=0.5) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps, aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Enhancer',yend='vPERs',color=te_id),alpha=0.5) +
geom_point(inherit.aes = F, data=pla2.teOverlaps, aes(x=(te_start+te_end)/2, y='Enhancer',color=te_id),size=5,pch=18) +
# scale_color_manual(values = c('Promoter'='#2C8790','Enhancer'='#82B47A','Other'='grey40')) +
scale_x_continuous(labels = scales::comma,limits=c(pla2.reg.start,pla2.reg.end),expand=c(0,0)) +
ylab('') +
xlab('') +
ggtitle('pla2 Tandem Array with Gene Expression at 1DPE') +
scale_fill_viridis_c(option = 'B') +
theme_classic(base_size = 14) + theme(panel.grid = element_blank(),axis.line = element_blank(),
plot.title.position = 'plot',plot.title = element_text(color='black',face='bold',size = 14),axis.title.x = element_blank())
ggplot(pla2.dummy,aes(x = start, xend = end, y = molecule, yend=molecule)) +
geom_segment(lwd=1,color='grey70') +
geom_diagonal(data=pla2.vpers,aes(x=prom_start,xend=start,y='mi7',yend='vPERs',alpha = stat(index)),strength = -0.2,show.legend = F) +
geom_gene_arrow(data=pla2.info,aes(xmin = start, xmax = end, y = molecule, forward = direction, fill = log10avg1DPE),arrowhead_height = unit(5, "mm"), arrowhead_width = unit(2, "mm"),show.legend = F) +
geom_point(inherit.aes = F, data=pla2.vpers, aes(x=(start+end)/2, y='vPERs'),size=2) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PROMOTER')), aes(x=(X2+X3)/2,xend=(X2+X3)/2,y='Promoter',yend='mi2',color=te_id),alpha=0.5) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps, aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Enhancer',yend='vPERs',color=te_id),alpha=0.5) +
geom_point(inherit.aes = F, data=pla2.teOverlaps, aes(x=(te_start+te_end)/2, y='Enhancer',color=te_id),size=5,pch=18) +
# scale_color_manual(values = c('Promoter'='#2C8790','Enhancer'='#82B47A','Other'='grey40')) +
scale_x_continuous(labels = scales::comma,limits=c(pla2.reg.start,pla2.reg.end),expand=c(0,0)) +
ylab('') +
xlab('') +
ggtitle('pla2 Tandem Array with Gene Expression at 1DPE') +
scale_fill_viridis_c(option = 'B') +
theme_classic(base_size = 14) + theme(panel.grid = element_blank(),axis.line = element_blank(),
plot.title.position = 'plot',plot.title = element_text(color='black',face='bold',size = 14),axis.title.x = element_blank())
ggplot(pla2.dummy,aes(x = start, xend = end, y = molecule, yend=molecule)) +
geom_segment(lwd=1,color='grey70') +
geom_diagonal(data=pla2.vpers,aes(x=prom_start,xend=start,y='mi7',yend='vPERs',alpha = stat(index)),strength = -0.2,show.legend = F) +
geom_gene_arrow(data=pla2.info,aes(xmin = start, xmax = end, y = molecule, forward = direction, fill = log10avg1DPE),arrowhead_height = unit(5, "mm"), arrowhead_width = unit(2, "mm"),show.legend = F) +
geom_point(inherit.aes = F, data=pla2.vpers, aes(x=(start+end)/2, y='vPERs'),size=2) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PROMOTER')), aes(x=(te_start+te_end)/2,xend=(X2+X3)/2,y='Promoter',yend='mi2',color=te_id),alpha=0.5) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PER')), aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Enhancer',yend='vPERs',color=te_id),alpha=0.5) +
geom_point(inherit.aes = F, data=pla2.teOverlaps, aes(x=(te_start+te_end)/2, y='Enhancer',color=te_id),size=5,pch=18) +
# scale_color_manual(values = c('Promoter'='#2C8790','Enhancer'='#82B47A','Other'='grey40')) +
scale_x_continuous(labels = scales::comma,limits=c(pla2.reg.start,pla2.reg.end),expand=c(0,0)) +
ylab('') +
xlab('') +
ggtitle('pla2 Tandem Array with Gene Expression at 1DPE') +
scale_fill_viridis_c(option = 'B') +
theme_classic(base_size = 14) + theme(panel.grid = element_blank(),axis.line = element_blank(),
plot.title.position = 'plot',plot.title = element_text(color='black',face='bold',size = 14),axis.title.x = element_blank())
ggplot(pla2.dummy,aes(x = start, xend = end, y = molecule, yend=molecule)) +
geom_segment(lwd=1,color='grey70') +
geom_diagonal(data=pla2.vpers,aes(x=prom_start,xend=start,y='mi7',yend='vPERs',alpha = stat(index)),strength = -0.2,show.legend = F) +
geom_gene_arrow(data=pla2.info,aes(xmin = start, xmax = end, y = molecule, forward = direction, fill = log10avg1DPE),arrowhead_height = unit(5, "mm"), arrowhead_width = unit(2, "mm"),show.legend = F) +
geom_point(inherit.aes = F, data=pla2.vpers, aes(x=(start+end)/2, y='vPERs'),size=2) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PROMOTER')), aes(x=(te_start+te_end)/2,xend=(te_start+te_end))/2,y='Promoter',yend='mi2',color=te_id),alpha=0.5) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PER')), aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Enhancer',yend='vPERs',color=te_id),alpha=0.5) +
geom_point(inherit.aes = F, data=pla2.teOverlaps, aes(x=(te_start+te_end)/2, y='Enhancer',color=te_id),size=5,pch=18) +
# scale_color_manual(values = c('Promoter'='#2C8790','Enhancer'='#82B47A','Other'='grey40')) +
scale_x_continuous(labels = scales::comma,limits=c(pla2.reg.start,pla2.reg.end),expand=c(0,0)) +
ylab('') +
xlab('') +
ggtitle('pla2 Tandem Array with Gene Expression at 1DPE') +
scale_fill_viridis_c(option = 'B') +
theme_classic(base_size = 14) + theme(panel.grid = element_blank(),axis.line = element_blank(),
plot.title.position = 'plot',plot.title = element_text(color='black',face='bold',size = 14),axis.title.x = element_blank())
ggplot(pla2.dummy,aes(x = start, xend = end, y = molecule, yend=molecule)) +
geom_segment(lwd=1,color='grey70') +
geom_diagonal(data=pla2.vpers,aes(x=prom_start,xend=start,y='mi7',yend='vPERs',alpha = stat(index)),strength = -0.2,show.legend = F) +
geom_gene_arrow(data=pla2.info,aes(xmin = start, xmax = end, y = molecule, forward = direction, fill = log10avg1DPE),arrowhead_height = unit(5, "mm"), arrowhead_width = unit(2, "mm"),show.legend = F) +
geom_point(inherit.aes = F, data=pla2.vpers, aes(x=(start+end)/2, y='vPERs'),size=2) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PROMOTER'), aes(x=(te_start+te_end)/2,xend=(te_start+te_end))/2,y='Promoter',yend='mi2',color=te_id),alpha=0.5) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PER')), aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Enhancer',yend='vPERs',color=te_id),alpha=0.5) +
geom_point(inherit.aes = F, data=pla2.teOverlaps, aes(x=(te_start+te_end)/2, y='Enhancer',color=te_id),size=5,pch=18) +
# scale_color_manual(values = c('Promoter'='#2C8790','Enhancer'='#82B47A','Other'='grey40')) +
scale_x_continuous(labels = scales::comma,limits=c(pla2.reg.start,pla2.reg.end),expand=c(0,0)) +
ylab('') +
xlab('') +
ggtitle('pla2 Tandem Array with Gene Expression at 1DPE') +
scale_fill_viridis_c(option = 'B') +
theme_classic(base_size = 14) + theme(panel.grid = element_blank(),axis.line = element_blank(),
plot.title.position = 'plot',plot.title = element_text(color='black',face='bold',size = 14),axis.title.x = element_blank())
ggplot(pla2.dummy,aes(x = start, xend = end, y = molecule, yend=molecule)) +
geom_segment(lwd=1,color='grey70') +
geom_diagonal(data=pla2.vpers,aes(x=prom_start,xend=start,y='mi7',yend='vPERs',alpha = stat(index)),strength = -0.2,show.legend = F) +
geom_gene_arrow(data=pla2.info,aes(xmin = start, xmax = end, y = molecule, forward = direction, fill = log10avg1DPE),arrowhead_height = unit(5, "mm"), arrowhead_width = unit(2, "mm"),show.legend = F) +
geom_point(inherit.aes = F, data=pla2.vpers, aes(x=(start+end)/2, y='vPERs'),size=2) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PROMOTER')), aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Promoter',yend='mi2',color=te_id),alpha=0.5) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PER')), aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Enhancer',yend='vPERs',color=te_id),alpha=0.5) +
geom_point(inherit.aes = F, data=pla2.teOverlaps, aes(x=(te_start+te_end)/2, y='Enhancer',color=te_id),size=5,pch=18) +
# scale_color_manual(values = c('Promoter'='#2C8790','Enhancer'='#82B47A','Other'='grey40')) +
scale_x_continuous(labels = scales::comma,limits=c(pla2.reg.start,pla2.reg.end),expand=c(0,0)) +
ylab('') +
xlab('') +
ggtitle('pla2 Tandem Array with Gene Expression at 1DPE') +
scale_fill_viridis_c(option = 'B') +
theme_classic(base_size = 14) + theme(panel.grid = element_blank(),axis.line = element_blank(),
plot.title.position = 'plot',plot.title = element_text(color='black',face='bold',size = 14),axis.title.x = element_blank())
ggplot(pla2.dummy,aes(x = start, xend = end, y = molecule, yend=molecule)) +
geom_segment(lwd=1,color='grey70') +
geom_diagonal(data=pla2.vpers,aes(x=prom_start,xend=start,y='mi7',yend='vPERs',alpha = stat(index)),strength = -0.2,show.legend = F) +
geom_gene_arrow(data=pla2.info,aes(xmin = start, xmax = end, y = molecule, forward = direction, fill = log10avg1DPE),arrowhead_height = unit(5, "mm"), arrowhead_width = unit(2, "mm"),show.legend = F) +
geom_point(inherit.aes = F, data=pla2.vpers, aes(x=(start+end)/2, y='vPERs'),size=2) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PROMOTER')), aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Promoter',yend='mi7',color=te_id),alpha=0.5) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PER')), aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Enhancer',yend='vPERs',color=te_id),alpha=0.5) +
geom_point(inherit.aes = F, data=pla2.teOverlaps, aes(x=(te_start+te_end)/2, y='Enhancer',color=te_id),size=5,pch=18) +
# scale_color_manual(values = c('Promoter'='#2C8790','Enhancer'='#82B47A','Other'='grey40')) +
scale_x_continuous(labels = scales::comma,limits=c(pla2.reg.start,pla2.reg.end),expand=c(0,0)) +
ylab('') +
xlab('') +
ggtitle('pla2 Tandem Array with Gene Expression at 1DPE') +
scale_fill_viridis_c(option = 'B') +
theme_classic(base_size = 14) + theme(panel.grid = element_blank(),axis.line = element_blank(),
plot.title.position = 'plot',plot.title = element_text(color='black',face='bold',size = 14),axis.title.x = element_blank())
ggplot(pla2.dummy,aes(x = start, xend = end, y = molecule, yend=molecule)) +
geom_segment(lwd=1,color='grey70') +
geom_diagonal(data=pla2.vpers,aes(x=prom_start,xend=start,y='mi7',yend='vPERs',alpha = stat(index)),strength = -0.2,show.legend = F) +
geom_gene_arrow(data=pla2.info,aes(xmin = start, xmax = end, y = molecule, forward = direction, fill = log10avg1DPE),arrowhead_height = unit(5, "mm"), arrowhead_width = unit(2, "mm"),show.legend = F) +
geom_point(inherit.aes = F, data=pla2.vpers, aes(x=(start+end)/2, y='vPERs'),size=2) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PROMOTER')), aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Promoter',yend='mi7',color=te_id),alpha=0.5) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PER')), aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Enhancer',yend='vPERs',color=te_id),alpha=0.5) +
geom_point(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PER')), aes(x=(te_start+te_end)/2, y='Enhancer',color=te_id),size=5,pch=18) +
geom_point(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PROMOTER')), aes(x=(te_start+te_end)/2, y='Promoter',color=te_id),size=5,pch=18) +
# scale_color_manual(values = c('Promoter'='#2C8790','Enhancer'='#82B47A','Other'='grey40')) +
scale_x_continuous(labels = scales::comma,limits=c(pla2.reg.start,pla2.reg.end),expand=c(0,0)) +
ylab('') +
xlab('') +
ggtitle('pla2 Tandem Array with Gene Expression at 1DPE') +
scale_fill_viridis_c(option = 'B') +
theme_classic(base_size = 14) + theme(panel.grid = element_blank(),axis.line = element_blank(),
plot.title.position = 'plot',plot.title = element_text(color='black',face='bold',size = 14),axis.title.x = element_blank())
ggplot(pla2.dummy,aes(x = start, xend = end, y = molecule, yend=molecule)) +
geom_segment(lwd=1,color='grey70') +
geom_diagonal(data=pla2.vpers,aes(x=prom_start,xend=start,y='mi7',yend='vPERs',alpha = stat(index)),strength = -0.2,show.legend = F) +
geom_gene_arrow(data=pla2.info,aes(xmin = start, xmax = end, y = molecule, forward = direction, fill = log10avg1DPE),arrowhead_height = unit(5, "mm"), arrowhead_width = unit(2, "mm"),show.legend = F) +
geom_point(inherit.aes = F, data=pla2.vpers, aes(x=(start+end)/2, y='vPERs'),size=2) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PROMOTER')), aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Promoter',yend='mi7',color=te_id),alpha=0.5) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PER')), aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Enhancer',yend='vPERs',color=te_id),alpha=0.5) +
geom_point(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PER')), aes(x=(te_start+te_end)/2, y='Enhancer',color=te_id),size=5,pch=18) +
geom_point(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PROMOTER')), aes(x=(te_start+te_end)/2, y='Promoter',color=te_id),size=5,pch=18) +
# scale_color_manual(values = c('Promoter'='#2C8790','Enhancer'='#82B47A','Other'='grey40')) +
scale_x_continuous(labels = scales::comma,limits=c(pla2.reg.start,pla2.reg.end),expand=c(0,0)) +
ylab('') +
xlab('') +
ggtitle('PLA2 Tandem Array with Gene Expression at 1DPE') +
scale_fill_viridis_c(option = 'B') +
theme_classic(base_size = 14) + theme(panel.grid = element_blank(),axis.line = element_blank(),
plot.title.position = 'plot',plot.title = element_text(color='black',face='bold',size = 14),axis.title.x = element_blank())
pla2.dummy <-  tribble(
~molecule, ~start,  ~end,
"Promoter", pla2.reg.start, pla2.reg.end,
"mi7", pla2.reg.start, pla2.reg.end,
"vPERs", pla2.reg.start, pla2.reg.end,
"Enhancer", pla2.reg.start, pla2.reg.end,
) %>%
mutate(molecule = factor(molecule,levels=rev(c('Promoter','mi7','vPERs','Enhancer'))))
ggplot(pla2.dummy,aes(x = start, xend = end, y = molecule, yend=molecule)) +
geom_segment(lwd=1,color='grey70') +
geom_diagonal(data=pla2.vpers,aes(x=prom_start,xend=start,y='mi7',yend='vPERs',alpha = stat(index)),strength = -0.2,show.legend = F) +
geom_gene_arrow(data=pla2.info,aes(xmin = start, xmax = end, y = molecule, forward = direction, fill = log10avg1DPE),arrowhead_height = unit(5, "mm"), arrowhead_width = unit(2, "mm"),show.legend = F) +
geom_point(inherit.aes = F, data=pla2.vpers, aes(x=(start+end)/2, y='vPERs'),size=2) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PROMOTER')), aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Promoter',yend='mi7',color=te_id),alpha=0.5) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PER')), aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Enhancer',yend='vPERs',color=te_id),alpha=0.5) +
geom_point(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PER')), aes(x=(te_start+te_end)/2, y='Enhancer',color=te_id),size=5,pch=18) +
geom_point(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PROMOTER')), aes(x=(te_start+te_end)/2, y='Promoter',color=te_id),size=5,pch=18) +
# scale_color_manual(values = c('Promoter'='#2C8790','Enhancer'='#82B47A','Other'='grey40')) +
scale_x_continuous(labels = scales::comma,limits=c(pla2.reg.start,pla2.reg.end),expand=c(0,0)) +
ylab('') +
xlab('') +
ggtitle('PLA2 Tandem Array with Gene Expression at 1DPE') +
scale_fill_viridis_c(option = 'B') +
theme_classic(base_size = 14) + theme(panel.grid = element_blank(),axis.line = element_blank(),
plot.title.position = 'plot',plot.title = element_text(color='black',face='bold',size = 14),axis.title.x = element_blank())
svmp.dummy <-  tribble(
~molecule, ~start,  ~end,
"Promoter", svmp.reg.start, svmp.reg.end,
"mi1", svmp.reg.start, svmp.reg.end,
"vPERs", svmp.reg.start, svmp.reg.end,
"Enhancer", svmp.reg.start, svmp.reg.end,
) %>%
mutate(molecule = factor(molecule,levels=rev(c('Promoter','mi1','vPERs','Enhancer'))))
ggplot(svmp.dummy,aes(x = start, xend = end, y = molecule, yend=molecule)) +
geom_segment(lwd=1,color='grey70') +
geom_diagonal(data=svmp.vpers,aes(x=prom_start,xend=start,y='mi1',yend='vPERs',alpha = stat(index)),strength = -0.2,show.legend = F) +
geom_gene_arrow(data=svmp.info,aes(xmin = start, xmax = end, y = molecule, forward = direction, fill = log10avg1DPE),arrowhead_height = unit(5, "mm"), arrowhead_width = unit(2, "mm"),show.legend = F) +
geom_point(inherit.aes = F, data=svmp.vpers, aes(x=(start+end)/2, y='vPERs'),size=2) +
# geom_segment(inherit.aes = F, data=svmp.tes.all %>% filter(type=='Promoter'), aes(x=(X2+X3)/2,xend=(X2+X3)/2,y='Promoter',yend='mi2',color=type),alpha=0.5) +
geom_segment(inherit.aes = F, data=svmp.teOverlaps, aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Enhancer',yend='vPERs',color=te_id),alpha=0.5) +
geom_point(inherit.aes = F, data=svmp.teOverlaps, aes(x=(te_start+te_end)/2, y='Enhancer',color=te_id),size=5,pch=18) +
# scale_color_manual(values = c('Promoter'='#2C8790','Enhancer'='#82B47A','Other'='grey40')) +
scale_x_continuous(labels = scales::comma,limits=c(svmp.reg.start,svmp.reg.end),expand=c(0,0)) +
ylab('') +
xlab('') +
ggtitle('SVMP Tandem Array with Gene Expression at 1DPE') +
scale_fill_viridis_c(option = 'B') +
theme_classic(base_size = 14) + theme(panel.grid = element_blank(),axis.line = element_blank(),
plot.title.position = 'plot',plot.title = element_text(color='black',face='bold',size = 14),axis.title.x = element_blank())
ggplot(pla2.dummy,aes(x = start, xend = end, y = molecule, yend=molecule)) +
geom_segment(lwd=1,color='grey70') +
geom_diagonal(data=pla2.vpers,aes(x=prom_start,xend=start,y='mi7',yend='vPERs',alpha = stat(index)),strength = -0.2,show.legend = F) +
geom_gene_arrow(data=pla2.info,aes(xmin = start, xmax = end, y = molecule, forward = direction, fill = log10avg1DPE),arrowhead_height = unit(5, "mm"), arrowhead_width = unit(2, "mm"),show.legend = F) +
geom_point(inherit.aes = F, data=pla2.vpers, aes(x=(start+end)/2, y='vPERs'),size=2) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PROMOTER')), aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Promoter',yend='mi7',color=te_id),alpha=0.5) +
geom_segment(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PER')), aes(x=(te_start+te_end)/2,xend=(te_start+te_end)/2,y='Enhancer',yend='vPERs',color=te_id),alpha=0.5) +
geom_point(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PER')), aes(x=(te_start+te_end)/2, y='Enhancer',color=te_id),size=5,pch=18) +
geom_point(inherit.aes = F, data=pla2.teOverlaps %>% filter(str_detect(reg_id,'PROMOTER')), aes(x=(te_start+te_end)/2, y='Promoter',color=te_id),size=5,pch=18) +
# scale_color_manual(values = c('Promoter'='#2C8790','Enhancer'='#82B47A','Other'='grey40')) +
scale_x_continuous(labels = scales::comma,limits=c(pla2.reg.start,pla2.reg.end),expand=c(0,0)) +
ylab('') +
xlab('') +
ggtitle('PLA2 Tandem Array with Gene Expression at 1DPE') +
scale_fill_viridis_c(option = 'B') +
theme_classic(base_size = 14) + theme(panel.grid = element_blank(),axis.line = element_blank(),
plot.title.position = 'plot',plot.title = element_text(color='black',face='bold',size = 14),axis.title.x = element_blank())
View(pla2.teOverlaps)
