plotMiro | R Documentation |
This function takes PAF output file from minimap2 alignments, and visualize the alignments in a miropeat style.
plotMiro(
paf.table,
min.deletion.size = NULL,
min.insertion.size = NULL,
highlight.sv = NULL,
binsize = NULL,
color.by = "direction",
perc.identity.breaks = c(90, 95, 99, 99.5, 99.6, 99.7, 99.8, 99.9),
color.palette = NULL,
outline.alignments = FALSE,
offset.alignments = FALSE,
add.alignment.arrows = TRUE,
target.region = NULL,
genomic.scale = "bp"
)
paf.table |
A |
min.deletion.size |
A minimum size (in base pairs) of a deletion to be retained. |
min.insertion.size |
A minimum size (in base pairs) of an insertion to be retained. |
highlight.sv |
Visualize alignment embedded structural variation either as an outlined ('outline') or filled ('fill') miropeats. |
binsize |
A size of a bin in base pairs to split a PAF alignment into. |
color.by |
Color alignments either by directionality ('direction'), fraction of matched base pairs ('identity'), or a custom column name present in submitted 'paf.table'. |
perc.identity.breaks |
Set of percentage values to categorize alignment percent identity into a set of discrete colors. |
color.palette |
A discrete color palette defined as named character vector (elements = colors, names = discrete levels) to color alignment directionality, ‘[default: color.palette <- c(’-' = 'cornflowerblue', '+' = 'forestgreen')]'. |
outline.alignments |
Set to |
offset.alignments |
Set to |
add.alignment.arrows |
Set to |
target.region |
A user defined target region either as character string ('chr:start-end') or as
a |
genomic.scale |
Report genomic coordinates in base pairs ('bp') kilobase pairs ('kbp') or megabase pairs ('Mbp') ‘[default: ’bp']'. |
A ggplot2
object
David Porubsky
## Get PAF to plot ##
paf.file <- system.file("extdata", "test1.paf", package = "SVbyEye")
## Read in PAF
paf.table <- readPaf(paf.file = paf.file, include.paf.tags = TRUE, restrict.paf.tags = "cg")
## Optional steps include PAF filtering and flipping query coordinates
## (see filterPaf and flipPaf function documentation)
## Make a plot ##
## Color by alignment directionality
plotMiro(paf.table = paf.table, color.by = "direction")
## Color by fraction of matched bases in each alignment
plotMiro(paf.table = paf.table, color.by = "identity")
## Use custom color palette to color alignment directionality
plotMiro(paf.table = paf.table, color.palette = c("+" = "azure3", "-" = "yellow3"))
## Change genomic scale to megabase pairs
plotMiro(paf.table = paf.table, genomic.scale = "Mbp")
## Outline PAF alignments
plotMiro(paf.table = paf.table, outline.alignments = TRUE)
## Offset target PAF alignments
plotMiro(paf.table = paf.table, offset.alignments = TRUE)
## Bin PAF alignments into user defined bin and color them by sequence identity (% of matched bases)
plotMiro(paf.table = paf.table, binsize = 10000)
## Highlight structural variants
paf.file <- system.file("extdata", "test3.paf", package = "SVbyEye")
paf.table <- readPaf(paf.file = paf.file, include.paf.tags = TRUE, restrict.paf.tags = "cg")
plotMiro(paf.table = paf.table, min.deletion.size = 50, highlight.sv = "outline")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.