diff --git a/DESCRIPTION b/DESCRIPTION index b25fa22..a267a76 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: copyCat Title: Find regions of genomic copy number loss and gain from short reads -Version: 1.6.11 +Version: 1.6.12 Author: Chris Miller Description: Uses the depth of short reads in windows across the genome to identify regions of genomic copy-number gain and loss @@ -8,4 +8,4 @@ Maintainer: Chris Miller LazyLoad: yes License: Apache License 2.0 | file LICENSE Depends: methods, foreach, doMC, IRanges, DNAcopy, stringr -Packaged: 2016-11-30 12:45:10 PM; cmiller +Packaged: 2017-04-18 02:55:38 PM; cmiller diff --git a/R/cnSegments.R b/R/cnSegments.R index 9919f36..097f745 100644 --- a/R/cnSegments.R +++ b/R/cnSegments.R @@ -237,7 +237,7 @@ trimSegmentEnds <- function(segs,rdo){ ##----------------------------------------------- ## remove segments that overlap at least n% with a reference assembly gap ## -removeGapSpanningSegments <- function(segs,rdo,maxOverlap=0.75){ +removeGapSpanningSegments <- function(segs,rdo,maxOverlap=0.75,gapExpansion=1.0){ count = length(segs[,1]); if(!(file.exists(paste(rdo@params$annotationDirectory,"/gaps.bed",sep="")))){ @@ -247,7 +247,17 @@ removeGapSpanningSegments <- function(segs,rdo,maxOverlap=0.75){ } gaps = read.table(paste(rdo@params$annotationDirectory,"/gaps.bed",sep="")) - + #expand gaps if necessary + if(gapExpansion!=1){ + print(paste("Using gap expansion of ",gapExpansion)) + sizes=gaps[,3]-gaps[,2] + exp=round(((sizes*gapExpansion)-sizes)/2) + gaps[,2] = gaps[,2]-exp + gaps[,3] = gaps[,3]+exp + gaps[(gaps[,2]<0),2]=0 #no negative coords exp=round(((sizes*gapExpansion)-sizes)/2) + } + + #intersect each chromosome separately newsegs = foreach(chr=names(rdo@chrs), .combine="rbind") %do%{ diff --git a/R/zzz.R b/R/zzz.R index 46e0692..484ade7 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -19,5 +19,5 @@ sillyname(methods) initRdClass() - packageStartupMessage("Using copyCat version 1.6.11") + packageStartupMessage("Using copyCat version 1.6.12") } diff --git a/man/removeGapSpanningSegments.Rd b/man/removeGapSpanningSegments.Rd index e6ec267..7203462 100644 --- a/man/removeGapSpanningSegments.Rd +++ b/man/removeGapSpanningSegments.Rd @@ -10,7 +10,7 @@ false-positive calls. } \usage{ - removeGapSpanningSegments(segs,rdo,maxOverlap=0.75) + removeGapSpanningSegments(segs,rdo,maxOverlap=0.75,gapExpansion=1.0) } \arguments{ @@ -26,6 +26,10 @@ \item{maxOverlap}{ if a segment overlaps at least this much with a gap, it will be removed. } + \item{gapExpansion}{ + expand each gap feature by this fraction before doing gap + filtering. A value of 1.3 would expand each gap by 30%. + } } \value{ returns a dataframe with 5 columns: