####Load packages needed for analysis#### library(readr) library(maftools) library(haven) ####Load datasets ##### LMMC_Oligo_V <- read_delim("Todas_LMMCsOligos_revisado.tsv", "\t", escape_double = FALSE, trim_ws = TRUE) LMMC_Oligo_CL <- read_sav("LMMC y Oligo 31.01.20 (40 oligos, 23 SMD, 14 NPMs, 56 LMMCs y 102 reactivas).sav") colnames(LMMC_Oligo_CL)[5] <- "Tumor_Sample_Barcode" ####Recode variables to fit in maftools object#### LMMC_Oligo_V$Sample <- gsub("QIAseq-DNA-smCounter2.", "", LMMC_Oligo_V$Sample) LMMC_Oligo_V$Sample <- gsub(".smCounter.anno", "", LMMC_Oligo_V$Sample) LMMC_Oligo_V$Sample <- gsub("^.*\\.", "", LMMC_Oligo_V$Sample) LMMC_Oligo_V$Sample <- gsub("_.*$", "", LMMC_Oligo_V$Sample) colnames(LMMC_Oligo_V)[2] <- "Hugo_Symbol" colnames(LMMC_Oligo_V)[3] <- "Chromosome" colnames(LMMC_Oligo_V)[4] <- "Start_Position" LMMC_Oligo_V$End_Position <- LMMC_Oligo_V$Start_Position LMMC_Oligo_V$Reference_Allele <- gsub(">.*$", "", LMMC_Oligo_V$Variant) LMMC_Oligo_V$Tumor_Seq_Allele2 <- gsub("^.*>.*\\/", "", LMMC_Oligo_V$Variant) colnames(LMMC_Oligo_V)[19] <- "Variant_Classification" colnames(LMMC_Oligo_V)[9] <- "Variant_Type" colnames(LMMC_Oligo_V)[1] <- "Tumor_Sample_Barcode" unique(LMMC_Oligo_V$Variant_Classification) LMMC_Oligo_V$Variant_Classification[grepl("missense_variant", LMMC_Oligo_V$Variant_Classification)] <- "Missense_Mutation" LMMC_Oligo_V$Variant_Classification[grepl("stop_gained", LMMC_Oligo_V$Variant_Classification)] <- "Nonsense_Mutation" LMMC_Oligo_V$Variant_Classification[grepl("frameshift_variant", LMMC_Oligo_V$Variant_Classification)] <- "Frame_Shift_Ins" LMMC_Oligo_V$Variant_Classification[grepl("splice_acceptor_variant", LMMC_Oligo_V$Variant_Classification)] <- "Splice_Site" LMMC_Oligo_V$Variant_Classification[grepl("splice_donor_variant", LMMC_Oligo_V$Variant_Classification)] <- "Splice_Site" LMMC_Oligo_V$Variant_Classification[grepl("inframe_deletion", LMMC_Oligo_V$Variant_Classification)] <- "In_Frame_Del" LMMC_Oligo_V$Variant_Type[grepl("snv", LMMC_Oligo_V$Variant_Type)] <- "SNP" LMMC_Oligo_V$Variant_Type[grepl("deletion", LMMC_Oligo_V$Variant_Type)] <- "DEL" LMMC_Oligo_V$Variant_Type[grepl("insertion", LMMC_Oligo_V$Variant_Type)] <- "INS" LMMC_Oligo_V$Variant_Type[grepl("mnp", LMMC_Oligo_V$Variant_Type)] <- "SNP" unique(LMMC_Oligo_V$Classification) LMMC_Oligo_2 <- LMMC_Oligo_V[LMMC_Oligo_V$Classification == "Pathogenic" | LMMC_Oligo_V$Classification == "Presumed Pathogenic",] # genes <- c("ASXL1", "CALR", "CEBPA", "CSF3R", "DNMT3A", "ETV6", "EZH2", "IDH1", # "IDH2", "JAK2", "KIT", "KRAS", "MPL", "NRAS", "PRPF8", "RUNX1", # "SETBP1", "SF3B1", "SH2B3", "SRSF2", "STAG2", "TET2", "TP53", "U2AF1", # "ZRSR2") ###Specify shaed genes per panel #### genes <- c('ASXL1', 'CALR', 'CBL', 'CSF3R', 'DNMT3A', 'ETV6', 'EZH2', 'IDH1', 'IDH2', 'JAK2', 'KIT', 'KRAS', 'MPL', 'NRAS', 'PRPF8', 'RUNX1', 'SETBP1', 'SF3B1', 'SH2B3', 'SRSF2', 'STAG2', 'TET2', 'TP53', 'U2AF1', 'ZRSR2', 'CBL_FALSE') genes2 <- c('ASXL1', 'CALR', 'CBL', 'CSF3R', 'DNMT3A', 'ETV6', 'EZH2', 'IDH1', 'IDH2', 'JAK2', 'KIT', 'KRAS', 'MPL', 'NRAS', 'PRPF8', 'RUNX1', 'SETBP1', 'SF3B1', 'SH2B3', 'SRSF2', 'STAG2', 'TET2', 'TP53', 'U2AF1', 'ZRSR2') library(dplyr) LMMC_Oligo_2 <- LMMC_Oligo_2[LMMC_Oligo_2$Hugo_Symbol %in% genes,] LMMC_Oligo_CL$clasificacion <- factor(LMMC_Oligo_CL$clasificacion, labels = c("Oligo", "LMMC", "SMD", "NPMS", "Reactivos", "Otras")) colnames(LMMC_Oligo_CL)[11] <- "Study_group" library(plyr); library(dplyr) multihit_data <- ddply(LMMC_Oligo_2,.(Tumor_Sample_Barcode,Hugo_Symbol),nrow) colnames(multihit_data)[3] <- "MultiHit" LMMC_Oligo_2 <- left_join(LMMC_Oligo_2, multihit_data) #LMMC_Oligo_2$MultiHit[LMMC_Oligo_2$MultiHit > 1] <- "2" LMMC_Oligo_CL$CG_alt <- factor(LMMC_Oligo_CL$CG_alt, levels = c(0,1), labels = c("No", "Yes")) LMMC_Oligo_CL$IFSPmonosMO1 <- factor(LMMC_Oligo_CL$IFSPmonosMO1, levels = c(1,2), labels = c("MO1>94%", "MO1<94%")) ####Generate maftools objects and plotting #### LMMC_Oligo_MAF <- read.maf(LMMC_Oligo_2, clinicalData = LMMC_Oligo_CL) library(RColorBrewer) vc_cols = RColorBrewer::brewer.pal(n = 8, name = 'Paired') vc_cols = c("#A6CEE3","darkolivegreen3", "cornflowerblue", "#33A02C","coral","#E31A1C","#FDBF6F", "#FF7F00") names(vc_cols) = c( 'Frame_Shift_Del', 'Missense_Mutation', 'Nonsense_Mutation', 'Multi_Hit', 'Frame_Shift_Ins', 'In_Frame_Ins', 'Splice_Site', 'In_Frame_Del' ) CL_colors = c("#D53E4F", "#99D594") CL_colors = RColorBrewer::brewer.pal(n = 6,name = 'Spectral') names(CL_colors) = c("Oligo", "LMMC") CL_colors = list("Study group" = CL_colors) pdf("Summary_all.pdf", width = 14) plotmafSummary(maf = LMMC_Oligo_MAF, color = vc_cols, rmOutlier = TRUE, addStat = 'median', dashboard = TRUE, titvRaw = FALSE) dev.off() pdf("Oncoplot_all_v2.pdf", width = 14) oncoplot(maf = LMMC_Oligo_MAF, top = 25, colors = vc_cols, # annotationColor = CL_colors, clinicalFeatures = c("Study_group", "IFSPmonosMO1", "CG_alt"), additionalFeature = c("MultiHit", "2"), sortByAnnotation = TRUE, genes = genes2,removeNonMutated = FALSE) dev.off() pdf("Oncoplot_all_with_names.pdf", width = 14) oncoplot(maf = LMMC_Oligo_MAF, top = 25, colors = vc_cols, #annotationColor = CL_colors, sortByAnnotation = TRUE, genes = genes2, removeNonMutated = FALSE, showTumorSampleBarcodes = TRUE, SampleNamefontSize = 0.7, clinicalFeatures = c("Study_group", "IFSPmonosMO1", "CG_alt"), additionalFeature = list(c("MultiHit", "2"), c("MultiHit", "3"), c("MultiHit", "4"), c("MultiHit", "5")), additionalFeatureCol = c("white", "gray80", "gray60", "gray40")) dev.off() pdf("SomaticInteractions_all.pdf") somaticInteractions(maf = LMMC_Oligo_MAF, pvalue = c(0.05, 0.1), returnAll = TRUE, geneOrder = NULL, fontSize = 0.8, showSigSymbols = TRUE,genes = genes, showCounts = FALSE, countStats = 'sig', countType = 'all', countsFontSize = 10, countsFontColor = "white", colPal = "BrBG") dev.off() LMMC_samples <- LMMC_Oligo_CL$Tumor_Sample_Barcode[LMMC_Oligo_CL$Study_group == "LMMC"] Oligo_samples <- LMMC_Oligo_CL$Tumor_Sample_Barcode[LMMC_Oligo_CL$Study_group == "Oligo"] all_samples <- c(LMMC_samples, Oligo_samples) setdiff(all_samples, LMMC_Oligo_2$Tumor_Sample_Barcode) LMMC_V <- LMMC_Oligo_2[LMMC_Oligo_2$Tumor_Sample_Barcode %in% LMMC_samples,] Oligo_V <- LMMC_Oligo_2[LMMC_Oligo_2$Tumor_Sample_Barcode %in% Oligo_samples,] LMMC_MAF <- read.maf(LMMC_V, clinicalData = LMMC_Oligo_CL) unique(LMMC_V$Tumor_Sample_Barcode) Oligo_MAF <- read.maf(Oligo_V, clinicalData = LMMC_Oligo_CL) CL_colors = c("#D53E4F", "#99D594") CL_colors = RColorBrewer::brewer.pal(n = 4,name = 'Spectral') names(CL_colors) = c("MO1<94%", "MO1>94%", "Yes", "No") CL_colors = list("IFSPmonosMO1" = CL_colors[1:2], "CG_alt" = CL_colors[3:4] ) pdf("Oncoplot_LMMC.pdf", width = 14) oncoplot(maf = LMMC_MAF, top = 25, colors = vc_cols, annotationColor = CL_colors, sortByAnnotation = TRUE, genes = genes2, clinicalFeatures = c("IFSPmonosMO1", "CG_alt"), removeNonMutated = FALSE, showTitle = FALSE, additionalFeature = list(c("MultiHit", "2"), c("MultiHit", "3"), c("MultiHit", "4"), c("MultiHit", "5")), additionalFeatureCol = c("white", "gray80", "gray60", "gray40"), additionalFeaturePch = c(15,16,17,18)) dev.off() pdf("Oncoplot_Oligo.pdf", width = 14) oncoplot(maf = Oligo_MAF, top = 25, colors = vc_cols, annotationColor = CL_colors, sortByAnnotation = TRUE, genes = genes2, clinicalFeatures = c("IFSPmonosMO1", "CG_alt"), removeNonMutated = FALSE, showTitle = FALSE, additionalFeature = list(c("MultiHit", "2"), c("MultiHit", "3"), c("MultiHit", "4"), c("MultiHit", "5")), additionalFeatureCol = c("white", "gray80", "gray60", "gray40"), additionalFeaturePch = c(15,16,17,18)) dev.off() coOncoplot(m1 = LMMC_MAF, m2 = Oligo_MAF, m1Name = 'LMMC', m2Name = 'Oligo', colors = vc_cols, removeNonMutated = TRUE) LMMC_vs_Oligo <- mafCompare(m1 = LMMC_MAF, m2 = Oligo_MAF, m1Name = 'LMMC', m2Name = 'Oligo', minMut = 5) dev.off() forestPlot(mafCompareRes = LMMC_vs_Oligo, pVal = 0.2, color = c('royalblue', 'maroon'), geneFontSize = 0.8) dev.off() pdf("Lollipop.pdf") lollipopPlot2(m1 = LMMC_MAF, m2 = Oligo_MAF, gene = "TET2", AACol1 = "HGVSp", AACol2 = "HGVSp", m1_name = "LMMC", m2_name = "Oligo") lollipopPlot2(m1 = LMMC_MAF, m2 = Oligo_MAF, gene = "SRSF2", AACol1 = "HGVSp", AACol2 = "HGVSp", m1_name = "LMMC", m2_name = "Oligo") lollipopPlot2(m1 = LMMC_MAF, m2 = Oligo_MAF, gene = "ASXL1", AACol1 = "HGVSp", AACol2 = "HGVSp", m1_name = "LMMC", m2_name = "Oligo") lollipopPlot2(m1 = LMMC_MAF, m2 = Oligo_MAF, gene = "SF3B1", AACol1 = "HGVSp", AACol2 = "HGVSp", m1_name = "LMMC", m2_name = "Oligo") lollipopPlot2(m1 = LMMC_MAF, m2 = Oligo_MAF, gene = "ZRSR2", AACol1 = "HGVSp", AACol2 = "HGVSp", m1_name = "LMMC", m2_name = "Oligo") lollipopPlot2(m1 = LMMC_MAF, m2 = Oligo_MAF, gene = "DNMT3A", AACol1 = "HGVSp", AACol2 = "HGVSp", m1_name = "LMMC", m2_name = "Oligo") lollipopPlot2(m1 = LMMC_MAF, m2 = Oligo_MAF, gene = "KRAS", AACol1 = "HGVSp", AACol2 = "HGVSp", m1_name = "LMMC", m2_name = "Oligo") lollipopPlot2(m1 = LMMC_MAF, m2 = Oligo_MAF, gene = "NRAS", AACol1 = "HGVSp", AACol2 = "HGVSp", m1_name = "LMMC", m2_name = "Oligo") dev.off() pdf("SomaticInteractions_LMMC.pdf") somaticInteractions(maf = LMMC_MAF, pvalue = c(0.05, 0.1), returnAll = TRUE, geneOrder = NULL, fontSize = 0.8, showSigSymbols = TRUE,genes = genes, showCounts = FALSE, countStats = 'sig', countType = 'all', countsFontSize = 10, countsFontColor = "white", colPal = "BrBG") dev.off() pdf("SomaticInteractions_Oligo.pdf") somaticInteractions(maf = Oligo_MAF, pvalue = c(0.05, 0.1), returnAll = TRUE, geneOrder = NULL, fontSize = 0.8, showSigSymbols = TRUE,genes = genes, showCounts = FALSE, countStats = 'sig', countType = 'all', countsFontSize = 10, countsFontColor = "white", colPal = "BrBG") dev.off() fab.ce = clinicalEnrichment(maf = LMMC_Oligo_MAF, clinicalFeature = 'Study_group') fab.ce$groupwise_comparision[p_value < 0.05] plotEnrichmentResults(enrich_res = fab.ce, pVal = 0.05) #Split TET2 mutations LMMC_Oligo_TET <- LMMC_Oligo_2 LMMC_Oligo_TET$Hugo_Symbol[LMMC_Oligo_TET$Hugo_Symbol == "TET2" & LMMC_Oligo_TET$Variant_Classification == "Missense_Mutation"] <- "TET2_b" LMMC_Oligo_TET$Hugo_Symbol[LMMC_Oligo_TET$Hugo_Symbol == "TET2" & LMMC_Oligo_TET$Variant_Classification == "Nonsense_Mutation"] <- "TET2_a" LMMC_Oligo_TET$Hugo_Symbol[LMMC_Oligo_TET$Hugo_Symbol == "TET2" & LMMC_Oligo_TET$Variant_Classification == "Frame_Shift_Ins"] <- "TET2_c" LMMC_Oligo_TET$Hugo_Symbol[LMMC_Oligo_TET$Hugo_Symbol == "TET2" & LMMC_Oligo_TET$Variant_Classification == "Splice_Site"] <- "TET2_s" LMMC_Oligo_TET$Hugo_Symbol[LMMC_Oligo_TET$Hugo_Symbol == "TET2" & LMMC_Oligo_TET$Variant_Classification == "In_Frame_Del"] <- "TET2_id" LMMC_V_TET <- LMMC_Oligo_TET[LMMC_Oligo_TET$Tumor_Sample_Barcode %in% LMMC_samples,] Oligo_V_TET <- LMMC_Oligo_TET[LMMC_Oligo_TET$Tumor_Sample_Barcode %in% Oligo_samples,] LMMC_TET <- read.maf(LMMC_V_TET, clinicalData = LMMC_Oligo_CL) Oligo_TET <- read.maf(Oligo_V_TET, clinicalData = LMMC_Oligo_CL) pdf("Oncostrip_TET2_LMMC.pdf", width = 35) oncostrip(maf = LMMC_TET, genes = c('TET2_a','TET2_b', 'TET2_c', 'TET2_s'), colors = vc_cols, removeNonMutated = FALSE, fontSize = 1.5, showTitle = FALSE) dev.off() pdf("Oncostrip_TET2_Oligo.pdf", width = 35) oncostrip(maf = Oligo_TET, genes = c('TET2_a','TET2_b', 'TET2_c', 'TET2_s'), colors = vc_cols, removeNonMutated = FALSE, fontSize = 1.5, showTitle = FALSE) dev.off()