From 275bc2455b7211a58a68e4efe1b56f9cdffed0f9 Mon Sep 17 00:00:00 2001 From: rptashkin Date: Mon, 27 Jul 2020 15:19:23 -0400 Subject: [PATCH] impute sex from tumor sample when run in unmatched mode, experimental --- DESCRIPTION | 2 +- R/read-snp-matrix.R | 7 ++++--- man/read_snp_matrix_facets2n.Rd | 5 ++++- run-facets-wrapper.R | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 34db115..3949026 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -29,7 +29,7 @@ Imports: facets (>= 0.5.6), facets2n (>= 0.2.6) NeedsCompilation: no -Packaged: 2020-07-23 14:48:17 UTC; rptashkin +Packaged: 2020-07-23 15:08:07 UTC; rptashkin Suggests: covr (>= 3.2.0), testthat (>= 2.1.0) diff --git a/R/read-snp-matrix.R b/R/read-snp-matrix.R index 214383f..6d2dec1 100644 --- a/R/read-snp-matrix.R +++ b/R/read-snp-matrix.R @@ -45,7 +45,7 @@ read_snp_matrix = function(input_file, read_snp_matrix_facets2n = function(filename, err.thresh=Inf, del.thresh=Inf, perl.pileup=FALSE, MandUnormal=FALSE, spanT=0.2, spanA=0.2, spanX=0.2, gbuild="hg19", - ReferencePileupFile=NULL, ReferenceLoessFile=NULL, MinOverlap=0.9, useMatchedX=FALSE, refX=FALSE){ + ReferencePileupFile=NULL, ReferenceLoessFile=NULL, MinOverlap=0.9, useMatchedX=FALSE, refX=FALSE, unmatched=FALSE){ #' #' Read in the snp-pileup generated SNP read count matrix file for facets2n processing #' @importFrom utils read.csv #' @param filename counts file from snp-pileup @@ -54,6 +54,7 @@ read_snp_matrix_facets2n = function(filename, err.thresh=Inf, del.thresh=Inf, pe #' @param del.thresh (numeric) Deletion threshold to be used to filter snp-pileup data frame. #' @param perl.pileup (logical) Is the pileup data generated using perl pileup tool? #' @param MandUnormal (logical) Is CNLR analysis to be peformed using unmatched reference normals? + #' @param unmatched (logical) is the tumor being analyzed unmatched #' @param spanT (numeric) Default span value to be used for loess normalization in tumor sample. #' @param spanA (numeric) Default span value to be used for loess normalization across autosomal chromosomes in the normal sample. #' @param spanX (numeric) Default span value to be used for loess normalization in Chr X in the normal sample. @@ -69,8 +70,8 @@ read_snp_matrix_facets2n = function(filename, err.thresh=Inf, del.thresh=Inf, pe #' @importFrom pctGCdata getGCpct #' @export if (MandUnormal){ - facets2n::readSnpMatrix(filename, MandUnormal = MandUnormal, ReferencePileupFile = ReferencePileupFile, ReferenceLoessFile = ReferenceLoessFile, useMatchedX = useMatchedX, refX = refX) + facets2n::readSnpMatrix(filename, MandUnormal = MandUnormal, ReferencePileupFile = ReferencePileupFile, ReferenceLoessFile = ReferenceLoessFile, useMatchedX = useMatchedX, refX = refX, unmatched=unmatched) }else{ - facets2n::readSnpMatrix(filename, MandUnormal = MandUnormal) + facets2n::readSnpMatrix(filename, MandUnormal = MandUnormal, unmatched=unmatched) } } diff --git a/man/read_snp_matrix_facets2n.Rd b/man/read_snp_matrix_facets2n.Rd index b18eb6f..51b3e42 100644 --- a/man/read_snp_matrix_facets2n.Rd +++ b/man/read_snp_matrix_facets2n.Rd @@ -21,7 +21,8 @@ read_snp_matrix_facets2n( ReferenceLoessFile = NULL, MinOverlap = 0.9, useMatchedX = FALSE, - refX = FALSE + refX = FALSE, + unmatched = FALSE ) } \arguments{ @@ -53,6 +54,8 @@ read_snp_matrix_facets2n( \item{refX}{(logical) Use sex matched reference normal for chrX normalization} +\item{unmatched}{(logical) is the tumor being analyzed unmatched} + \item{skip}{(character) Skip n number of lines in the input file.} } \value{ diff --git a/run-facets-wrapper.R b/run-facets-wrapper.R index fe30a06..28a41da 100755 --- a/run-facets-wrapper.R +++ b/run-facets-wrapper.R @@ -223,7 +223,7 @@ if (dir.exists(directory)) { # Read SNP counts file message(paste('Reading', args$counts_file)) if(args$facets2n_lib_path != ''){ - read_counts = read_snp_matrix_facets2n(args$counts_file,MandUnormal= args$MandUnormal, ReferencePileupFile=args$reference_snp_pileup, ReferenceLoessFile=args$reference_loess_file, useMatchedX=args$useMatchedX, refX=args$refX) + read_counts = read_snp_matrix_facets2n(args$counts_file,MandUnormal= args$MandUnormal, ReferencePileupFile=args$reference_snp_pileup, ReferenceLoessFile=args$reference_loess_file, useMatchedX=args$useMatchedX, refX=args$refX, unmatched=args$unmatched) }else{ read_counts = read_snp_matrix(args$counts_file) }