This is the R Markdown for Extended Dat Fig.4, which consists of 7 parts.

Figure a:

library(foreach)
library("RColorBrewer")
library(circlize)

fusion <- read.table("Fusion_fusionhub_sv_validated_Arv.xls",sep="\t",stringsAsFactors = F,header = T)
fusion$Gene1=foreach(i=1:nrow(fusion),.combine=c) %do% strsplit(fusion$Fusion[i],split="--")[[1]][1]
fusion$Gene2=foreach(i=1:nrow(fusion),.combine=c) %do% strsplit(fusion$Fusion[i],split="--")[[1]][2]

fs_dt=as.data.frame(fusion[,c(11,12,6,4)])
fs_dt$Gene_pair=paste(fs_dt$Gene1,fs_dt$Gene2,sep="--")
fs_dt=fs_dt[fs_dt$Count>2,]

fs_dt=fs_dt[!is.element(fs_dt$Gene_pair,c("CCDC7_ENSG00000150076--CCDC7_ENSG00000216937","OR7E47P_ENSG00000272724--OR7E47P_ENSG00000257542")),]#18 gene pair
fs=unique(c(fs_dt$Gene1,fs_dt$Gene2))
fs_len=foreach(i=1:length(fs),.combine = c) %do% max(fs_dt$Count[fs_dt$Gene1==fs[i]|fs_dt$Gene2==fs[i]])
names(fs_len)=fs

fs_col=rep("black",length(fs))
names(fs_col)=fs
fs_col[unique(unlist(strsplit(fs_dt$Gene_pair[fs_dt$Fusionhub==""],split="--")))]="red"

#pdf("Figure2a_Fusion.pdf",height=7,width=7)
factors=rep(fs,times=fs_len)
par(mfrow=c(1,1),mar=rep(8,4))
circos.par(cell.padding = c(0, 0, 0, 0),start.degree =90, gap.degree =2,track.margin = c(0, 0.02))
circos.initialize(factors, xlim = cbind(rep(0,length(fs)),fs_len))
circos.track(ylim = c(0, 1), track.height = 0.05,
             bg.col = rand_color(length(fs)), bg.border = NA,panel.fun=function(x,y){
               sector.index = CELL_META$sector.index
               m = fs_len[sector.index]
               circos.text(m/2,1.5,label=names(m),col=fs_col[sector.index],cex=1,niceFacing=T,facing="reverse.clockwise",adj=c(1,0.5),xpd=T)
             })
for(i in 1:nrow(fs_dt)) {
  circos.link(as.character(fs_dt[i,1]),c(0,fs_dt[i,4]), as.character(fs_dt[i,2]),c(0,fs_dt[i,4]), 
              col = rand_color(1, transparency = 0.4), border = NA)
}

#dev.off()

Figure b

dt1=as.data.frame(readxl::read_excel("Supplementary+Table+8.+Fusion_fusionhub_sv_validated_Arv.xlsx",sheet = "Validation"))
dt1$Sample_id=sub("_WTS","",dt1$Sample_id)
dt1$Validation[dt1$Validation!="non-validated"]="validated"
fs_tab=table(dt1$Fusion_gene)
fs=names(fs_tab)[order(fs_tab,decreasing = T)]

library(ComplexHeatmap)
library(circlize)

for(i in 1:length(fs)){
df=dt1[dt1$Fusion_gene==fs[i],]
hdf=data.frame(validated=df$Validation)
rownames(hdf)=df$Sample_id
zero_row_mat = matrix(nrow = 0, ncol = nrow(hdf))
colnames(zero_row_mat) = df$Sample_id
ha = HeatmapAnnotation(df = hdf,gp=gpar(col="black"),col = list(validated=c("validated"="red","non-validated"="green")),show_legend = T,show_annotation_name = T,annotation_name_side ="left")

#pdf(paste("validated_figure/",sub("/","_",fs[i]),"_Fusion_validated",sep=""),height = 2,width=3)
print(Heatmap(zero_row_mat, top_annotation = ha, column_title = fs[i]))
#dev.off()
}