diff --git a/DESCRIPTION b/DESCRIPTION index 732539e..e1b0717 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: facetsSuite Type: Package Title: Functions to run and parse output from FACETS -Version: 2.0.4 +Version: 2.0.5 Authors@R: person(given = "Philip", family = "Jonsson", role = c("aut", "cre"), @@ -27,9 +27,9 @@ Imports: argparse (>= 1.1.1), tibble (>= 2.1.3), facets (>= 0.5.6), - facets2n (>= 0.2.2) + facets2n (>= 0.2.6) NeedsCompilation: no -Packaged: 2020-03-01 21:56:37 UTC; rptashkin +Packaged: 2020-04-29 20:11:41 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 cf1bcf4..214383f 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){ + ReferencePileupFile=NULL, ReferenceLoessFile=NULL, MinOverlap=0.9, useMatchedX=FALSE, refX=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 @@ -62,13 +62,14 @@ read_snp_matrix_facets2n = function(filename, err.thresh=Inf, del.thresh=Inf, pe #' @param ReferenceLoessFile (character) Filepath to an optional loess data, generated using the facets2n package, of one or more reference normals. The number of normals in this data should match that in the ReferencePileupFile, and should be in the same order. #' @param MinOverlap (numeric) Mininum overlap fraction of loci between a tumor pileup and reference pileup data. #' @param useMatchedX (logical) Is the matched normal to be used for ChrX normalization? + #' @param refX (logical) Use sex matched reference normal for chrX normalization #' @return A dataframe of pileup depth values for Tumor and Matched Normal if MandUnormal is FALSE. Else, a list of data frame with pileup depth values of Tumor, matched Normal, and a best unmatched normal, and the associated span values. #' @source \code{snp-pileup} is part of \href{www.github.com/mskcc/facets}{FACETS}. #' @import facets2n #' @importFrom pctGCdata getGCpct #' @export if (MandUnormal){ - facets2n::readSnpMatrix(filename, MandUnormal = MandUnormal, ReferencePileupFile = ReferencePileupFile, ReferenceLoessFile = ReferenceLoessFile, useMatchedX = useMatchedX) + facets2n::readSnpMatrix(filename, MandUnormal = MandUnormal, ReferencePileupFile = ReferencePileupFile, ReferenceLoessFile = ReferenceLoessFile, useMatchedX = useMatchedX, refX = refX) }else{ facets2n::readSnpMatrix(filename, MandUnormal = MandUnormal) } diff --git a/man/read_snp_matrix_facets2n.Rd b/man/read_snp_matrix_facets2n.Rd index cb2610e..b18eb6f 100644 --- a/man/read_snp_matrix_facets2n.Rd +++ b/man/read_snp_matrix_facets2n.Rd @@ -20,7 +20,8 @@ read_snp_matrix_facets2n( ReferencePileupFile = NULL, ReferenceLoessFile = NULL, MinOverlap = 0.9, - useMatchedX = FALSE + useMatchedX = FALSE, + refX = FALSE ) } \arguments{ @@ -50,6 +51,8 @@ read_snp_matrix_facets2n( \item{useMatchedX}{(logical) Is the matched normal to be used for ChrX normalization?} +\item{refX}{(logical) Use sex matched reference normal for chrX normalization} + \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 6b97507..443a892 100755 --- a/run-facets-wrapper.R +++ b/run-facets-wrapper.R @@ -48,6 +48,8 @@ parser$add_argument('-S', '--seed', required = FALSE, type = 'integer', default = 100, help = 'Manual seed value [default %(default)s]') parser$add_argument('-l', '--legacy-output', required = FALSE, action="store_true", default = FALSE, help = 'create legacy output files (.RData and .cncf.txt)') +parser$add_argument('-rx', '--refX', required = FALSE, action="store_true", + default = FALSE, help = 'use sex matched reference normal for chrX normalization') parser$add_argument('-fl', '--facets-lib-path', required = FALSE, default = '', help = 'path to the facets library. must supply either --facets-lib-path or --facets2n-lib-path') parser$add_argument('-f2l', '--facets2n-lib-path', required = FALSE, @@ -215,7 +217,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) + 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) }else{ read_counts = read_snp_matrix(args$counts_file) }