addCon {cosmo} | R Documentation

## Add constraints to an already existing constraint set

### Description

Given a constraint set, the addCon command allows to add either interval-specific or global constraints to the constraintSet object. The possible interval-specific constraints are: boundCon (for information content bounding constraints), posFreqCon (for position frequency constraints), and shapeCon (for shape constraints). The possible global constraints are: subMotifCon (when part of the motif is known), palCon (for palindromic constraints) and shapeDiffCon (for information content differences between interval extremities). Each constraint can be built with its associated make-command: makeBoundCon, makePosFreqCon, makeShapeCon, makeSubMotifCon, makePalCon and makeShapeDiffCon.

### Usage

      addCon(conSet, constraint, int=1)

### Arguments

`conSet` | an object of class `"constraint set"`
`constraint` | list of constraints constructed with one of the 6 make constraint commands. The length of the list should be the same as that of the 'int' argument. Instead of a list, this may also be a single constraint.
`int` | vector of the intervals to which the constraints given in the constraint argument should be applied. There should be a one-to-one correspondance between the elements of the list and the interval argument. For global constraints, the value of the interval is of no importance but should be present and numeric.

### Value

The output will be an object of class `"constraintSet"` resulting of the addition of the constraints to the original constraint set passed as first argument.

### Author(s)

Fabian Gallusser, fgallusser@berkeley.edu

### See Also

`boundCon`, `posFreqCon`, `shapeCon`, `subMotifCon`, `shapeDiffCon`, `palCon` `makeBoundCon`, `makePosFreqCon`, `makeShapeCon`, `makeSubMotifCon`, `makeShapeDiffCon`, `makePalCon`

### Examples

    set=makeConSet(4,c("B","P","V","B"),c(4,50,NA,4))
    con1=makeBoundCon(1,2)
    con2=makePalCon(1,4,0.5)
    con3=makeSubMotifCon("TATA",0.6)
    con4=makePosFreqCon("2","A",0.5)
    con5=makePosFreqCon("All","G",0.4)
    conSet=addCon(set,list(con1,con2,con3,con4,con5),c(2,NA,NA,1,3))
    #Because of the palindromic constraint on intervals 1 and 4, the fourth
    #interval will inherit the nucleotide position frequency constraint
    #assigned to the first interval.

[Package cosmo version 1.8.0 Index]