From 08b06df146dfacfd29db286f92094f54efff6ad6 Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Wed, 22 Jul 2020 12:51:48 -0400 Subject: [PATCH 01/16] Update plot_all_events.R --- R/plot_all_events.R | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/R/plot_all_events.R b/R/plot_all_events.R index 7ecedcc..3c8b8eb 100644 --- a/R/plot_all_events.R +++ b/R/plot_all_events.R @@ -218,7 +218,7 @@ plot_all_events <- function( colourCount <- nrow(unique(tmp.table[, .(Hugo_Symbol, HGVSp_Short)])) getPalette <- colorRampPalette(brewer.pal(8, "Set2")) - SNV.SV.plot <- ggplot(tmp.table) + + SNV.SV.plot.log <- ggplot(tmp.table) + geom_line(aes( x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), group = paste0(Hugo_Symbol, "_", HGVSp_Short) @@ -237,7 +237,26 @@ plot_all_events <- function( panel.grid.major = element_blank(), legend.position = "top", legend.box = "vertical", axis.text.x = element_text(angle = 45, hjust = 1, face = "bold") ) - print(SNV.SV.plot) + print(SNV.SV.plot.log) + SNV.SV.plot.linear <- ggplot(tmp.table) + + geom_line(aes( + x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), + color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), group = paste0(Hugo_Symbol, "_", HGVSp_Short) + )) + + geom_point(aes( + x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), + color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), shape = call_confidence + ), size = 1.5) + + labs(title = x, x = "Time Point", y = "VAF") + + scale_shape_manual(values = status_id, name = "Call Status") + + scale_color_manual(values = getPalette(colourCount), name = "Alteration") + + theme_minimal() + + scale_x_date(date_minor_breaks = "1 day", date_breaks = "1 week", date_labels = "%b %d") + + theme( + panel.grid.major = element_blank(), legend.position = "top", legend.box = "vertical", + axis.text.x = element_text(angle = 45, hjust = 1, face = "bold") + ) + print(SNV.SV.plot.linear) if (nrow(tmp.cna) > 0) { tmp.cna <- tmp.cna %>% @@ -261,11 +280,11 @@ plot_all_events <- function( print(CNA.plot) pdf(paste0(output.dir, "/", x, "_all_events.pdf"), width = 10, height = 7) - print(ggarrange(SNV.SV.plot, CNA.plot, ncol = 1, heights = c(2, 1))) + print(ggarrange(SNV.SV.plot.log, CNA.plot, SNV.SV.plot.linear, CNA.plot, ncol = 2, heights = c(2, 1, 2, 1))) dev.off() } else { pdf(paste0(output.dir, "/", x, "_all_events.pdf"), width = 10, height = 7) - print(SNV.SV.plot) + print(ggarrange(SNV.SV.plot.log, SNV.SV.plot.linear, nrow = 2, heights = c(2, 2))) dev.off() } }) From a5b67926f813529bec3cca24ff00ed6bc99ec084 Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Wed, 22 Jul 2020 12:59:43 -0400 Subject: [PATCH 02/16] Update plot_all_events.R --- R/plot_all_events.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/plot_all_events.R b/R/plot_all_events.R index 3c8b8eb..2f6582b 100644 --- a/R/plot_all_events.R +++ b/R/plot_all_events.R @@ -227,7 +227,7 @@ plot_all_events <- function( x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), shape = call_confidence ), size = 1.5) + - labs(title = x, x = "Time Point", y = "VAF") + + labs(title = x, x = "Time Point", y = "VAF(log10)") + scale_shape_manual(values = status_id, name = "Call Status") + scale_color_manual(values = getPalette(colourCount), name = "Alteration") + theme_minimal() + @@ -280,11 +280,11 @@ plot_all_events <- function( print(CNA.plot) pdf(paste0(output.dir, "/", x, "_all_events.pdf"), width = 10, height = 7) - print(ggarrange(SNV.SV.plot.log, CNA.plot, SNV.SV.plot.linear, CNA.plot, ncol = 2, heights = c(2, 1, 2, 1))) + print(ggarrange(SNV.SV.plot.log, SNV.SV.plot.linear, CNA.plot, CNA.plot, ncol = 2, nrow = 2, heights = c(2, 2, 1, 1))) dev.off() } else { pdf(paste0(output.dir, "/", x, "_all_events.pdf"), width = 10, height = 7) - print(ggarrange(SNV.SV.plot.log, SNV.SV.plot.linear, nrow = 2, heights = c(2, 2))) + print(ggarrange(SNV.SV.plot.log, SNV.SV.plot.linear, ncol = 2, heights = c(2, 2))) dev.off() } }) From e889eb084c764f8c601cb851ba08429d3866ee7b Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Wed, 22 Jul 2020 13:01:03 -0400 Subject: [PATCH 03/16] Update plot_all_events.R --- R/plot_all_events.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/plot_all_events.R b/R/plot_all_events.R index 2f6582b..5261323 100644 --- a/R/plot_all_events.R +++ b/R/plot_all_events.R @@ -199,14 +199,14 @@ plot_all_events <- function( transform.vector <- structure(as.Date(master.ref[cmo_patient_id == x]$collection_date, "%m/%d/%y"), names = master.ref[cmo_patient_id == x]$cmo_sample_id_plasma ) - print("###Date Presentation:####") - print(transform.vector) + #print("###Date Presentation:####") + #print(transform.vector) } else { transform.vector <- structure(as.character(master.ref[cmo_patient_id == x]$collection_date), names = master.ref[cmo_patient_id == x]$cmo_sample_id_plasma ) - print(transform.vector) + #print(transform.vector) } tmp.table$Tumor_Sample_Barcode <- transform.vector[tmp.table$Tumor_Sample_Barcode] print(tmp.table) From db2e459a1dff9b0b8864ee280732c63726de7910 Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Wed, 22 Jul 2020 13:07:11 -0400 Subject: [PATCH 04/16] Update plot_all_events.R --- R/plot_all_events.R | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/R/plot_all_events.R b/R/plot_all_events.R index 5261323..a485130 100644 --- a/R/plot_all_events.R +++ b/R/plot_all_events.R @@ -227,7 +227,7 @@ plot_all_events <- function( x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), shape = call_confidence ), size = 1.5) + - labs(title = x, x = "Time Point", y = "VAF(log10)") + + labs(title = x, x = "Time Point(weeks)", y = "log10(Variant Allele Frequency)") + scale_shape_manual(values = status_id, name = "Call Status") + scale_color_manual(values = getPalette(colourCount), name = "Alteration") + theme_minimal() + @@ -247,7 +247,7 @@ plot_all_events <- function( x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), shape = call_confidence ), size = 1.5) + - labs(title = x, x = "Time Point", y = "VAF") + + labs(title = x, x = "Time Point(weeks)", y = "Variant Allele Frequency") + scale_shape_manual(values = status_id, name = "Call Status") + scale_color_manual(values = getPalette(colourCount), name = "Alteration") + theme_minimal() + @@ -272,18 +272,18 @@ plot_all_events <- function( getPalette <- colorRampPalette(brewer.pal(8, "Set2")) CNA.plot <- ggplot(tmp.cna) + geom_bar(aes(x = Tumor_Sample_Barcode, y = abs(fc), fill = paste0(Hugo_Symbol, "_", CNA)), position = "dodge", stat = "identity") + - labs(x = "Time Point", y = "Absolute fc") + + labs(x = "Time Point (weeks)", y = "Absolute fold-change") + scale_fill_manual(values = getPalette(colourCount), name = "Alteration") + theme_minimal() + scale_x_date(date_minor_breaks = "1 day", date_breaks = "1 week", date_labels = "%b %d") + theme(panel.grid.major = element_blank(), legend.position = "bottom", axis.text.x = element_text(angle = 45, hjust = 1, face = "bold")) print(CNA.plot) - pdf(paste0(output.dir, "/", x, "_all_events.pdf"), width = 10, height = 7) + pdf(paste0(output.dir, "/", x, "_all_events.pdf"), width = 16, height = 8) print(ggarrange(SNV.SV.plot.log, SNV.SV.plot.linear, CNA.plot, CNA.plot, ncol = 2, nrow = 2, heights = c(2, 2, 1, 1))) dev.off() } else { - pdf(paste0(output.dir, "/", x, "_all_events.pdf"), width = 10, height = 7) + pdf(paste0(output.dir, "/", x, "_all_events.pdf"), width = 16, height = 8) print(ggarrange(SNV.SV.plot.log, SNV.SV.plot.linear, ncol = 2, heights = c(2, 2))) dev.off() } From 0ee708afc41fd2a1bcf5ff6cc3710efaea23eeed Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Wed, 22 Jul 2020 13:13:56 -0400 Subject: [PATCH 05/16] Update plot_all_events.R --- R/plot_all_events.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/plot_all_events.R b/R/plot_all_events.R index a485130..f5b7516 100644 --- a/R/plot_all_events.R +++ b/R/plot_all_events.R @@ -227,7 +227,7 @@ plot_all_events <- function( x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), shape = call_confidence ), size = 1.5) + - labs(title = x, x = "Time Point(weeks)", y = "log10(Variant Allele Frequency)") + + labs(title = x, x = "time point (weeks)", y = "log10(variant allele frequency)") + scale_shape_manual(values = status_id, name = "Call Status") + scale_color_manual(values = getPalette(colourCount), name = "Alteration") + theme_minimal() + @@ -247,7 +247,7 @@ plot_all_events <- function( x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), shape = call_confidence ), size = 1.5) + - labs(title = x, x = "Time Point(weeks)", y = "Variant Allele Frequency") + + labs(title = x, x = "time point (weeks)", y = "variant allele frequency") + scale_shape_manual(values = status_id, name = "Call Status") + scale_color_manual(values = getPalette(colourCount), name = "Alteration") + theme_minimal() + @@ -272,7 +272,7 @@ plot_all_events <- function( getPalette <- colorRampPalette(brewer.pal(8, "Set2")) CNA.plot <- ggplot(tmp.cna) + geom_bar(aes(x = Tumor_Sample_Barcode, y = abs(fc), fill = paste0(Hugo_Symbol, "_", CNA)), position = "dodge", stat = "identity") + - labs(x = "Time Point (weeks)", y = "Absolute fold-change") + + labs(x = "time point (weeks)", y = "absolute fold-change") + scale_fill_manual(values = getPalette(colourCount), name = "Alteration") + theme_minimal() + scale_x_date(date_minor_breaks = "1 day", date_breaks = "1 week", date_labels = "%b %d") + From 5152c02abd800f50bd571247373c7177065b09f7 Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Wed, 22 Jul 2020 13:20:19 -0400 Subject: [PATCH 06/16] Update plot_all_events.R --- R/plot_all_events.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/plot_all_events.R b/R/plot_all_events.R index f5b7516..92dc6e1 100644 --- a/R/plot_all_events.R +++ b/R/plot_all_events.R @@ -217,7 +217,7 @@ plot_all_events <- function( } colourCount <- nrow(unique(tmp.table[, .(Hugo_Symbol, HGVSp_Short)])) - getPalette <- colorRampPalette(brewer.pal(8, "Set2")) + getPalette <- colorRampPalette(brewer.pal(8, "Set3")) SNV.SV.plot.log <- ggplot(tmp.table) + geom_line(aes( x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), From 998c36fba6728b9fc119373367ff9f930b68038d Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Wed, 22 Jul 2020 13:22:47 -0400 Subject: [PATCH 07/16] Update plot_all_events.R --- R/plot_all_events.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/plot_all_events.R b/R/plot_all_events.R index 92dc6e1..3636672 100644 --- a/R/plot_all_events.R +++ b/R/plot_all_events.R @@ -269,7 +269,7 @@ plot_all_events <- function( tmp.cna$Tumor_Sample_Barcode <- transform.vector[tmp.cna$Tumor_Sample_Barcode] colourCount <- nrow(unique(tmp.cna[, .(Hugo_Symbol, CNA)])) - getPalette <- colorRampPalette(brewer.pal(8, "Set2")) + getPalette <- colorRampPalette(brewer.pal(8, "Set3")) CNA.plot <- ggplot(tmp.cna) + geom_bar(aes(x = Tumor_Sample_Barcode, y = abs(fc), fill = paste0(Hugo_Symbol, "_", CNA)), position = "dodge", stat = "identity") + labs(x = "time point (weeks)", y = "absolute fold-change") + From 0b1a4e6e0f30fb0824ff1b2409324779160b9610 Mon Sep 17 00:00:00 2001 From: Youyun Zheng Date: Fri, 24 Jul 2020 10:27:10 -0400 Subject: [PATCH 08/16] Update SV_incorporation.R for debugging on juno --- R/SV_incorporation.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/SV_incorporation.R b/R/SV_incorporation.R index 829b54c..2685215 100644 --- a/R/SV_incorporation.R +++ b/R/SV_incorporation.R @@ -31,6 +31,7 @@ SV_incorporation = function( access.gene.list <- access.genes.info$V1 # x <- unique(master.ref$cmo_patient_id)[1] lapply(unique(master.ref$cmo_patient_id),function(x){ + print(x) # get sample sheet -------------------------------------------------------- sample.sheet <- fread(paste0(results.dir,'/',x,'/',x,'_sample_sheet.tsv')) # get plasma SV calls ----------------------------------------------------- @@ -43,6 +44,7 @@ SV_incorporation = function( # get DMP SV calls -------------------------------------------------------- DMP.sv <- do.call(rbind,lapply(sample.sheet[Sample_Type == 'DMP_Tumor']$Sample_Barcode,function(y){ + print(y) DMP.fusion[DMP_SAMPLE_ID == y] })) if(!is.null(DMP.sv)){ From 47889c70e7026d06658b70fa58702a082bcfadd5 Mon Sep 17 00:00:00 2001 From: Youyun Zheng Date: Fri, 24 Jul 2020 10:32:17 -0400 Subject: [PATCH 09/16] Update SV_incorporation.R --- R/SV_incorporation.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/SV_incorporation.R b/R/SV_incorporation.R index 2685215..4a7dd50 100644 --- a/R/SV_incorporation.R +++ b/R/SV_incorporation.R @@ -36,6 +36,7 @@ SV_incorporation = function( sample.sheet <- fread(paste0(results.dir,'/',x,'/',x,'_sample_sheet.tsv')) # get plasma SV calls ----------------------------------------------------- total.sv <- do.call(rbind,lapply(sample.sheet[Sample_Type == 'duplex']$Sample_Barcode,function(y){ + print(y) SV.filename <- master.ref[cmo_sample_id_plasma == y]$sv_path if(!file.exists(SV.filename)){stop(paste0('SV file: ',SV.filename,' ----- does not exist'))} tmp.SV <- fread(SV.filename) %>% filter(Significance == 'KeyGene') From c422f1d6011665e5fcfaaa13f2a905664c1ad373 Mon Sep 17 00:00:00 2001 From: Youyun Zheng Date: Fri, 24 Jul 2020 10:38:04 -0400 Subject: [PATCH 10/16] Update SV_incorporation.R --- R/SV_incorporation.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/SV_incorporation.R b/R/SV_incorporation.R index 4a7dd50..d6dcd92 100644 --- a/R/SV_incorporation.R +++ b/R/SV_incorporation.R @@ -58,6 +58,9 @@ SV_incorporation = function( DMP.sv <- data.frame(matrix(nrow = 0,ncol = ncol(DMP.fusion))) colnames(DMP.sv) <- colnames(DMP.fusion) } + print('done with reading in') + print(colnames(total.sv)) + print(colnames(DMP.sv)) # event desc. reconciliating possible DMP vs manta ------------------------ rbind(total.sv,DMP.sv) %>% @@ -84,6 +87,7 @@ SV_incorporation = function( # adding some annotation columns specific to snv table -------------------- apply(sample.sheet[Sample_Type != 'plasma_simplex'],1,function(y){ + print(y) current.colname <- paste0(y[which(colnames(sample.sheet) == 'Sample_Barcode')],'___', case_when(y[which(colnames(sample.sheet) == 'Sample_Type')] == 'duplex' ~'total', y[which(colnames(sample.sheet) == 'Sample_Type')] == 'DMP_Tumor' ~'DMP_Tumor', From fecc61211a62984211dc0e2374ce3bda2fc6a495 Mon Sep 17 00:00:00 2001 From: Youyun Zheng Date: Fri, 24 Jul 2020 10:42:28 -0400 Subject: [PATCH 11/16] Update SV_incorporation.R --- R/SV_incorporation.R | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/R/SV_incorporation.R b/R/SV_incorporation.R index d6dcd92..9746335 100644 --- a/R/SV_incorporation.R +++ b/R/SV_incorporation.R @@ -31,12 +31,10 @@ SV_incorporation = function( access.gene.list <- access.genes.info$V1 # x <- unique(master.ref$cmo_patient_id)[1] lapply(unique(master.ref$cmo_patient_id),function(x){ - print(x) # get sample sheet -------------------------------------------------------- sample.sheet <- fread(paste0(results.dir,'/',x,'/',x,'_sample_sheet.tsv')) # get plasma SV calls ----------------------------------------------------- total.sv <- do.call(rbind,lapply(sample.sheet[Sample_Type == 'duplex']$Sample_Barcode,function(y){ - print(y) SV.filename <- master.ref[cmo_sample_id_plasma == y]$sv_path if(!file.exists(SV.filename)){stop(paste0('SV file: ',SV.filename,' ----- does not exist'))} tmp.SV <- fread(SV.filename) %>% filter(Significance == 'KeyGene') @@ -45,7 +43,6 @@ SV_incorporation = function( # get DMP SV calls -------------------------------------------------------- DMP.sv <- do.call(rbind,lapply(sample.sheet[Sample_Type == 'DMP_Tumor']$Sample_Barcode,function(y){ - print(y) DMP.fusion[DMP_SAMPLE_ID == y] })) if(!is.null(DMP.sv)){ @@ -57,6 +54,7 @@ SV_incorporation = function( # dummy df if there is no DMP fusion found DMP.sv <- data.frame(matrix(nrow = 0,ncol = ncol(DMP.fusion))) colnames(DMP.sv) <- colnames(DMP.fusion) + setnames(DMP.sv,'DMP_SAMPLE_ID','TumorId') } print('done with reading in') print(colnames(total.sv)) @@ -87,7 +85,6 @@ SV_incorporation = function( # adding some annotation columns specific to snv table -------------------- apply(sample.sheet[Sample_Type != 'plasma_simplex'],1,function(y){ - print(y) current.colname <- paste0(y[which(colnames(sample.sheet) == 'Sample_Barcode')],'___', case_when(y[which(colnames(sample.sheet) == 'Sample_Type')] == 'duplex' ~'total', y[which(colnames(sample.sheet) == 'Sample_Type')] == 'DMP_Tumor' ~'DMP_Tumor', From 72e05371521992973d0307bcd0432cf78025a55d Mon Sep 17 00:00:00 2001 From: Youyun Zheng Date: Fri, 24 Jul 2020 10:45:45 -0400 Subject: [PATCH 12/16] Update SV_incorporation.R --- R/SV_incorporation.R | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/R/SV_incorporation.R b/R/SV_incorporation.R index 9746335..3fe4356 100644 --- a/R/SV_incorporation.R +++ b/R/SV_incorporation.R @@ -53,8 +53,7 @@ SV_incorporation = function( }else{ # dummy df if there is no DMP fusion found DMP.sv <- data.frame(matrix(nrow = 0,ncol = ncol(DMP.fusion))) - colnames(DMP.sv) <- colnames(DMP.fusion) - setnames(DMP.sv,'DMP_SAMPLE_ID','TumorId') + colnames(DMP.sv) <- colnames(total.sv) } print('done with reading in') print(colnames(total.sv)) From b2dc6a3acede1026aea127fda64014b8b30ad4f2 Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Fri, 24 Jul 2020 11:01:40 -0400 Subject: [PATCH 13/16] Update plot_all_events.R --- R/plot_all_events.R | 73 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/R/plot_all_events.R b/R/plot_all_events.R index 3636672..539a60e 100644 --- a/R/plot_all_events.R +++ b/R/plot_all_events.R @@ -216,6 +216,8 @@ plot_all_events <- function( return() } + if(all(!is.na(as.Date(transform.vector, "%m/%d/%y"))){ + colourCount <- nrow(unique(tmp.table[, .(Hugo_Symbol, HGVSp_Short)])) getPalette <- colorRampPalette(brewer.pal(8, "Set3")) SNV.SV.plot.log <- ggplot(tmp.table) + @@ -287,6 +289,77 @@ plot_all_events <- function( print(ggarrange(SNV.SV.plot.log, SNV.SV.plot.linear, ncol = 2, heights = c(2, 2))) dev.off() } + } + else{ + colourCount <- nrow(unique(tmp.table[, .(Hugo_Symbol, HGVSp_Short)])) + getPalette <- colorRampPalette(brewer.pal(8, "Set3")) + SNV.SV.plot.log <- ggplot(tmp.table) + + geom_line(aes( + x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), + color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), group = paste0(Hugo_Symbol, "_", HGVSp_Short) + )) + + geom_point(aes( + x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), + color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), shape = call_confidence + ), size = 1.5) + + labs(title = x, x = "time point", y = "log10(variant allele frequency)") + + scale_shape_manual(values = status_id, name = "Call Status") + + scale_color_manual(values = getPalette(colourCount), name = "Alteration") + + theme_minimal() + + scale_y_log10() + + theme( + panel.grid.major = element_blank(), legend.position = "top", legend.box = "vertical", + axis.text.x = element_text(angle = 45, hjust = 1, face = "bold") + ) + print(SNV.SV.plot.log) + SNV.SV.plot.linear <- ggplot(tmp.table) + + geom_line(aes( + x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), + color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), group = paste0(Hugo_Symbol, "_", HGVSp_Short) + )) + + geom_point(aes( + x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), + color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), shape = call_confidence + ), size = 1.5) + + labs(title = x, x = "time point", y = "variant allele frequency") + + scale_shape_manual(values = status_id, name = "Call Status") + + scale_color_manual(values = getPalette(colourCount), name = "Alteration") + + theme_minimal() + + theme( + panel.grid.major = element_blank(), legend.position = "top", legend.box = "vertical", + axis.text.x = element_text(angle = 45, hjust = 1, face = "bold") + ) + print(SNV.SV.plot.linear) + + if (nrow(tmp.cna) > 0) { + tmp.cna <- tmp.cna %>% + mutate(Tumor_Sample_Barcode = factor(Tumor_Sample_Barcode, unique(tmp.sample.sheets[Sample_Type == "duplex"]$Sample_Barcode))) %>% + # expand table on all empty samples without any calls + data.table() %>% + dcast.data.table(Hugo_Symbol + CNA ~ Tumor_Sample_Barcode, drop = c(TRUE, FALSE), fill = 0, value.var = "fc") %>% + melt.data.table(id.vars = c("Hugo_Symbol", "CNA"), variable.name = "Tumor_Sample_Barcode", value.name = "fc") %>% + data.table() + tmp.cna$Tumor_Sample_Barcode <- transform.vector[tmp.cna$Tumor_Sample_Barcode] + + colourCount <- nrow(unique(tmp.cna[, .(Hugo_Symbol, CNA)])) + getPalette <- colorRampPalette(brewer.pal(8, "Set3")) + CNA.plot <- ggplot(tmp.cna) + + geom_bar(aes(x = Tumor_Sample_Barcode, y = abs(fc), fill = paste0(Hugo_Symbol, "_", CNA)), position = "dodge", stat = "identity") + + labs(x = "time point", y = "absolute fold-change") + + scale_fill_manual(values = getPalette(colourCount), name = "Alteration") + + theme_minimal() + + theme(panel.grid.major = element_blank(), legend.position = "bottom", axis.text.x = element_text(angle = 45, hjust = 1, face = "bold")) + print(CNA.plot) + + pdf(paste0(output.dir, "/", x, "_all_events.pdf"), width = 16, height = 8) + print(ggarrange(SNV.SV.plot.log, SNV.SV.plot.linear, CNA.plot, CNA.plot, ncol = 2, nrow = 2, heights = c(2, 2, 1, 1))) + dev.off() + } else { + pdf(paste0(output.dir, "/", x, "_all_events.pdf"), width = 16, height = 8) + print(ggarrange(SNV.SV.plot.log, SNV.SV.plot.linear, ncol = 2, heights = c(2, 2))) + dev.off() + } + } }) } From 63e6534e4e10e025a5134d3495130465f56dca8f Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Fri, 24 Jul 2020 11:02:48 -0400 Subject: [PATCH 14/16] Update plot_all_events.R --- R/plot_all_events.R | 273 ++++++++++++++++++++++---------------------- 1 file changed, 136 insertions(+), 137 deletions(-) diff --git a/R/plot_all_events.R b/R/plot_all_events.R index 539a60e..99d67eb 100644 --- a/R/plot_all_events.R +++ b/R/plot_all_events.R @@ -199,14 +199,14 @@ plot_all_events <- function( transform.vector <- structure(as.Date(master.ref[cmo_patient_id == x]$collection_date, "%m/%d/%y"), names = master.ref[cmo_patient_id == x]$cmo_sample_id_plasma ) - #print("###Date Presentation:####") - #print(transform.vector) + # print("###Date Presentation:####") + # print(transform.vector) } else { transform.vector <- structure(as.character(master.ref[cmo_patient_id == x]$collection_date), names = master.ref[cmo_patient_id == x]$cmo_sample_id_plasma ) - #print(transform.vector) + # print(transform.vector) } tmp.table$Tumor_Sample_Barcode <- transform.vector[tmp.table$Tumor_Sample_Barcode] print(tmp.table) @@ -216,150 +216,149 @@ plot_all_events <- function( return() } - if(all(!is.na(as.Date(transform.vector, "%m/%d/%y"))){ - - colourCount <- nrow(unique(tmp.table[, .(Hugo_Symbol, HGVSp_Short)])) - getPalette <- colorRampPalette(brewer.pal(8, "Set3")) - SNV.SV.plot.log <- ggplot(tmp.table) + - geom_line(aes( - x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), - color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), group = paste0(Hugo_Symbol, "_", HGVSp_Short) - )) + - geom_point(aes( - x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), - color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), shape = call_confidence - ), size = 1.5) + - labs(title = x, x = "time point (weeks)", y = "log10(variant allele frequency)") + - scale_shape_manual(values = status_id, name = "Call Status") + - scale_color_manual(values = getPalette(colourCount), name = "Alteration") + - theme_minimal() + - scale_y_log10() + - scale_x_date(date_minor_breaks = "1 day", date_breaks = "1 week", date_labels = "%b %d") + - theme( - panel.grid.major = element_blank(), legend.position = "top", legend.box = "vertical", - axis.text.x = element_text(angle = 45, hjust = 1, face = "bold") - ) - print(SNV.SV.plot.log) - SNV.SV.plot.linear <- ggplot(tmp.table) + - geom_line(aes( - x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), - color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), group = paste0(Hugo_Symbol, "_", HGVSp_Short) - )) + - geom_point(aes( - x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), - color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), shape = call_confidence - ), size = 1.5) + - labs(title = x, x = "time point (weeks)", y = "variant allele frequency") + - scale_shape_manual(values = status_id, name = "Call Status") + - scale_color_manual(values = getPalette(colourCount), name = "Alteration") + - theme_minimal() + - scale_x_date(date_minor_breaks = "1 day", date_breaks = "1 week", date_labels = "%b %d") + - theme( - panel.grid.major = element_blank(), legend.position = "top", legend.box = "vertical", - axis.text.x = element_text(angle = 45, hjust = 1, face = "bold") - ) - print(SNV.SV.plot.linear) - - if (nrow(tmp.cna) > 0) { - tmp.cna <- tmp.cna %>% - mutate(Tumor_Sample_Barcode = factor(Tumor_Sample_Barcode, unique(tmp.sample.sheets[Sample_Type == "duplex"]$Sample_Barcode))) %>% - # expand table on all empty samples without any calls - data.table() %>% - dcast.data.table(Hugo_Symbol + CNA ~ Tumor_Sample_Barcode, drop = c(TRUE, FALSE), fill = 0, value.var = "fc") %>% - melt.data.table(id.vars = c("Hugo_Symbol", "CNA"), variable.name = "Tumor_Sample_Barcode", value.name = "fc") %>% - data.table() - tmp.cna$Tumor_Sample_Barcode <- transform.vector[tmp.cna$Tumor_Sample_Barcode] - - colourCount <- nrow(unique(tmp.cna[, .(Hugo_Symbol, CNA)])) + if (all(!is.na(as.Date(transform.vector, "%m/%d/%y")))) { + colourCount <- nrow(unique(tmp.table[, .(Hugo_Symbol, HGVSp_Short)])) getPalette <- colorRampPalette(brewer.pal(8, "Set3")) - CNA.plot <- ggplot(tmp.cna) + - geom_bar(aes(x = Tumor_Sample_Barcode, y = abs(fc), fill = paste0(Hugo_Symbol, "_", CNA)), position = "dodge", stat = "identity") + - labs(x = "time point (weeks)", y = "absolute fold-change") + - scale_fill_manual(values = getPalette(colourCount), name = "Alteration") + + SNV.SV.plot.log <- ggplot(tmp.table) + + geom_line(aes( + x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), + color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), group = paste0(Hugo_Symbol, "_", HGVSp_Short) + )) + + geom_point(aes( + x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), + color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), shape = call_confidence + ), size = 1.5) + + labs(title = x, x = "time point (weeks)", y = "log10(variant allele frequency)") + + scale_shape_manual(values = status_id, name = "Call Status") + + scale_color_manual(values = getPalette(colourCount), name = "Alteration") + theme_minimal() + + scale_y_log10() + scale_x_date(date_minor_breaks = "1 day", date_breaks = "1 week", date_labels = "%b %d") + - theme(panel.grid.major = element_blank(), legend.position = "bottom", axis.text.x = element_text(angle = 45, hjust = 1, face = "bold")) - print(CNA.plot) + theme( + panel.grid.major = element_blank(), legend.position = "top", legend.box = "vertical", + axis.text.x = element_text(angle = 45, hjust = 1, face = "bold") + ) + print(SNV.SV.plot.log) + SNV.SV.plot.linear <- ggplot(tmp.table) + + geom_line(aes( + x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), + color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), group = paste0(Hugo_Symbol, "_", HGVSp_Short) + )) + + geom_point(aes( + x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), + color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), shape = call_confidence + ), size = 1.5) + + labs(title = x, x = "time point (weeks)", y = "variant allele frequency") + + scale_shape_manual(values = status_id, name = "Call Status") + + scale_color_manual(values = getPalette(colourCount), name = "Alteration") + + theme_minimal() + + scale_x_date(date_minor_breaks = "1 day", date_breaks = "1 week", date_labels = "%b %d") + + theme( + panel.grid.major = element_blank(), legend.position = "top", legend.box = "vertical", + axis.text.x = element_text(angle = 45, hjust = 1, face = "bold") + ) + print(SNV.SV.plot.linear) - pdf(paste0(output.dir, "/", x, "_all_events.pdf"), width = 16, height = 8) - print(ggarrange(SNV.SV.plot.log, SNV.SV.plot.linear, CNA.plot, CNA.plot, ncol = 2, nrow = 2, heights = c(2, 2, 1, 1))) - dev.off() - } else { - pdf(paste0(output.dir, "/", x, "_all_events.pdf"), width = 16, height = 8) - print(ggarrange(SNV.SV.plot.log, SNV.SV.plot.linear, ncol = 2, heights = c(2, 2))) - dev.off() - } - } - else{ - colourCount <- nrow(unique(tmp.table[, .(Hugo_Symbol, HGVSp_Short)])) - getPalette <- colorRampPalette(brewer.pal(8, "Set3")) - SNV.SV.plot.log <- ggplot(tmp.table) + - geom_line(aes( - x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), - color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), group = paste0(Hugo_Symbol, "_", HGVSp_Short) - )) + - geom_point(aes( - x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), - color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), shape = call_confidence - ), size = 1.5) + - labs(title = x, x = "time point", y = "log10(variant allele frequency)") + - scale_shape_manual(values = status_id, name = "Call Status") + - scale_color_manual(values = getPalette(colourCount), name = "Alteration") + - theme_minimal() + - scale_y_log10() + - theme( - panel.grid.major = element_blank(), legend.position = "top", legend.box = "vertical", - axis.text.x = element_text(angle = 45, hjust = 1, face = "bold") - ) - print(SNV.SV.plot.log) - SNV.SV.plot.linear <- ggplot(tmp.table) + - geom_line(aes( - x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), - color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), group = paste0(Hugo_Symbol, "_", HGVSp_Short) - )) + - geom_point(aes( - x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), - color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), shape = call_confidence - ), size = 1.5) + - labs(title = x, x = "time point", y = "variant allele frequency") + - scale_shape_manual(values = status_id, name = "Call Status") + - scale_color_manual(values = getPalette(colourCount), name = "Alteration") + - theme_minimal() + - theme( - panel.grid.major = element_blank(), legend.position = "top", legend.box = "vertical", - axis.text.x = element_text(angle = 45, hjust = 1, face = "bold") - ) - print(SNV.SV.plot.linear) + if (nrow(tmp.cna) > 0) { + tmp.cna <- tmp.cna %>% + mutate(Tumor_Sample_Barcode = factor(Tumor_Sample_Barcode, unique(tmp.sample.sheets[Sample_Type == "duplex"]$Sample_Barcode))) %>% + # expand table on all empty samples without any calls + data.table() %>% + dcast.data.table(Hugo_Symbol + CNA ~ Tumor_Sample_Barcode, drop = c(TRUE, FALSE), fill = 0, value.var = "fc") %>% + melt.data.table(id.vars = c("Hugo_Symbol", "CNA"), variable.name = "Tumor_Sample_Barcode", value.name = "fc") %>% + data.table() + tmp.cna$Tumor_Sample_Barcode <- transform.vector[tmp.cna$Tumor_Sample_Barcode] - if (nrow(tmp.cna) > 0) { - tmp.cna <- tmp.cna %>% - mutate(Tumor_Sample_Barcode = factor(Tumor_Sample_Barcode, unique(tmp.sample.sheets[Sample_Type == "duplex"]$Sample_Barcode))) %>% - # expand table on all empty samples without any calls - data.table() %>% - dcast.data.table(Hugo_Symbol + CNA ~ Tumor_Sample_Barcode, drop = c(TRUE, FALSE), fill = 0, value.var = "fc") %>% - melt.data.table(id.vars = c("Hugo_Symbol", "CNA"), variable.name = "Tumor_Sample_Barcode", value.name = "fc") %>% - data.table() - tmp.cna$Tumor_Sample_Barcode <- transform.vector[tmp.cna$Tumor_Sample_Barcode] + colourCount <- nrow(unique(tmp.cna[, .(Hugo_Symbol, CNA)])) + getPalette <- colorRampPalette(brewer.pal(8, "Set3")) + CNA.plot <- ggplot(tmp.cna) + + geom_bar(aes(x = Tumor_Sample_Barcode, y = abs(fc), fill = paste0(Hugo_Symbol, "_", CNA)), position = "dodge", stat = "identity") + + labs(x = "time point (weeks)", y = "absolute fold-change") + + scale_fill_manual(values = getPalette(colourCount), name = "Alteration") + + theme_minimal() + + scale_x_date(date_minor_breaks = "1 day", date_breaks = "1 week", date_labels = "%b %d") + + theme(panel.grid.major = element_blank(), legend.position = "bottom", axis.text.x = element_text(angle = 45, hjust = 1, face = "bold")) + print(CNA.plot) - colourCount <- nrow(unique(tmp.cna[, .(Hugo_Symbol, CNA)])) + pdf(paste0(output.dir, "/", x, "_all_events.pdf"), width = 16, height = 8) + print(ggarrange(SNV.SV.plot.log, SNV.SV.plot.linear, CNA.plot, CNA.plot, ncol = 2, nrow = 2, heights = c(2, 2, 1, 1))) + dev.off() + } else { + pdf(paste0(output.dir, "/", x, "_all_events.pdf"), width = 16, height = 8) + print(ggarrange(SNV.SV.plot.log, SNV.SV.plot.linear, ncol = 2, heights = c(2, 2))) + dev.off() + } + } + else { + colourCount <- nrow(unique(tmp.table[, .(Hugo_Symbol, HGVSp_Short)])) getPalette <- colorRampPalette(brewer.pal(8, "Set3")) - CNA.plot <- ggplot(tmp.cna) + - geom_bar(aes(x = Tumor_Sample_Barcode, y = abs(fc), fill = paste0(Hugo_Symbol, "_", CNA)), position = "dodge", stat = "identity") + - labs(x = "time point", y = "absolute fold-change") + - scale_fill_manual(values = getPalette(colourCount), name = "Alteration") + + SNV.SV.plot.log <- ggplot(tmp.table) + + geom_line(aes( + x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), + color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), group = paste0(Hugo_Symbol, "_", HGVSp_Short) + )) + + geom_point(aes( + x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), + color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), shape = call_confidence + ), size = 1.5) + + labs(title = x, x = "time point", y = "log10(variant allele frequency)") + + scale_shape_manual(values = status_id, name = "Call Status") + + scale_color_manual(values = getPalette(colourCount), name = "Alteration") + + theme_minimal() + + scale_y_log10() + + theme( + panel.grid.major = element_blank(), legend.position = "top", legend.box = "vertical", + axis.text.x = element_text(angle = 45, hjust = 1, face = "bold") + ) + print(SNV.SV.plot.log) + SNV.SV.plot.linear <- ggplot(tmp.table) + + geom_line(aes( + x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), + color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), group = paste0(Hugo_Symbol, "_", HGVSp_Short) + )) + + geom_point(aes( + x = Tumor_Sample_Barcode, y = ifelse(t_total_count == 0, 0, as.numeric(t_alt_count / t_total_count)), + color = paste0(Hugo_Symbol, " ", ifelse(grepl("^p\\.", HGVSp_Short), HGVSp_Short, "")), shape = call_confidence + ), size = 1.5) + + labs(title = x, x = "time point", y = "variant allele frequency") + + scale_shape_manual(values = status_id, name = "Call Status") + + scale_color_manual(values = getPalette(colourCount), name = "Alteration") + theme_minimal() + - theme(panel.grid.major = element_blank(), legend.position = "bottom", axis.text.x = element_text(angle = 45, hjust = 1, face = "bold")) - print(CNA.plot) + theme( + panel.grid.major = element_blank(), legend.position = "top", legend.box = "vertical", + axis.text.x = element_text(angle = 45, hjust = 1, face = "bold") + ) + print(SNV.SV.plot.linear) - pdf(paste0(output.dir, "/", x, "_all_events.pdf"), width = 16, height = 8) - print(ggarrange(SNV.SV.plot.log, SNV.SV.plot.linear, CNA.plot, CNA.plot, ncol = 2, nrow = 2, heights = c(2, 2, 1, 1))) - dev.off() - } else { - pdf(paste0(output.dir, "/", x, "_all_events.pdf"), width = 16, height = 8) - print(ggarrange(SNV.SV.plot.log, SNV.SV.plot.linear, ncol = 2, heights = c(2, 2))) - dev.off() + if (nrow(tmp.cna) > 0) { + tmp.cna <- tmp.cna %>% + mutate(Tumor_Sample_Barcode = factor(Tumor_Sample_Barcode, unique(tmp.sample.sheets[Sample_Type == "duplex"]$Sample_Barcode))) %>% + # expand table on all empty samples without any calls + data.table() %>% + dcast.data.table(Hugo_Symbol + CNA ~ Tumor_Sample_Barcode, drop = c(TRUE, FALSE), fill = 0, value.var = "fc") %>% + melt.data.table(id.vars = c("Hugo_Symbol", "CNA"), variable.name = "Tumor_Sample_Barcode", value.name = "fc") %>% + data.table() + tmp.cna$Tumor_Sample_Barcode <- transform.vector[tmp.cna$Tumor_Sample_Barcode] + + colourCount <- nrow(unique(tmp.cna[, .(Hugo_Symbol, CNA)])) + getPalette <- colorRampPalette(brewer.pal(8, "Set3")) + CNA.plot <- ggplot(tmp.cna) + + geom_bar(aes(x = Tumor_Sample_Barcode, y = abs(fc), fill = paste0(Hugo_Symbol, "_", CNA)), position = "dodge", stat = "identity") + + labs(x = "time point", y = "absolute fold-change") + + scale_fill_manual(values = getPalette(colourCount), name = "Alteration") + + theme_minimal() + + theme(panel.grid.major = element_blank(), legend.position = "bottom", axis.text.x = element_text(angle = 45, hjust = 1, face = "bold")) + print(CNA.plot) + + pdf(paste0(output.dir, "/", x, "_all_events.pdf"), width = 16, height = 8) + print(ggarrange(SNV.SV.plot.log, SNV.SV.plot.linear, CNA.plot, CNA.plot, ncol = 2, nrow = 2, heights = c(2, 2, 1, 1))) + dev.off() + } else { + pdf(paste0(output.dir, "/", x, "_all_events.pdf"), width = 16, height = 8) + print(ggarrange(SNV.SV.plot.log, SNV.SV.plot.linear, ncol = 2, heights = c(2, 2))) + dev.off() + } } - } }) } From 80d05e4a546d8c1bfe61af0f3576d3d73180d751 Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Fri, 24 Jul 2020 11:03:34 -0400 Subject: [PATCH 15/16] Update plot_all_events.R --- R/plot_all_events.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/plot_all_events.R b/R/plot_all_events.R index 99d67eb..4f8b143 100644 --- a/R/plot_all_events.R +++ b/R/plot_all_events.R @@ -209,7 +209,7 @@ plot_all_events <- function( # print(transform.vector) } tmp.table$Tumor_Sample_Barcode <- transform.vector[tmp.table$Tumor_Sample_Barcode] - print(tmp.table) + #print(tmp.table) if (nrow(tmp.table) == 0 | all(tmp.table$t_alt_count == 0)) { print("skiping to the next") if (nrow(tmp.cna)) stop(paste0("Need to make CNA only file for: ", x)) From 892e7a0c5fe9776ab154e5e5616e9d93d43d888c Mon Sep 17 00:00:00 2001 From: Ronak Shah Date: Fri, 24 Jul 2020 13:17:59 -0400 Subject: [PATCH 16/16] patch version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1a42ba6..3d759af 100644 --- a/README.md +++ b/README.md @@ -7,5 +7,5 @@ Scripts for downstream analysis plotting of pipeline output ## Documentation -https://msk-access.gitbook.io/access-data-analysis-v1/analysis/compile-reads +https://msk-access.gitbook.io/access-data-analysis-v1/