Skip to content

Commit

Permalink
Merge pull request #3 from belleau/master
Browse files Browse the repository at this point in the history
Extract constant from loop in postMerge
  • Loading branch information
adeschen committed Apr 12, 2016
2 parents fac0cc1 + 637ac87 commit ce2a2e5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions R/rjmcmcMethodsIntern.R
Original file line number Diff line number Diff line change
Expand Up @@ -2342,6 +2342,10 @@ postMerge <- function(startPosForwardReads, startPosReverseReads,
uniqueOverlap <- unique(allOverlap)
nbOverlap <- length(uniqueOverlap)

## Interval used to check for reads
maxLimit <- 74 + extendingSize
minLimit <- 74 - extendingSize

## Treat each overlapping region separatly
newMu <- array(dim = nbOverlap)
cpt <- 1L
Expand All @@ -2354,8 +2358,7 @@ postMerge <- function(startPosForwardReads, startPosReverseReads,
valCentral <- mean(resultRJMCMC$mu[current])
a <- min(resultRJMCMC$mu[current]) # - (74 + extendingSize)
b <- max(resultRJMCMC$mu[current]) # + (74 - extendingSize)
maxLimit <- 74 + extendingSize
minLimit <- 74 - extendingSize

if(length(segReads$yF[segReads$yF >= (a - maxLimit) &
segReads$yF <= (b - minLimit)]) > 4 &
length(segReads$yR[segReads$yR >= (a + minLimit) &
Expand Down

0 comments on commit ce2a2e5

Please sign in to comment.