@@ -532,7 +532,8 @@ Segment.FACETS <- function(data = NULL, smooth.k = NULL, BAF.filter = .75, homoC
532
532
deltaCN <- 0
533
533
534
534
# ## Data conversion
535
- F .dmat <- data.frame (chrom = as.integer(data $ data $ SNPpos $ chrs ), maploc = as.numeric(data $ data $ SNPpos $ pos ), rCountT = data $ data $ additional $ RD.test , rCountN = data $ data $ additional $ RD.ref , vafT = data $ data $ Tumor_BAF [,1 ], vafN = NA , het = abs(as.numeric(data $ germline $ germlinegenotypes )- 1 ), keep = NA , gcpct = NA , gcbias = NA , cnlr = data $ data $ Tumor_LogR [,1 ], valor = data $ data $ additional $ LOR , lorvar = data $ data $ additional $ LORvar )
535
+ # F.dmat <- data.frame(chrom = as.integer(data$data$SNPpos$chrs), maploc = as.numeric(data$data$SNPpos$pos), rCountT = data$data$additional$RD.test, rCountN = data$data$additional$RD.ref, vafT = data$data$Tumor_BAF[,1], vafN = NA, het = abs(as.numeric(data$germline$germlinegenotypes)-1), keep = NA, gcpct = NA, gcbias = NA, cnlr = data$data$Tumor_LogR[,1], valor = data$data$additional$LOR, lorvar = data$data$additional$LORvar)
536
+ F .dmat <- data.frame (chrom = unlist(cs $ chrom2chr [as.character(data $ data $ SNPpos $ chrs )]), maploc = as.numeric(data $ data $ SNPpos $ pos ), rCountT = data $ data $ additional $ RD.test , rCountN = data $ data $ additional $ RD.ref , vafT = data $ data $ Tumor_BAF [,1 ], vafN = NA , het = abs(as.numeric(data $ germline $ germlinegenotypes )- 1 ), keep = NA , gcpct = NA , gcbias = NA , cnlr = data $ data $ Tumor_LogR [,1 ], valor = data $ data $ additional $ LOR , lorvar = data $ data $ additional $ LORvar )
536
537
537
538
# ## Selection of SNP position to smooth their density
538
539
F .dmat $ keep <- if (" germline" %in% names(data )) as.numeric(! unname(data $ germline $ germlinegenotypes [,1 ])) else F .dmat $ keep <- facets ::: scanSnp(maploc = F .dmat $ maploc , het = F .dmat $ het , nbhd = snp.nbhd )
@@ -1585,10 +1586,10 @@ ASCN.ASCAT <- function(data = NULL, gammaRange = c(.35,.95), nsubthread = 1, clu
1585
1586
# # FACETS Total and Allele-Specific Copy Number
1586
1587
ASCN.FACETS <- function (data = NULL , out.dir = getwd(), force = FALSE , ... ) {
1587
1588
1588
- # setwd("/mnt/data_cigogne/ job/PUBLI_EaCoN/TCGA/ANALYSES/EaCoN_0.3.0_beta2 /WES/TCGA-A7-A0CE-01A_vs_10A /FACETS/L2R")
1589
- # data <- readRDS("/mnt/data_cigogne/job/PUBLI_EaCoN/TCGA/ANALYSES/EaCoN_0.3.0_beta2/WES/TCGA-A7-A0CE-01A_vs_10A/FACETS/L2R/TCGA-A7-A0CE-01A_vs_10A .FACETS.RDS")
1590
- # out.dir <- "/mnt/data_cigogne/ job/PUBLI_EaCoN/TCGA/ANALYSES/EaCoN_0.3.0_beta2 /WES/TCGA-A7-A0CE-01A_vs_10A "
1591
- # force <- FALSE
1589
+ # setwd("/home/ job/Documents/ROSCOFF/Roscoff_2018/TP_CNV /WES/REDUX/A18R.11.17.18 /FACETS/L2R")
1590
+ # data <- readRDS("A18R.11.17.18.SEG .FACETS.RDS")
1591
+ # out.dir <- "/home/ job/Documents/ROSCOFF/Roscoff_2018/TP_CNV /WES/REDUX/A18R.11.17.18 "
1592
+ # force <- TRUE
1592
1593
# source("/home/job/git_gustaveroussy/EaCoN/R/mini_functions.R")
1593
1594
# require(foreach)
1594
1595
@@ -1622,9 +1623,12 @@ ASCN.FACETS <- function(data = NULL, out.dir = getwd(), force = FALSE, ...) {
1622
1623
tmsg(" ASCN modeling (using FACETS) ..." )
1623
1624
ascn.res <- facets :: emcncf(x = data $ data $ additional , ... )
1624
1625
ascn.res $ cncf $ lcn.em [is.na(ascn.res $ cncf $ lcn.em )] <- 0
1625
- # # Handling ploidy
1626
+
1627
+ # # Handling purity
1626
1628
purity <- ascn.res $ purity
1629
+ if (! " loglik" %in% names(ascn.res )) ascn.res $ loglik <- NA
1627
1630
1631
+ # # Handling ploidy
1628
1632
tcn.tbl.ung <- dplyr :: as.tbl(cbind(ascn.res $ cncf , width = ascn.res $ cncf $ end - ascn.res $ cncf $ start + 1 ))
1629
1633
tcn.tbl <- dplyr :: group_by(tcn.tbl.ung , tcn.em )
1630
1634
tcn.tbl.prop <- dplyr :: summarise(tcn.tbl , tot_width = sum(width ))
0 commit comments