mhMoveK1: Metropolis-Hastings move when number of nucleosomes is equal...

Description Usage Arguments Value Author(s) Examples

Description

Attempt to randomly change the position of one nucleosome. Special case for a number of nucleosomes equal to one. This move is given by the usual Metropolis-Hastings move, see for instance Tierney (1994).

Usage

1
2
mhMoveK1(paramValues, kValue, muValue, sigmafValue, sigmarValue, deltaValue,
  wValue, dfValue, aValue, dimValue)

Arguments

paramValues

a list containing:

  • startPSF a vector of positive integer, the start position of all the forward reads.

  • startPSR a vector of positive integer, the start position of all the reverse reads.

  • kmax a integer the maximum number of nucleosomes allowed.

  • lambda a positive numeric, the theorical mean of the Poisson distribution.

  • minReads a integer, the minimum number of reads in a potential canditate region.

  • y a vector of numeric, the position of all reads ( including forward and reverse reads).

  • nr a integer, the number of reverse reads.

  • nf a integer, the number of forward reads.

  • nbrReads a integer, the total number of reads (including forward and reverse reads).

  • zeta integer, the length of a nucleosome.

  • deltamin a integer, the minimum distance between the maxima of the forward and reverse reads position densities for each nucleosome.

  • deltamax a integer, the maximum distance between the maxima of the forward and reverse reads position densities for each nucleosome.

  • minReadPos a numeric, the minimum position of the reads.

  • maxReadPos a numeric, the maximum position of the reads.

kValue

a integer, the number of nucleosomes.

muValue

a vector of numeric of length kValue, the positions of the nucleosomes.

sigmafValue

a vector of numeric of length kValue, the variance of the forward reads for each nucleosome.

sigmarValue

a vector of numeric of length kValue, the variance of the reverse reads for each nucleosome.

deltaValue

a vector of numeric of length kValue, the distance between the maxima of the forward and reverse reads position densities for each nucleosome.

wValue

a vector of positive numerical of length kValue, the weight for each nucleosome.

dfValue

a vector of positive numerical of length kValue, the degrees of freedom for each nucleosome.

aValue

a vector of positive numerical of length kValue + 1, the positions, on the chromosome, delimiting the regions of the reads associated with each nucleosome.

dimValue

a vector of positive integer of length kValue, the number of reads associated to each nucleosome.

Value

a list containing:

Author(s)

Rawane Samb, Pascal Belleau, Astrid Deschenes

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
## Load dataset
data(reads_demo)

## Create a list containing the mandatory parameters
paramList <- list(kmax = 5L, nf = length(reads_demo$readsForward),
nr = length(reads_demo$readsReverse),
nbrReads = length(reads_demo$readsForward) + length(reads_demo$readsReverse),
y = sort(c(reads_demo$readsForward, reads_demo$readsReverse)),
startPSF = reads_demo$readsForward,
startPSR = reads_demo$readsReverse, lambda = 2,
zeta = 147, deltamin = 142, deltamax = 152,
minReadPos = min(c(reads_demo$readsReverse, reads_demo$readsForward)),
maxReadPos = max(c(reads_demo$readsReverse, reads_demo$readsForward)))

## Initial position of the nucleosome
muPosition <- c(73000)
muPosition

# Metropolis-Hastings move when 1 nucleosome present
result <- RJMCMC:::mhMoveK1(paramValues = paramList, kValue = 1L,
muValue = muPosition, sigmafValue = c(100), sigmarValue = c(120),
deltaValue = c(200), wValue = c(1), dfValue = c(3),
aValue = c(min(c(reads_demo$readsReverse, reads_demo$readsForward)),
max(c(reads_demo$readsReverse, reads_demo$readsForward))),
dimValue = c(length(reads_demo$readsForward) +
length(reads_demo$readsReverse)))

## Final position of the nucleosome
result$mu[1]

ArnaudDroitLab/RJMCMC documentation built on May 5, 2019, 7:06 a.m.