Last data update: 2014.03.03

R: Update a parameter value in the calibration model
updateCalibR Documentation

Update a parameter value in the calibration model

Description

A function to update a given parameter in the calibration model.

Usage

updateCalib(calib, paramVal, paramIndex)

Arguments

calib

A list with f, the calibration function, and params a list of parameters for f. This object can be generated with the function prepareCalib.

paramVal

The new value of the parameter to be updated.

paramIndex

The index of the parameter to be updated in the parameter list of calib.

Details

Users may want to refine the parameters of the calibration model. For example, in the model generated with prepareCalib
the user may wish to increase the threshold value in order to discard less information in the calibration step.

Value

An updated calibration model (an updated calib object).

Author(s)

Yoli Shavit

References

Y. Shavit, F.K. Hamey, P. Lio', FisHiCal: an R package for iterative FISH-based calibration of Hi-C data, 2014 (submitted).

See Also

prepareCalib
calibrate
match

Examples

 
 data(match) 
 npoints = 10 # number of points to fit
 
 # prepareCalib computes threshold according to the fit 
 # useMax is set to FALSE
 res = prepareCalib(match, npoints, useMax = FALSE)
 calib = res$calib
 calib
 calib = updateCalib(calib, 3.9, 3)
 calib
             

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(FisHiCal)
Loading required package: igraph

Attaching package: 'igraph'

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union

Loading required package: RcppArmadillo
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/FisHiCal/updateCalib.Rd_%03d_medium.png", width=480, height=480)
> ### Name: updateCalib
> ### Title: Update a parameter value in the calibration model
> ### Aliases: updateCalib
> 
> ### ** Examples
>  
>  data(match) 
>  npoints = 10 # number of points to fit
>  
>  # prepareCalib computes threshold according to the fit 
>  # useMax is set to FALSE
>  res = prepareCalib(match, npoints, useMax = FALSE)
>  calib = res$calib
>  calib
$f
function (m, params) 
{
    a = params[[1]]
    b = params[[2]]
    threshold = params[[3]]
    m = exp((log(m) - b)/a)
    m[m == Inf] = 0
    m[m > threshold] = 0
    return(m)
}
<environment: 0x22ac988>

$params
$params[[1]]
[1] -2

$params[[2]]
[1] 10

$params[[3]]
[1] 22.79646


>  calib = updateCalib(calib, 3.9, 3)
>  calib
$f
function (m, params) 
{
    a = params[[1]]
    b = params[[2]]
    threshold = params[[3]]
    m = exp((log(m) - b)/a)
    m[m == Inf] = 0
    m[m > threshold] = 0
    return(m)
}
<environment: 0x22ac988>

$params
$params[[1]]
[1] -2

$params[[2]]
[1] 10

$params[[3]]
[1] 3.9


>              
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>