From 5e8a020018393a5b2b7ac356e05eb73028afe89a Mon Sep 17 00:00:00 2001 From: kpjonsson Date: Fri, 30 Aug 2019 13:45:34 -0400 Subject: [PATCH 1/2] cleaning up my mess --- geneLevel.R | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/geneLevel.R b/geneLevel.R index 604c67f..ae16a11 100755 --- a/geneLevel.R +++ b/geneLevel.R @@ -329,12 +329,12 @@ get_gene_level_calls <- function(cncf_files, # CCS filter flag amplifications and homdels at given thresholds ccs_filter = case_when( FACETS_CALL.em %in% c("AMP","AMP (LOH)","AMP (BALANCED)") & - seg.len < max_seg_length & (tcn.em > 8 | count <= 10 | ( !is.na(purity) & cf.em > CFcut )) ~ TRUE, - FACETS_CALL.em == "HOMDEL" & seg.len < max_seg_length & count <= 10 ~ TRUE, - TRUE ~ FALSE), + !(seg.len < max_seg_length & (tcn.em > 8 | count <= 10 | ( !is.na(purity) & cf.em > CFcut ))) ~ 'FAIL', + FACETS_CALL.em == "HOMDEL" & !(seg.len < max_seg_length & count <= 10) ~ 'FAIL', + TRUE ~ 'PASS'), # Flag for review certain homdels - review = ccs_filter == TRUE & FACETS_CALL.em == "HOMDEL" & - Hugo_Symbol %in% unique(oncokb_tsg$hugoSymbol) & seg.len < 25000000 + review = ifelse(ccs_filter == TRUE & FACETS_CALL.em == "HOMDEL" & + Hugo_Symbol %in% unique(oncokb_tsg$hugoSymbol) & seg.len < 25000000, 'rescue', '') ) # homdeltsg_review = filter(genelevelcalls0, FACETS_CALL.em == "ccs_filter", FACETS_CALL.ori == "HOMDEL", Hugo_Symbol %in% unique(oncokb_tsg$hugoSymbol), seg.len < 25000000) @@ -435,3 +435,4 @@ if(!interactive()){ write.text(ascna_output, ascna_outfile) } } + From 42b3f6da90debab26077c8cd209fa271a34ae975 Mon Sep 17 00:00:00 2001 From: kpjonsson Date: Fri, 30 Aug 2019 13:54:03 -0400 Subject: [PATCH 2/2] fix --- geneLevel.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/geneLevel.R b/geneLevel.R index ae16a11..c5f3ad7 100755 --- a/geneLevel.R +++ b/geneLevel.R @@ -333,8 +333,8 @@ get_gene_level_calls <- function(cncf_files, FACETS_CALL.em == "HOMDEL" & !(seg.len < max_seg_length & count <= 10) ~ 'FAIL', TRUE ~ 'PASS'), # Flag for review certain homdels - review = ifelse(ccs_filter == TRUE & FACETS_CALL.em == "HOMDEL" & - Hugo_Symbol %in% unique(oncokb_tsg$hugoSymbol) & seg.len < 25000000, 'rescue', '') + review = ifelse(ccs_filter == 'FAIL' & FACETS_CALL.em == "HOMDEL" & + Hugo_Symbol %in% unique(oncokb_tsg$hugoSymbol) & seg.len < 25000000, 'rescue', NA_character_) ) # homdeltsg_review = filter(genelevelcalls0, FACETS_CALL.em == "ccs_filter", FACETS_CALL.ori == "HOMDEL", Hugo_Symbol %in% unique(oncokb_tsg$hugoSymbol), seg.len < 25000000)