Learn R Programming

seqinr (version 4.2-36)

extract.breakpoints: Extraction of breakpoint positions on the rearranged nucleotide skews.

Description

Extraction of breakpoint positions on the rearranged nucleotide skews.

Usage

extract.breakpoints(rearr.ori,
type = c("atfw", "atrev", "gcfw", "gcrev"),
 nbreaks, gridsize = 100, it.max = 500)

Value

This function returns a list, with as many elements as the type

argument (for example $gcfw will contain the results for the rearranged GC-skew, for forward-encoded genes). Each element of this list is also a list, containing the following information: in $breaks the position of the breakpoints on the rearranged chromosome; in $slopes.left the slopes of the segments on the left side of each breakpoint; in $slopes.right the slopes of the segments on the right side of each breakpoint; in $real.coord, the coordinates of the breakpoints on the real chromosome (before rearrangement).

Arguments

rearr.ori

A data frame obtained with the rearranged.oriloc function.

type

The type of skew for which to extract the breakpoints; must be a subset of c("atfw","atrev","gcfw","gcrev").

nbreaks

The number of breakpoints to extract for each type of skew. Provide a vector of the same length as type.

gridsize

To make sure that the best breakpoints are found, and to avoid finding only a local extremum of the likelihood and residual sum of square functions, a grid search is performed. The search for breakpoints is repeated gridsize times, with different starting values for the breakpoints.

it.max

The maximum number of iterations to be performed when searching for the breakpoints. This argument corresponds to the it.max argument in segmented.

Author

A. Necşulea

Details

This method uses the segmented function in the segmented package to extract the breakpoints positions in the rearranged nucleotide skews obtained with the rearranged.oriloc function. To make sure that the best breakpoints are found, and to avoid finding only a local extremum of the likelihood and residual sum of square functions, a grid search is performed. The search for breakpoints is repeated gridsize times, with different starting values for the breakpoints.

References

citation("segmented")

Necşulea, A. and Lobry, J.R. (in prep) A novel method for assessing the effect of replication on DNA base composition asymmetry. Molecular Biology and Evolution,24:2169-2179.

See Also

oriloc, draw.rearranged.oriloc, rearranged.oriloc

Examples

Run this code

### Example for Chlamydia trachomatis ####

### Rearrange the chromosome and compute the nucleotide skews ###

if (FALSE) r.ori <- rearranged.oriloc(seq.fasta = system.file("sequences/ct.fasta.gz", package = "seqinr"),
    g2.coord = system.file("sequences/ct.coord",package = "seqinr"))

### Extract the breakpoints for the rearranged nucleotide skews ###


if (FALSE) breaks <- extract.breakpoints(r.ori,type = c("gcfw", "gcrev"),
 nbreaks = c(2, 2), gridsize = 50, it.max = 100)


### Draw the rearranged nucleotide skews and ###
### place the position of the breakpoints on the graphics ###

if (FALSE) draw.rearranged.oriloc(r.ori, breaks.gcfw = breaks$gcfw$breaks,
 breaks.gcrev = breaks$gcrev$breaks)

Run the code above in your browser using DataLab