
"Synteny"
provides objects and functions for storing and viewing syntenic blocks and hits that are shared between sequences.
"pairs"(x, bounds = TRUE, boxBlocks = FALSE, labels = abbreviate(rownames(x), 9), gap = 0.5, line.main = 3, cex.labels = NULL, font.labels = 1, ...)
"plot"(x, colorBy = 1, colorRamp = colorRampPalette(c("#FCF9EE", "#FFF272", "#FFAC28", "#EC5931", "#EC354D", "#ECA6B1")), barColor = "#CCCCCC", barSides = ifelse(nrow(x) < 100, TRUE, FALSE), horizontal = TRUE, labels = abbreviate(rownames(x), 9), cex.labels = NULL, width = 0.7, ...)
"print"(x, quote = FALSE, right = TRUE, ...)
n
colors when given a number n
. Examples are rainbow
, heat.colors
, terrain.colors
, cm.colors
, or (the default) colorRampPalette
.
TRUE
) or vertically (FALSE
).
main
is specified, line.main
provides the line
argument to mtext
.
pairs
or plot
, including: main
, cex.main
, font.main
, and oma
. Other arguments for print
, including print.gap
and max
.
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 a sequence are colored barColor
.
AlignSynteny
, FindSynteny
# 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
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, "neighbor")
Run the code above in your browser using DataLab