@@ -416,11 +416,10 @@ runAbsoluteCN <- function(normal.coverage.file = NULL,
416416 }
417417
418418 sex <- .getSex(match.arg(sex ), normal , tumor )
419- tumor <- .fixAllosomeCoverage(sex , tumor )
420-
421419 if (! is.null(interval.file )) {
422420 tumor <- .addGCData(tumor , interval.file )
423421 }
422+
424423 if (is.null(centromeres ) && ! missing(genome )) {
425424 centromeres <- .getCentromerePositions(centromeres , genome ,
426425 if (is.null(tumor )) NULL else .getSeqlevelsStyle(tumor ))
@@ -442,6 +441,16 @@ runAbsoluteCN <- function(normal.coverage.file = NULL,
442441 # chr.hash is an internal data structure, so we need to do this separately.
443442 intervalsUsed <- .filterIntervalsChrHash(intervalsUsed , tumor , chr.hash )
444443 intervalsUsed <- .filterIntervalsCentromeres(intervalsUsed , tumor , centromeres )
444+ intervalsUsedAllosome <- intervalsUsed
445+ intervalsUsed <- .filterIntervalsAllosome(intervalsUsed , tumor , sex )
446+
447+ if (! is.null(normalDB $ sd $ weights )) {
448+ tumor $ weights <- subsetByOverlaps(normalDB $ sd $ weights , tumor )$ weights
449+ }
450+ tumorAllosome <- tumor
451+ tumorAllosome $ log.ratio <- log.ratio
452+ tumorAllosome <- tumorAllosome [! intervalsUsed & intervalsUsedAllosome , ]
453+
445454 intervalsUsed <- which(intervalsUsed )
446455 if (length(tumor ) != length(normal ) ||
447456 length(tumor ) != length(log.ratio )) {
@@ -468,9 +477,6 @@ runAbsoluteCN <- function(normal.coverage.file = NULL,
468477 flog.info(" Mean off-target bin size: %.0f" ,
469478 mean(width(tumor [! tumor $ on.target ]), na.rm = TRUE ))
470479 }
471- if (! is.null(normalDB $ sd $ weights )) {
472- tumor $ weights <- subsetByOverlaps(normalDB $ sd $ weights , tumor )$ weights
473- }
474480 # not needed anymore
475481 normalDB <- NULL
476482
@@ -1145,7 +1151,7 @@ runAbsoluteCN <- function(normal.coverage.file = NULL,
11451151 list (
11461152 candidates = candidate.solutions ,
11471153 results = results ,
1148- input = list (tumor = tumor.coverage.file , normal = normal.coverage.file ,
1154+ input = list (tumor = tumor.coverage.file , normal = normal.coverage.file , allosome = tumorAllosome ,
11491155 log.ratio = GRanges(normal [, 1 ], on.target = normal $ on.target , log.ratio = log.ratio ),
11501156 log.ratio.sdev = sd.seg , mapd = mapd , vcf = vcf , sampleid = sampleid ,
11511157 test.num.copy = test.num.copy ,
0 commit comments