plot_coverage: Plot the regions of one genome that are covered by alignments...

Description Usage Arguments Details Examples

View source: R/coverage_plot.r

Description

Each sequence in the focal genome is displayed as a rectangle, with regions covered by an alignment shaded as per the fill argument described below. Uncovered regions remain white.

Usage

1
2
3
4
5
6
7
8
9
plot_coverage(
  ali,
  target = TRUE,
  fill = "forestgreen",
  direct_label = TRUE,
  label_colour = "black",
  xlab = "Position in sequence",
  x_labeller = Mb_lab
)

Arguments

ali

alignment An alignment as read by read_paf

target

logical If TRUE, display coverage for the target genome; if FALSE, display coverage for the query

fill

character How to colour the alignment blocks. If the character provided is the name of a column in the alignment, this column will be passed to ggplot2 to shade alignment blocks. Otherwise, the character is treated as a single colour to be used for all alignment blocks.

direct_label

logical If TRUE, use geom_text to directly label the name of the focal sequences; if FALSE, no direct labels are drawn

label_colour

character Colour used for direct labels

xlab

string Name for the x-axis

x_labeller

function Function to be used to label the x-axis (defaults to Mb_lab

Details

Note that this function uses theme_coverage_plot to style the graph. Using another ggplot theme on the plot may produce unexpected results.

Examples

1
2
3
4
ali <- read_paf( system.file("extdata", "fungi.paf", package="pafr") )
plot_coverage(ali)
plot_coverage(ali, fill='qname', direct_label=FALSE) + 
   scale_fill_brewer(palette="Set1")

pafr documentation built on Dec. 8, 2020, 5:06 p.m.