Skip to content

Commit

Permalink
Tweak segBAF for targetedSeq and for asmultipcf
Browse files Browse the repository at this point in the history
  • Loading branch information
tlesluyes committed Mar 24, 2023
1 parent 230277f commit bc0c905
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ASCAT/R/ascat.asmultipcf.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#' @export
#'
ascat.asmultipcf <- function(ASCATobj, ascat.gg = NULL, penalty = 70, out.dir = ".", wsample=NULL, selectAlg="exact",refine=TRUE, seed=as.integer(Sys.time())) {
if (is.null(ASCATobj$isTargetedSeq)) ASCATobj$isTargetedSeq=F
set.seed(seed)
useLogRonlySites=TRUE
#first, set germline genotypes
Expand Down Expand Up @@ -141,6 +142,7 @@ ascat.asmultipcf <- function(ASCATobj, ascat.gg = NULL, penalty = 70, out.dir =
} else {
logRASPCF = apply(logRaveraged,2,function(x) rep(mean(x,na.rm=TRUE),length(x)))
bafASPCF = apply(bafwins,2,function(x) rep(ifelse(mean(x,na.rm=TRUE)>=0.5,mean(x,na.rm=TRUE),1-mean(x,na.rm=TRUE)),length(x)))
if (ASCATobj$isTargetedSeq) apply(bafASPCF,2,function(x) ifelse(x<=0.55,0.5,x))
}
} else {
# combine logR and BAF data into one matrix for joint segmentation
Expand Down Expand Up @@ -241,6 +243,7 @@ ascat.asmultipcf <- function(ASCATobj, ascat.gg = NULL, penalty = 70, out.dir =
if(sqrt(sd^2+mu^2) < 2*sd){
mu <- 0
}
if (ASCATobj$isTargetedSeq && mu<=0.05) mu=0
yhat[frst[i]:last[i]] <- rep(mu+0.5,last[i]-frst[i]+1)
}
}
Expand Down

0 comments on commit bc0c905

Please sign in to comment.