plot_coverage {pafr}R Documentation

Plot the regions of one genome that are covered by alignments in a paf file

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

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

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")

[Package pafr version 0.0.2 Index]