PoisMS: Poisson Metric Scaling

Description Usage Arguments Value Examples

View source: R/PoisMS.R

Description

PoisMS function calculates the Poisson Metric Scaling solution for a contact matrix C and a spline basis matrix H. The optimal solution is found via minimizing the negative log-likelihood for the Poisson probabilistic model C~Pois(Λ) with

log(Λ) = -D^2(X) + β

w.r.t. Θ subject to the smooth curve constraint X = HΘ. Here D(X) refers to the matrix of pairwise distances. The solution can be calculated via iterating the second order approximation of the objective (outer PoisMS loop) and applying WPCMS to optimize the obtained quadratic approximation (inner WPCMS loop). The spatial coordiantes of the resulting reconstruction are presented in X.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
PoisMS(
  C,
  H,
  beta0 = max(log(C)),
  Theta0 = matrix(rnorm(ncol(H) * 3), ncol(H), 3),
  update_beta = TRUE,
  eps_wpcms = 1e-06,
  maxiter = 100,
  verbose_wpcms = FALSE,
  eps_poisms = 1e-06,
  maxepoch = 100,
  verbose_poisms = FALSE
)

Arguments

C

a square symmetric matrix representing a Hi-C contact matrix.

H

a spline basis matrix. By default assumed to have orthogonal columns. If not, orthogonalization should be done via QR decomposition.

beta0

an initialization for intercept beta. By default beta0 = max(log(C)).

Theta0

an initialization for spline basis coefficient matrix Theta. By defaul Theta0 = matrix(rnorm(ncol(H) * 3), ncol(H), 3), i.e. a random initialization is considered.

update_beta

If update_beta = TRUE, then the algorithm finds an optimal intercept value. If update_beta = TRUE, then the intercept is considered to be fixed and set to beta0.

eps_wpcms, eps_poisms

positive convergence tolerances for WPCMS inner loop and PoisMS outer loop.

maxiter, maxepoch

integers giving the maximal numbers of iterations for WPCMS inner loop and PoisMS outer loop.

verbose_wpcms, verbose_poisms

logical. If TRUE, the WPCMS loss after each iteration of inner loop and PoisMS loss after each epoch of outer loop are printed.

Value

A list containing the PoisMS problem solution:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(C)

#create spline basis matrix
H = splines::bs(1:ncol(C), df = 5)

#orthogonalize H using QR decomposition
H = qr.Q(qr(H))

#run PoisMS approach; fixed intercept
PoisMS(C, H, beta = 10)$X

#run PoisMS approach; optimize intercept
PoisMS(C, H)$X

ElenaTuzhilina/PoisMS documentation built on Dec. 11, 2020, 1:29 a.m.