Skip to content

Commit 0ee86c0

Browse files
committed
adding gap expansion
1 parent 9f06aec commit 0ee86c0

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Package: copyCat
22
Title: Find regions of genomic copy number loss and gain from short reads
3-
Version: 1.6.11
3+
Version: 1.6.12
44
Author: Chris Miller
55
Description: Uses the depth of short reads in windows across the genome to
66
identify regions of genomic copy-number gain and loss
77
Maintainer: Chris Miller <[email protected]>
88
LazyLoad: yes
99
License: Apache License 2.0 | file LICENSE
1010
Depends: methods, foreach, doMC, IRanges, DNAcopy, stringr
11-
Packaged: 2016-11-30 12:45:10 PM; cmiller
11+
Packaged: 2017-04-18 02:55:38 PM; cmiller

R/cnSegments.R

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ trimSegmentEnds <- function(segs,rdo){
237237
##-----------------------------------------------
238238
## remove segments that overlap at least n% with a reference assembly gap
239239
##
240-
removeGapSpanningSegments <- function(segs,rdo,maxOverlap=0.75){
240+
removeGapSpanningSegments <- function(segs,rdo,maxOverlap=0.75,gapExpansion=1.0){
241241
count = length(segs[,1]);
242242

243243
if(!(file.exists(paste(rdo@params$annotationDirectory,"/gaps.bed",sep="")))){
@@ -247,7 +247,17 @@ removeGapSpanningSegments <- function(segs,rdo,maxOverlap=0.75){
247247
}
248248

249249
gaps = read.table(paste(rdo@params$annotationDirectory,"/gaps.bed",sep=""))
250-
250+
#expand gaps if necessary
251+
if(gapExpansion!=1){
252+
print(paste("Using gap expansion of ",gapExpansion))
253+
sizes=gaps[,3]-gaps[,2]
254+
exp=round(((sizes*gapExpansion)-sizes)/2)
255+
gaps[,2] = gaps[,2]-exp
256+
gaps[,3] = gaps[,3]+exp
257+
gaps[(gaps[,2]<0),2]=0 #no negative coords exp=round(((sizes*gapExpansion)-sizes)/2)
258+
}
259+
260+
251261
#intersect each chromosome separately
252262
newsegs = foreach(chr=names(rdo@chrs), .combine="rbind") %do%{
253263

R/zzz.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
sillyname(methods)
2020

2121
initRdClass()
22-
packageStartupMessage("Using copyCat version 1.6.11")
22+
packageStartupMessage("Using copyCat version 1.6.12")
2323
}

man/removeGapSpanningSegments.Rd

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
false-positive calls.
1111
}
1212
\usage{
13-
removeGapSpanningSegments(segs,rdo,maxOverlap=0.75)
13+
removeGapSpanningSegments(segs,rdo,maxOverlap=0.75,gapExpansion=1.0)
1414
}
1515

1616
\arguments{
@@ -26,6 +26,10 @@
2626
\item{maxOverlap}{
2727
if a segment overlaps at least this much with a gap, it will be removed.
2828
}
29+
\item{gapExpansion}{
30+
expand each gap feature by this fraction before doing gap
31+
filtering. A value of 1.3 would expand each gap by 30%.
32+
}
2933
}
3034
\value{
3135
returns a dataframe with 5 columns:

0 commit comments

Comments
 (0)