From 3d557f83c899b1b941413e8bc0be79c5b5a9a250 Mon Sep 17 00:00:00 2001 From: Gavin Ha Date: Tue, 7 Aug 2018 11:59:15 -0400 Subject: [PATCH] mem/time setting updates; sex params --- TitanCNA.snakefile | 10 +++++----- code/combineTITAN-ichor.R | 4 ++-- code/titanCNA_v1.15.0_TenX.R | 12 ++++++------ config/config.yaml | 11 ++++++----- getPhasedAlleleCounts.snakefile | 5 ++--- moleculeCoverage.snakefile | 2 +- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/TitanCNA.snakefile b/TitanCNA.snakefile index e3fc06c..270182e 100644 --- a/TitanCNA.snakefile +++ b/TitanCNA.snakefile @@ -45,7 +45,7 @@ rule runTitanCNA: numCores=config["TitanCNA_numCores"], normal=config["TitanCNA_normalInit"], chrs=config["TitanCNA_chrs"], - gender=config["gender"], + sex=config["sex"], estimatePloidy=config["TitanCNA_estimatePloidy"], estimateClonality=config["TitanCNA_estimateClonality"], estimateNormal=config["TitanCNA_estimateNormal"], @@ -58,11 +58,11 @@ rule runTitanCNA: plotYlim=config["TitanCNA_plotYlim"], mem=config["TitanCNA_mem"], runtime=config["TitanCNA_runtime"], - pe=config["TitanCNA_numCores"] + pe=config["TitanCNA_pe"] log: "logs/titan/titanCNA_ploidy{ploidy}/{tumor}_cluster{clustNum}.log" shell: - "Rscript {params.titanRscript} --id {wildcards.tumor} --hetFile {input.alleleCounts} --cnFile {input.corrDepth} --numClusters {wildcards.clustNum} --numCores {params.numCores} --normal_0 {params.normal} --ploidy_0 {wildcards.ploidy} --chrs \"{params.chrs}\" --gender {params.gender} --haplotypeBinSize {params.haplotypeBinSize} --estimateNormal {params.estimateNormal} --estimatePloidy {params.estimatePloidy} --estimateClonality {params.estimateClonality} --centromere {params.centromere} --genomeBuild {params.genomeBuild} --genomeStyle {params.genomeStyle} --libdir {params.libdir} --alphaK {params.alphaK} --alphaR {params.alphaR} --alleleModel Gaussian --txnExpLen {params.txnExpLen} --plotYlim \"{params.plotYlim}\" --cytobandFile {params.cytobandFile} --outFile {output.titan} --outSeg {output.segTxt} --outParam {output.param} --outIGV {output.seg} --outPlotDir {output.outRoot} > {log} 2> {log}" + "Rscript {params.titanRscript} --id {wildcards.tumor} --hetFile {input.alleleCounts} --cnFile {input.corrDepth} --numClusters {wildcards.clustNum} --numCores {params.numCores} --normal_0 {params.normal} --ploidy_0 {wildcards.ploidy} --chrs \"{params.chrs}\" --sex {params.sex} --haplotypeBinSize {params.haplotypeBinSize} --estimateNormal {params.estimateNormal} --estimatePloidy {params.estimatePloidy} --estimateClonality {params.estimateClonality} --centromere {params.centromere} --genomeBuild {params.genomeBuild} --genomeStyle {params.genomeStyle} --libdir {params.libdir} --alphaK {params.alphaK} --alphaR {params.alphaR} --alleleModel Gaussian --txnExpLen {params.txnExpLen} --plotYlim \"{params.plotYlim}\" --cytobandFile {params.cytobandFile} --outFile {output.titan} --outSeg {output.segTxt} --outParam {output.param} --outIGV {output.seg} --outPlotDir {output.outRoot} > {log} 2> {log}" rule combineTitanAndIchorCNA: @@ -80,14 +80,14 @@ rule combineTitanAndIchorCNA: combineScript=config["TitanCNA_combineTitanIchorCNA"], libdir=config["TitanCNA_libdir"], centromere=config["centromere"], - gender=config["gender"], + sex=config["sex"], mem=config["std_mem"], runtime=config["std_runtime"], pe=config["std_numCores"] log: "logs/titan/titanCNA_ploidy{ploidy}/{tumor}_cluster{clustNum}.combineTitanIchorCNA.log" shell: - "Rscript {params.combineScript} --libdir {params.libdir} --titanSeg {input.titanSeg} --titanBin {input.titanBin} --titanParam {input.titanParam} --ichorSeg {input.ichorSeg} --ichorBin {input.ichorBin} --ichorParam {input.ichorParam} --gender {params.gender} --outSegFile {output.segFile} --outBinFile {output.binFile} --centromere {params.centromere} > {log} 2> {log}" + "Rscript {params.combineScript} --libdir {params.libdir} --titanSeg {input.titanSeg} --titanBin {input.titanBin} --titanParam {input.titanParam} --ichorSeg {input.ichorSeg} --ichorBin {input.ichorBin} --ichorParam {input.ichorParam} --sex {params.sex} --outSegFile {output.segFile} --outBinFile {output.binFile} --centromere {params.centromere} > {log} 2> {log}" rule selectSolution: diff --git a/code/combineTITAN-ichor.R b/code/combineTITAN-ichor.R index 40f1d1d..e82e987 100644 --- a/code/combineTITAN-ichor.R +++ b/code/combineTITAN-ichor.R @@ -19,7 +19,7 @@ option_list <- list( make_option(c("--ichorSeg"), type="character", help="ichorCNA segs.txt file. Required."), make_option(c("--ichorBin"), type="character", help="ichorCNA cna.seg file. Required."), make_option(c("--ichorParams"), type="character", help="ichorCNA params.txt file. Required."), - make_option(c("--gender"), type="character", default="female", help="female or male. Default [%default]."), + make_option(c("--sex"), type="character", default="female", help="female or male. Default [%default]."), make_option(c("--libdir"), type="character", help="TitanCNA directory path to source R files if custom changes made."), make_option(c("--outSegFile"), type="character", help="New combined segment file. Required"), make_option(c("--outBinFile"), type="character", help="New combined bin-level file. Required"), @@ -36,7 +36,7 @@ titanParams <- opt$titanParams ichorSeg <- opt$ichorSeg ichorBin <- opt$ichorBin ichorParams <- opt$ichorParams -gender <- opt$gender +gender <- opt$sex outSegFile <- opt$outSegFile outBinFile <- opt$outBinFile centromere <- opt$centromere diff --git a/code/titanCNA_v1.15.0_TenX.R b/code/titanCNA_v1.15.0_TenX.R index cffdd85..fa839ea 100644 --- a/code/titanCNA_v1.15.0_TenX.R +++ b/code/titanCNA_v1.15.0_TenX.R @@ -34,7 +34,7 @@ option_list <- list( make_option(c("--genomeStyle"), type = "character", default = "NCBI", help = "NCBI or UCSC chromosome naming convention; use UCSC if desired output is to have \"chr\" string. [Default: %default]"), make_option(c("--genomeBuild"), type = "character", default = "hg38", help="Genome build to use; will load Seqinfo from GenomeInfoDb."), make_option(c("--chrs"), type = "character", default = "c(1:22, 'X')", help = "Chromosomes to analyze; string [Default: %default"), - make_option(c("--gender"), type = "character", default = "male", help = "User specified gender: male or female [Default: %default]"), + make_option(c("--sex"), type = "character", default = "male", help = "User specified sex: male or female [Default: %default]"), make_option(c("--cytobandFile"), type = "character", default = NULL, help = "Cytoband file should be provided only if reference genome is hg38."), make_option(c("--mapWig"), type = "character", default = NULL, help = "Mappability score file for bin sizes matching cnfile. [Default: %default]"), make_option(c("--mapThres"), type = "numeric", default = 0.9, help = "Minimum mappability score threshold to use; float [Default: %default]"), @@ -100,7 +100,7 @@ chrs <- eval(parse(text = opt$chrs)) genomeStyle <- opt$genomeStyle genomeBuild <- opt$genomeBuild cytobandFile <- opt$cytobandFile -gender <- opt$gender +sex <- opt$sex mapWig <- opt$mapWig centromere <- opt$centromere haplotypeBinSize <- opt$haplotypeBinSize @@ -144,8 +144,8 @@ outImage <- gsub(".titan.txt", ".RData", outfile) ## set up chromosome naming convention ## seqinfo <- Seqinfo(genome=genomeBuild) seqlevelsStyle(chrs) <- genomeStyle -## exclude chrX if gender==male ## -if (gender == "male" || gender == "Male" || gender == "MALE"){ +## exclude chrX if sex==male ## +if (sex == "male" || sex == "Male" || sex == "MALE"){ chrs <- chrs[!grepl("X", chrs)] } @@ -222,7 +222,7 @@ save.image(file=outImage) #### OUTPUT SEGMENTS #### segs <- outputTitanSegments(results, id, convergeParams, filename = NULL, igvfilename = outigv) corrIntCN.results <- correctIntegerCN(results, segs, 1 - norm, ploidy, maxCNtoCorrect.autosomes = maxCN, - maxCNtoCorrect.X = NULL, minPurityToCorrect = 0.2, gender = gender, chrs = chrs) + maxCNtoCorrect.X = NULL, minPurityToCorrect = 0.2, gender = sex, chrs = chrs) results <- corrIntCN.results$cn segs <- corrIntCN.results$segs message("Writing results to ", outfile, ",\n\t", outseg, ",\n\t", outparam) @@ -240,7 +240,7 @@ if (genomeBuild == "hg38" && file.exists(cytobandFile)){ #cytoband$V1 <- setGenomeStyle(cytoband$V1, genomeStyle = genomeStyle) } -if (gender == "male"){ +if (sex == "male"){ chrsToPlot <- chrs[!grepl("X", chrs)] }else{ chrsToPlot <- chrs diff --git a/config/config.yaml b/config/config.yaml index ff49555..248603b 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -9,7 +9,7 @@ phaseCounts_counts_script: code/getTumourAlleleCountsAtHETSites.py TitanCNA_rscript: code/titanCNA_v1.15.0_TenX.R TitanCNA_selectSolutionRscript: code/selectSolution.R TitanCNA_combineTitanIchorCNA: code/combineTITAN-ichor.R -TitanCNA_libdir: /path/to/TitahCNA/ ## optional +TitanCNA_libdir: /path/to/TitanCNA/ ## optional ichorCNA_libdir: /path/to/ichorCNA/ ## optional ## reference settings ## @@ -18,7 +18,7 @@ genomeStyle: UCSC snpVCF: /path/to/hapmap_3.3.hg38.vcf.gz ## optional cytobandFile: data/cytoBand_hg38.txt # only need if hg38 centromere: data/GRCh38.GCA_000001405.2_centromere_acen.txt -gender: male +sex: male ## LongRanger params ## bamFileName: phased_possorted_bam.bam @@ -56,7 +56,7 @@ het_minBaseQuality: 10 het_minMapQuality: 20 ## TitanCNA params ## -TitanCNA_maxNumClonalClusters: 1 +TitanCNA_maxNumClonalClusters: 2 TitanCNA_chrs: c(1:22, \"X\") TitanCNA_normalInit: 0.5 TitanCNA_maxPloidy: 3 @@ -69,9 +69,10 @@ TitanCNA_alphaR: 5000 TitanCNA_txnExpLen: 1e15 TitanCNA_plotYlim: c(-2,4) TitanCNA_solutionThreshold: 0.05 +TitanCNA_numCores: 1 TitanCNA_mem: 16G -TitanCNA_runtime: "10:00:00" -TitanCNA_numCores: -pe smp 1 -binding linear:1 +TitanCNA_runtime: "300:00:00" +TitanCNA_pe: -pe smp 1 -binding linear:1 diff --git a/getPhasedAlleleCounts.snakefile b/getPhasedAlleleCounts.snakefile index b1ee679..3a9a335 100644 --- a/getPhasedAlleleCounts.snakefile +++ b/getPhasedAlleleCounts.snakefile @@ -10,9 +10,8 @@ def getLRFullPath(base, filename): rule phasedCounts: input: - expand("results/phasedCounts/tumCounts/{tumor}/{tumor}.tumCounts.{chr}.txt", tumor=config["pairings"], chr=CHRS), expand("results/phasedCounts/tumCounts/{tumor}.tumCounts.txt", tumor=config["pairings"]) - + rule getHETsites: input: lambda wildcards: getLRFullPath(config["samples"][config["pairings"][wildcards.tumor]], config["phaseVariantFileName"]) @@ -33,7 +32,7 @@ rule getHETsites: log: "logs/phasedCounts/hetPosns/{tumor}.phasedHETsites.log" shell: - "Rscript {params.getHETsitesScript} --inVCF {input} --genomeBuild {params.genomeBuild} --genomeStyle {params.genomeStyle} --snpDB {params.snpDB} --minQuality {params.minQual} --minDepth {params.minDepth} --minVAF {params.minVAF} --altCountField AD --libdir {params.libdir} --outVCF {output} 2> {log}" + "Rscript {params.getHETsitesScript} --inVCF {input} --genomeBuild {params.genomeBuild} --genomeStyle {params.genomeStyle} --snpDB {params.snpDB} --minQuality {params.minQual} --minDepth {params.minDepth} --minVAF {params.minVAF} --altCountField AD --libdir {params.libdir} --outVCF {output} > {log} 2> {log}" rule getAlleleCountsByChr: diff --git a/moleculeCoverage.snakefile b/moleculeCoverage.snakefile index b366e4a..f25012e 100644 --- a/moleculeCoverage.snakefile +++ b/moleculeCoverage.snakefile @@ -34,7 +34,7 @@ rule bxTile: bxTools=config["bxTools"], samTools=config["samTools"], mapQual=config["bx_mapQual"], - bedFile=config["bx_bedFileRoot"] + bedFile=config["bx_bedFileRoot"], mem=config["std_mem"], runtime=config["std_runtime"], pe=config["std_numCores"]