4.3 Fig 3F and 5B

bb_actd = read.table('data/BB_interaction_actd')
ab_actd = read.table('data/AB_interaction_actd')
aa_actd = read.table('data/AA_interaction_actd')
bb = read.table('data/BB_interaction')
ab = read.table('data/AB_interaction')
aa = read.table('data/AA_interaction')
aa_cis_num = sum(aa[aa$V1==aa$V4,7])/287704860*200000000
aa_trans_num = sum(aa[aa$V1!=aa$V4,7])/287704860*200000000
ab_cis_num = sum(ab[ab$V1==ab$V4,7])/287704860*200000000
ab_trans_num = sum(ab[ab$V1!=ab$V4,7])/287704860*200000000
bb_cis_num = sum(bb[bb$V1==bb$V4,7])/287704860*200000000
bb_trans_num = sum(bb[bb$V1!=bb$V4,7])/287704860*200000000

aa_cis_num_actd = sum(aa_actd[aa_actd$V1==aa_actd$V4,7])/162823588*200000000
aa_trans_num_actd = sum(aa_actd[aa_actd$V1!=aa_actd$V4,7])/162823588*200000000
ab_cis_num_actd = sum(ab_actd[ab_actd$V1==ab_actd$V4,7])/162823588*200000000
ab_trans_num_actd = sum(ab_actd[ab_actd$V1!=ab_actd$V4,7])/162823588*200000000
bb_cis_num_actd = sum(bb_actd[bb_actd$V1==bb_actd$V4,7])/162823588*200000000
bb_trans_num_actd = sum(bb_actd[bb_actd$V1!=bb_actd$V4,7])/162823588*200000000

counts = data.frame(BB =c(39.5,38.8),AB=c(20.4,23.2),AA = c(40.1,38))
barplot(as.matrix(counts), main="",
        xlab="", col=c("#2BA809","#F97164"),ylab=('%Interaction'), beside=T,ylim=c(0,50),legend.text =c('Ctrl','ActD') )

counts = data.frame(BB_cis = c(bb_cis_num,bb_cis_num_actd),AB_cis=c(ab_cis_num,ab_cis_num_actd),AA_cis = c(aa_cis_num,aa_cis_num_actd),
                  BB_trans=c(bb_trans_num,bb_trans_num_actd),AB_trans=c(ab_trans_num,ab_trans_num_actd),
                  AA_trans = c(aa_trans_num,aa_trans_num_actd))
barplot(as.matrix(counts), main="",
        xlab="", col=c("#2BA809","#F97164"), beside=T,ylim=c(0,80000000),legend.text =c('Ctrl','ActD') )