Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions R/fitcopynumber.R
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion R/haplotype_external.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion R/impute.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 ,
Expand Down
6 changes: 4 additions & 2 deletions R/segmentation.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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))
Expand Down