Synteny {DECIPHER} | R Documentation

## Synteny blocks and hits

### Description

Syntenic blocks are DNA segments composed of conserved hits occurring in the same order on two sequences. The two sequences are typically chromosomes of different species that are hypothesized to contain homology. Class `"Synteny"` provides objects and functions for storing and viewing syntenic blocks and hits that are shared between sequences.

### Usage

    ## S3 method for class 'Synteny'
    pairs(x,
         bounds = TRUE,
         boxBlocks = FALSE,
         labels = abbreviate(rownames(x), 9),
         gap = 0.5,
         line.main = 3,
         cex.labels = NULL,
         font.labels = 1,
         ...)

    ## S3 method for class 'Synteny'
    plot(x,
         colorBy = 1,
         colorRamp = colorRampPalette(c("#FCF9EE", "#FFF272",
                                        "#FFAC28", "#EC5931",
                                        "#EC354D", "#0D0887")),
         barColor = "#CCCCCC",
         barSides = ifelse(nrow(x) < 100, TRUE, FALSE),
         horizontal = TRUE,
         labels = abbreviate(rownames(x), 9),
         cex.labels = NULL,
         width = 0.7,
         scaleBar = TRUE,
         ...)

    ## S3 method for class 'Synteny'
    print(x,
          quote = FALSE,
          right = TRUE,
          ...)

### Arguments

`x` | An object of class `Synteny`.
`bounds` | Logical specifying whether to plot sequence boundaries as horizontal or vertical lines.
`boxBlocks` | Logical indicating whether to draw a rectangle around hits belonging to the same block of synteny.
`colorBy` | Numeric giving the index of a reference sequence, or a character string indicating to color by “neighbor”, “frequency”, or “none”. (See details section below.)
`colorRamp` | A function that will return `n` colors when given a number `n`. Examples are `rainbow`, `heat.colors`, `terrain.colors`, `cm.colors`, or (the default) `colorRampPalette`.
`barColor` | Character string giving the background color of each bar.
`barSides` | Logical indicating whether to draw black lines along the long-sides of each bar.
`horizontal` | Logical indicating whether to plot the sequences horizontally (`TRUE`) or vertically (`FALSE`).
`labels` | Character vector providing names corresponding to each “identifier” for labels on the diagonal.
`width` | Numeric giving the fractional width of each bar between zero and one.
`scaleBar` | Logical controlling whether a scale bar is drawn when `colorBy` is “frequency”. The scale bar displays the mapping between color and the level of sequence conservation. Not applicable when `colorBy` is a value other than “frequency”.
`gap` | Distance between subplots, in margin lines.
`line.main` | If `main` is specified, `line.main` provides the `line` argument to `mtext`.
`cex.labels` | Magnification of the labels.
`font.labels` | Font of labels on the diagonal.
`quote` | Logical indicating whether to print the output surrounded by quotes.
`right` | Logical specifying whether to right align strings.
`...` | Other graphical parameters for `pairs` or `plot`, including: `main`, `cex.main`, `font.main`, and `oma`. Other arguments for `print`, including `print.gap` and `max`.

### Details

Objects of class `Synteny` are stored as square matrices of list elements with `dimnames` giving the “identifier” of the corresponding sequences. The synteny matrix can be separated into three parts: along, above, and below the diagonal. Each list element along the diagonal contains an integer vector with the width of the sequence(s) belonging to that “identifier”. List elements above the diagonal (column j > row i) each contain a `matrix` with “hits” corresponding to matches between sequences i and j. List elements below the diagonal each contain a `matrix` with “blocks” of synteny between sequences j and i.

The `pairs` method creates a scatterplot matrix from a `Synteny` object. Dot plots above the diagonal show hits between identifier i and j, where forward hits are colored in black, and hits to the reverse strand of identifier j are colored in red. Plots below the diagonal show blocks of synteny colored by their score, from green (highest scoring) to blue to magenta (lowest scoring).

The `plot` method displays a bar view of the sequences in the same order as the input object (`x`). The coloring scheme of each bar is determined by the `colorBy` argument, and the color palette is set by `colorRamp`. When `colorBy` is an index, the sequences are colored according to regions of shared homology with the specified reference sequence (by default `1`). If `colorBy` is “neighbor” then shared syntenic blocks are connected between neighboring sequences. If `colorBy` is “frequency” then positions in each sequence are colored based on the degree of conservation with the other sequences. In each case, regions that have no correspondence in the other sequence(s) are colored `barColor`.

### Author(s)

Erik Wright eswright@pitt.edu

### See Also

`AlignSynteny`, `FindSynteny`

### Examples

    # a small example:
    dbConn <- dbConnect(SQLite(), ":memory:")
    s1 <- DNAStringSet("ACTAGACCCAGACCGATAAACGGACTGGACAAG")
    s3 <- reverseComplement(s1)
    s2 <- c(s1, s3)
    Seqs2DB(c(c(s1, s2), s3),
            "XStringSet",
            dbConn,
            c("s1", "s2", "s2", "s3"))
    syn <- FindSynteny(dbConn, minScore=1)
    syn # Note:  > 100% hits because of sequence reuse across blocks
    pairs(syn, boxBlocks=TRUE)
    plot(syn)
    dbDisconnect(dbConn)

    # a larger example:
    db <- system.file("extdata", "Influenza.sqlite", package="DECIPHER")
    synteny <- FindSynteny(db, minScore=50)
    class(synteny) # 'Synteny'
    synteny

    # accessing parts
    i <- 1
    j <- 2
    synteny[i, i][[1]] # width of sequences in i
    synteny[j, j][[1]] # width of sequences in j
    head(synteny[i, j][[1]]) # hits between i & j
    synteny[j, i][[1]] # blocks between i & j

    # plotting
    pairs(synteny) # dot plots
    pairs(synteny, boxBlocks=TRUE) # boxes around blocks

    plot(synteny) # bar view colored by position in genome 1
    plot(synteny, barColor="#268FD6") # emphasize missing regions
    plot(synteny, "frequency") # most regions are shared by all
    plot(synteny, "frequency", colorRamp=rainbow) # change the colors
    plot(synteny, "neighbor") # connect neighbors

[Package DECIPHER version 2.14.0 Index]