Skip to content

Commit

Permalink
Using array instead of numeric format inside postMerge() function
Browse files Browse the repository at this point in the history
  • Loading branch information
adeschen committed Apr 7, 2016
1 parent b3ec22c commit fac0cc1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ importFrom(consensusSeekeR,findConsensusPeakRegions)
importFrom(stats,dmultinom)
importFrom(stats,dpois)
importFrom(stats,dt)
importFrom(stats,na.omit)
importFrom(stats,quantile)
importFrom(stats,rmultinom)
importFrom(stats,rnorm)
Expand Down
11 changes: 4 additions & 7 deletions R/rjmcmcMethodsIntern.R
Original file line number Diff line number Diff line change
Expand Up @@ -2304,12 +2304,12 @@ validatePrepMergeParameters <- function(startPosForwardReads,
#' @importFrom IRanges IRanges
#' @importFrom GenomeInfoDb Seqinfo seqinfo seqnames
#' @importFrom S4Vectors queryHits subjectHits
#' @importFrom stats na.omit
#' @keywords internal
#'
postMerge <- function(startPosForwardReads, startPosReverseReads,
resultRJMCMC, extendingSize, chrLength)
{

## Prepare information about reads
segReads <- list(yF = numeric(), yR = numeric())
segReads$yF <- startPosForwardReads
Expand Down Expand Up @@ -2343,7 +2343,7 @@ postMerge <- function(startPosForwardReads, startPosReverseReads,
nbOverlap <- length(uniqueOverlap)

## Treat each overlapping region separatly
newMu <- numeric(nbOverlap)
newMu <- array(dim = nbOverlap)
cpt <- 1L
for(position in 1:nbOverlap){
## Extract nucleosomes present in the current overlapping region
Expand All @@ -2370,15 +2370,12 @@ postMerge <- function(startPosForwardReads, startPosReverseReads,
cpt <- cpt + 1L
}

## QUESTION : et si on ne respecte pas la condition,
## qu'advient-il du nucleosome
## Nucleosomes not respecting the condition are flushed
} else {
newMu[cpt] <- resultRJMCMC$mu[current]
cpt <- cpt + 1L
}

}

return(newMu)
return(as.numeric(na.omit(newMu)))
}

0 comments on commit fac0cc1

Please sign in to comment.