diff --git a/R/fitcopynumber.R b/R/fitcopynumber.R index 4b833a8..c1bebea 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' diff --git a/R/haplotype_external.R b/R/haplotype_external.R index 1f8c593..b97cc4a 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) diff --git a/R/impute.R b/R/impute.R index 783a2d1..de83102 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 , diff --git a/R/segmentation.R b/R/segmentation.R index 95f7cf4..ea27bab 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))