From 0b3a7547b23652e4b9132f6762f619a7a1f39f82 Mon Sep 17 00:00:00 2001 From: Axel Gschwind Date: Mon, 26 Nov 2018 14:55:33 +0100 Subject: [PATCH] somatic: Bugfix and removed testing parameters --- somatic/firstStep.R | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/somatic/firstStep.R b/somatic/firstStep.R index 7fff673..cf2c220 100644 --- a/somatic/firstStep.R +++ b/somatic/firstStep.R @@ -73,20 +73,6 @@ option_list = list( opt_parser = OptionParser(option_list=option_list); opt = parse_args(opt_parser); -### TESTING PART -opt$bed = "/Users/gdemidov/Tuebingen/somatic_CNVs/Somatic/ssSC_v4.annotated.bed" -opt$tumor = "/Users/gdemidov/Tuebingen/somatic_CNVs/Somatic/v4_tumor.cov" -opt$normal = "/Users/gdemidov/Tuebingen/somatic_CNVs/Somatic/v4_normal.cov" -opt$colNum = 4 -opt$pair = "/Users/gdemidov/Tuebingen/somatic_CNVs/Somatic/pairs-2.txt" -opt$out = "/Users/gdemidov/Tuebingen/clinCNV_dev/results" -opt$folderWithScript = "/Users/gdemidov/Tuebingen/clinCNV_dev/ClinCNV/somatic" -opt$reanalyseCohort = F -opt$bedOfftarget = "/Users/gdemidov/Tuebingen/somatic_CNVs/Somatic/annotated_offtarget_v4.bed" -opt$tumorOfftarget = "/Users/gdemidov/Tuebingen/somatic_CNVs/Somatic/v4_tumor_off.cov" -opt$normalOfftarget = "/Users/gdemidov/Tuebingen/somatic_CNVs/Somatic/v4_normal_off.cov" -opt$bafFolder = "/Users/gdemidov/Tuebingen/somatic_CNVs/Somatic/baf" - ### PLOTTING OF PICTURES (DOES NOT REALLY NECESSARY IF YOU HAVE IGV SEGMENTS) plottingOfPNGs = F @@ -211,15 +197,15 @@ if (framework == "somatic") { ## CHECK INPUT VALIDITY if (!is.null(opt$normalSample)) { - stopifnot(!opt$normalSample %in% colnames(normal)) + stopifnot(opt$normalSample %in% colnames(normal)) } if (!is.null(opt$tumorSample)) { stopifnot(!is.null(opt$normalSample)) - stopifnot(!opt$tumorSample %in% colnames(normal)) - stopifnot(!opt$tumorSample %in% pairs[,1]) - stopifnot(!opt$normalSample %in% pairs[,2]) + stopifnot(opt$tumorSample %in% colnames(tumor)) + stopifnot(opt$tumorSample %in% pairs[,1]) + stopifnot(opt$normalSample %in% pairs[,2]) coordOfNormalInPairs = which(pairs[,2] == opt$normalSample) - stopifnot(!opt$tumorSample %in% pairs[coordOfNormalInPairs,1]) + stopifnot(opt$tumorSample %in% pairs[coordOfNormalInPairs,1]) } lstOfChromBorders <- getCytobands("cytobands.txt") @@ -923,7 +909,7 @@ for (sam_no in 1:ncol(matrixOfLogFold)) { found_CNVs_total <- matrix(0, nrow=0, ncol=8) - colnames(found_CNVs_total) <- c("#chr", "start", "end", "tumor_CN_change", "tumor_clonality", "absolute_CN_change", "loglikelihood", "genes") + colnames(found_CNVs_total) <- c("#chr", "start", "end", "tumor_CN_change", "tumor_clonality", "CN_change", "loglikelihood", "genes") allDetectedPurities = c() for (l in 1:length(left_borders)) {