Skip to content

Commit

Permalink
update facets2n dependency to v0.2.6
Browse files Browse the repository at this point in the history
add option for facets2n readSnpMatrix() refX
  • Loading branch information
rptashkin committed Apr 30, 2020
1 parent 3bc8e68 commit c3013ea
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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"),
Expand All @@ -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)
5 changes: 3 additions & 2 deletions R/read-snp-matrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}
Expand Down
5 changes: 4 additions & 1 deletion man/read_snp_matrix_facets2n.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion run-facets-wrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit c3013ea

Please sign in to comment.