From 27ba10f8c9227e372367149a45ac08223b1a166e Mon Sep 17 00:00:00 2001 From: Anders Valind Date: Thu, 6 Mar 2025 14:01:15 +0100 Subject: [PATCH 1/4] Fixed deprecated JVM GC flag UseParalellOldGC was deprecated in Java 15 (cf https://bugs.openjdk.org/browse/JDK-8235860), and the JVM suggests using UseParallelGC instead. --- R/impute.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/impute.R b/R/impute.R index 783a2d1c..de831024 100644 --- a/R/impute.R +++ b/R/impute.R @@ -267,7 +267,7 @@ run.beagle5 = function(beaglejar, cmd <- paste0(javajre, " -Xmx",maxheap.gb,"g", " -Xms", maxheap.gb, "g", - " -XX:+UseParallelOldGC", + " -XX:+UseParallelGC", " -jar ",beaglejar, " gt=",vcfpath, " ref=",reffile , From b1ec966b53e5dda9e502d9826ae9e2ede4401bb6 Mon Sep 17 00:00:00 2001 From: Anders Valind Date: Fri, 7 Mar 2025 09:48:45 +0100 Subject: [PATCH 2/4] BiocGenerics doesn't export rowSums BiocGenerics does not export a function called rowSums. Reverting to rowSums() from base R. --- R/haplotype_external.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/haplotype_external.R b/R/haplotype_external.R index 1f8c5930..b97cc4a2 100644 --- a/R/haplotype_external.R +++ b/R/haplotype_external.R @@ -208,7 +208,7 @@ get_multisample_phasing <- function(chrom, bbphasingprefixes, maxlag = 100, rela singlevcf <- vcfs_common[[vcfidx]] sid <- VariantAnnotation::samples(VariantAnnotation::header(singlevcf)) adddf <- S4Vectors::DataFrame(Major = VariantAnnotation::geno(singlevcf)$GT[,1], #Major = as.integer(ifelse(test = grepl(pattern = "|", x = geno(singlevcf)$GT, fixed = T), substr(x = geno(singlevcf)$GT, 1, 1), NA)), - BAF = VariantAnnotation::geno(singlevcf)$AD[,1,2]/BiocGenerics::rowSums(VariantAnnotation::geno(singlevcf)$AD[,1,]), + BAF = VariantAnnotation::geno(singlevcf)$AD[,1,2]/rowSums(VariantAnnotation::geno(singlevcf)$AD[,1,]), PS = VariantAnnotation::geno(singlevcf)$PS[,1]) colnames(adddf) <- paste0(sid, "_", colnames(adddf)) S4Vectors::mcols(loci) <- cbind(S4Vectors::mcols(loci), adddf) From 0bd6fdaaee59d22991e886b4de98963396739eb4 Mon Sep 17 00:00:00 2001 From: Anders Valind Date: Sat, 8 Mar 2025 16:14:35 +0100 Subject: [PATCH 3/4] Update segmentation.R Print()-debugging --- R/segmentation.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/R/segmentation.R b/R/segmentation.R index 95f7cf42..ea27bab0 100644 --- a/R/segmentation.R +++ b/R/segmentation.R @@ -511,7 +511,8 @@ segment.baf.phased.multisample = function(samplename, inputfile, outputfile, pri # @param no_segmentation Do not perform segmentation. This step will switch the haplotype blocks, but then just takes the mean BAFphased as BAFsegm # @return A data.frame with columns Chromosome,Position,BAF,BAFphased,BAFseg run_pcf = function(BAFrawchr, presegment_chrom_start, presegment_chrom_end, gamma) { - + print("run_pcf input = ") + print(BAFrawchr) row.indices = which(BAFrawchr$Position >= presegment_chrom_start & BAFrawchr$Position <= presegment_chrom_end) @@ -593,7 +594,8 @@ segment.baf.phased.multisample = function(samplename, inputfile, outputfile, pri BAFraw <- Reduce(f = function(...) merge(..., sort = F, all = F), x = lapply(X = inputfile, FUN = Battenberg:::read_baf)) # BAFraw = as.data.frame(read_tsv(inputfile, col_types = paste0("ci", paste0(rep("n", length(samplename)), collapse = ""), collapse = ""))) if (!is.null(prior_breakpoints_file)) { bkps = read.table(prior_breakpoints_file, header=T, stringsAsFactors=F) } else { bkps = NULL } - + print("BAFraw just after reading input files:") + print(BAFraw) BAFoutput = list() for (chr in unique(BAFraw[,1])) { print(paste0("Segmenting ", chr)) From 78597d548eeeca2858a18279500d2fc92c577b28 Mon Sep 17 00:00:00 2001 From: Anders Valind Date: Sun, 9 Mar 2025 06:58:45 +0100 Subject: [PATCH 4/4] Update fitcopynumber.R More chromosome naming convention fixes --- R/fitcopynumber.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/fitcopynumber.R b/R/fitcopynumber.R index 4b833a87..c1bebea3 100644 --- a/R/fitcopynumber.R +++ b/R/fitcopynumber.R @@ -676,6 +676,8 @@ merge_segments=function(subclones, bafsegmented, logR, rho, psi, platform_gamma, subclones=df2gr(subclones,'chr','startpos','endpos') str(bafsegmented) bafsegmented=df2gr(bafsegmented,'Chromosome','Position','Position') + #str(logR) + logR$Chromosome=paste("chr",logR$Chromosome,sep="") str(logR) logR=df2gr(logR,'Chromosome','Position','Position') names(GenomicRanges::mcols(logR))='logR'