From 1d9da184700e52ec9741d8739a04e34040cc735f Mon Sep 17 00:00:00 2001 From: Stephen Watts Date: Sat, 17 Aug 2024 12:58:14 +1000 Subject: [PATCH 1/3] Switch back to new gene panel column names --- R/purple.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/purple.R b/R/purple.R index 16c00f3..4a358d6 100644 --- a/R/purple.R +++ b/R/purple.R @@ -41,7 +41,7 @@ purple_cnv_som_gene_read <- function(x) { #' #' @param x Path to `purple.cnv.gene.tsv` file. #' @param g Path to gene file containing at least three columns: -#' * `symbol`: gene name (character). +#' * `ensembl_gene_symbol`: gene name (character). #' * `tsgene`: is this gene a tumor suppressor (TRUE/FALSE). #' * `oncogene`: is this gene an oncogene (TRUE/FALSE). #' @@ -64,9 +64,9 @@ purple_cnv_som_gene_process <- function(x, g = NULL) { } genes <- readr::read_tsv(g, col_types = readr::cols( - symbol = "c", oncogene = "l", tumorsuppressor = "l" + ensembl_gene_symbol = "c", oncogene = "l", tumorsuppressor = "l" )) |> - dplyr::select("symbol", "oncogene", tsgene = "tumorsuppressor") + dplyr::select(symbol = "ensembl_gene_symbol", "oncogene", "tsgene") oncogenes <- genes |> dplyr::filter(.data$oncogene) |> dplyr::pull(.data$symbol) From f261120135501ae8656260055dee03eaf38835ff Mon Sep 17 00:00:00 2001 From: Stephen Watts Date: Sat, 17 Aug 2024 12:59:14 +1000 Subject: [PATCH 2/3] Restore changes for latest PURPLE release --- R/purple.R | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/R/purple.R b/R/purple.R index 4a358d6..b269486 100644 --- a/R/purple.R +++ b/R/purple.R @@ -556,7 +556,7 @@ purple_qc_read <- function(x) { "QCStatus", "Method", "CopyNumberSegments", "UnsupportedCopyNumberSegments", "Purity", "AmberGender", "CobaltGender", "DeletedGenes", "Contamination", "GermlineAberrations", - "AmberMeanDepth" + "AmberMeanDepth", "LohPercent" ) assertthat::assert_that(all(purple_qc$key == nm)) @@ -622,7 +622,6 @@ purple_purity_read <- function(x) { "maxPloidy", "d", "minDiploidProportion", "d", "maxDiploidProportion", "d", - "version", "c", "somaticPenalty", "d", "wholeGenomeDuplication", "c", "msIndelsPerMb", "d", From 84af19ed9dfe198c7fc2fcceadbf3d9ff21975e8 Mon Sep 17 00:00:00 2001 From: Stephen Watts Date: Sat, 17 Aug 2024 12:59:32 +1000 Subject: [PATCH 3/3] Fix whitespace and quoting in SV processing Use of quoting places breakend table entries into a single group ("BND_group") rather expected groups according to BND_group column values. --- R/sv.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/sv.R b/R/sv.R index 1803bee..b5fcf69 100644 --- a/R/sv.R +++ b/R/sv.R @@ -161,7 +161,7 @@ sash_read_sv_tsv <- function(x) { } split_svs <- function(x) { - bps_types <- c("BND", "DEL", "DUP", " INS", "INV") + bps_types <- c("BND", "DEL", "DUP", "INS", "INV") x.grouped <- x |> dplyr::group_by( @@ -186,7 +186,7 @@ join_breakpoint_entries <- function(x) { # Group by GRIDSS identifier (clipping trailing h/o [h: High, o: lOwer]) bps <- x |> tidyr::separate("ID", into = c("BND_group", "BND_mate"), sep = -1, convert = TRUE, remove = FALSE) |> - dplyr::group_by("BND_group") + dplyr::group_by(BND_group) # Set a sequential breakpoint identifier bps_groups <- bps |> dplyr::n_groups()